```
to start a local webserver at [`http://localhost:1313`](http://localhost:1313).
+
+# generating docs-rs
+
+To create or re-create the contents of `static/docs-rs/bdk/<release>`, copy the contents of
+the `bdk/target/doc` directory after running the below commands from the `bdk` project directory:
+
+ ```
+ cargo clean
+ cargo doc --no-deps
+ ```
[[Languages.en.menu.shortcuts]]
name = "<i class='fas fa-book-open'></i> Rust Docs"
-url = "/docs-rs/magical/"
+url = "/docs-rs/bdk/"
weight = 5
[[Languages.en.menu.shortcuts]]
This concept leads to a few design choices that are arguably very bad for the "UX" of this wallet, but that allow developers to work more directly with the underlying library. For instance:
-* BDK has an internal database that's used to store data about received transactions, spendable UTXOs, etc. This database is stored by default in your home folder, in `~/.bdk`. The database
+* BDK has an internal database that's used to store data about received transactions, spendable UTXOs, etc. This database is stored by default in your home folder, in `~/.bdk-bitcoin`. The database
**will never** contain any data that can't be recreated purely by looking at the blockchain. Keys, descriptors, Electrum endpoints **are not stored in there**. This explains why you'll have to specify them every
time in the command line. It can be seen more like a *cache* and can be safely deleted without risking funds.
* BDK doesn't automatically "monitor" the blockchain, instead there's a `sync` command that has to be called by the user.
by running `repl --help` which should print something like this:
```text
-BDK repl 0.1.0
+Magical Bitcoin Wallet 0.1.0
Riccardo Casatta <riccardo@casatta.it>:Alekos Filini <alekos.filini@gmail.com>
A modern, lightweight, descriptor-based wallet
sign Signs and tries to finalize a PSBT
sync Syncs with the chosen Electrum server
```
+
+An example command to sync a testnet wallet looks like this:
+
+```
+repl --descriptor "wpkh(tprv8ZgxMBicQKsPexGYyaFwnAsCXCjmz2FaTm6LtesyyihjbQE3gRMfXqQBXKM43DvC1UgRVv1qom1qFxNMSqVAs88qx9PhgFnfGVUdiiDf6j4/0/*)" --network testnet --server tcp://testnet.aranguren.org:51001 sync
+```
\ No newline at end of file
command. You only have to do this once when you open a new shell, after that you can run the `repl` command multiple times.
```bash
-export RUST_LOG="bdk_repl=debug"
+export RUST_LOG="bdk=debug"
```
## Options
on macOS you should change the cookie-file to `$HOME/Library/Application Support/Bitcoin/regtest/.cookie`.
-This will start the Electrum server on port 50001. You can then add the `-n regtest -s localhost:50001` the `bdk` commands to switch to the local regtest.
+This will start the Electrum server on port 50001. You can then add the `-n regtest -s localhost:50001` the `repl` commands to switch to the local regtest.
## Troubleshooting
-test.bitcoindevkit.org
\ No newline at end of file
+bitcoindevkit.org
\ No newline at end of file
--- /dev/null
+These documentation pages include resources by third parties. This copyright
+file applies only to those resources. The following third party resources are
+included, and carry their own copyright notices and license terms:
+
+* Fira Sans (FiraSans-Regular.woff, FiraSans-Medium.woff):
+
+ Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
+ with Reserved Font Name Fira Sans.
+
+ Copyright (c) 2014, Telefonica S.A.
+
+ Licensed under the SIL Open Font License, Version 1.1.
+ See FiraSans-LICENSE.txt.
+
+* rustdoc.css, main.js, and playpen.js:
+
+ Copyright 2015 The Rust Developers.
+ Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or
+ the MIT license (LICENSE-MIT.txt) at your option.
+
+* normalize.css:
+
+ Copyright (c) Nicolas Gallagher and Jonathan Neal.
+ Licensed under the MIT license (see LICENSE-MIT.txt).
+
+* Source Code Pro (SourceCodePro-Regular.woff, SourceCodePro-Semibold.woff):
+
+ Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
+ with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark
+ of Adobe Systems Incorporated in the United States and/or other countries.
+
+ Licensed under the SIL Open Font License, Version 1.1.
+ See SourceCodePro-LICENSE.txt.
+
+* Source Serif Pro (SourceSerifPro-Regular.ttf.woff,
+ SourceSerifPro-Bold.ttf.woff, SourceSerifPro-It.ttf.woff):
+
+ Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/), with
+ Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of
+ Adobe Systems Incorporated in the United States and/or other countries.
+
+ Licensed under the SIL Open Font License, Version 1.1.
+ See SourceSerifPro-LICENSE.txt.
+
+This copyright file is intended to be distributed with rustdoc output.
--- /dev/null
+Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A.
+with Reserved Font Name < Fira >,
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
--- /dev/null
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
--- /dev/null
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
--- /dev/null
+Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+
+This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
--- /dev/null
+Copyright 2014-2018 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries.
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+
+This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
--- /dev/null
+<!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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../bdk/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span>
+ </span>
+ <span class='in-band'>List of all items</span></h1><h3 id='Structs'>Structs</h3><ul class='structs docblock'><li><a href='struct.FeeRate.html'>FeeRate</a></li><li><a href='struct.TransactionDetails.html'>TransactionDetails</a></li><li><a href='struct.UTXO.html'>UTXO</a></li><li><a href='blockchain/struct.LogProgress.html'>blockchain::LogProgress</a></li><li><a href='blockchain/struct.NoopProgress.html'>blockchain::NoopProgress</a></li><li><a href='blockchain/struct.OfflineBlockchain.html'>blockchain::OfflineBlockchain</a></li><li><a href='blockchain/compact_filters/struct.CompactFiltersBlockchain.html'>blockchain::compact_filters::CompactFiltersBlockchain</a></li><li><a href='blockchain/compact_filters/struct.Mempool.html'>blockchain::compact_filters::Mempool</a></li><li><a href='blockchain/compact_filters/struct.Peer.html'>blockchain::compact_filters::Peer</a></li><li><a href='blockchain/electrum/struct.ElectrumBlockchain.html'>blockchain::electrum::ElectrumBlockchain</a></li><li><a href='blockchain/esplora/struct.EsploraBlockchain.html'>blockchain::esplora::EsploraBlockchain</a></li><li><a href='database/memory/struct.MemoryDatabase.html'>database::memory::MemoryDatabase</a></li><li><a href='descriptor/struct.Miniscript.html'>descriptor::Miniscript</a></li><li><a href='descriptor/policy/struct.Condition.html'>descriptor::policy::Condition</a></li><li><a href='descriptor/policy/struct.PKOrF.html'>descriptor::policy::PKOrF</a></li><li><a href='descriptor/policy/struct.Policy.html'>descriptor::policy::Policy</a></li><li><a href='wallet/struct.Wallet.html'>wallet::Wallet</a></li><li><a href='wallet/coin_selection/struct.CoinSelectionResult.html'>wallet::coin_selection::CoinSelectionResult</a></li><li><a href='wallet/coin_selection/struct.DumbCoinSelection.html'>wallet::coin_selection::DumbCoinSelection</a></li><li><a href='wallet/export/struct.WalletExport.html'>wallet::export::WalletExport</a></li><li><a href='wallet/signer/struct.SignerOrdering.html'>wallet::signer::SignerOrdering</a></li><li><a href='wallet/signer/struct.SignersContainer.html'>wallet::signer::SignersContainer</a></li><li><a href='wallet/tx_builder/struct.TxBuilder.html'>wallet::tx_builder::TxBuilder</a></li></ul><h3 id='Enums'>Enums</h3><ul class='enums docblock'><li><a href='enum.Error.html'>Error</a></li><li><a href='enum.ScriptType.html'>ScriptType</a></li><li><a href='blockchain/enum.Capability.html'>blockchain::Capability</a></li><li><a href='blockchain/compact_filters/enum.CompactFiltersError.html'>blockchain::compact_filters::CompactFiltersError</a></li><li><a href='blockchain/esplora/enum.EsploraError.html'>blockchain::esplora::EsploraError</a></li><li><a href='descriptor/enum.Descriptor.html'>descriptor::Descriptor</a></li><li><a href='descriptor/enum.Legacy.html'>descriptor::Legacy</a></li><li><a href='descriptor/enum.Segwitv0.html'>descriptor::Segwitv0</a></li><li><a href='descriptor/enum.Terminal.html'>descriptor::Terminal</a></li><li><a href='descriptor/error/enum.Error.html'>descriptor::error::Error</a></li><li><a href='descriptor/policy/enum.PolicyError.html'>descriptor::policy::PolicyError</a></li><li><a href='descriptor/policy/enum.Satisfaction.html'>descriptor::policy::Satisfaction</a></li><li><a href='descriptor/policy/enum.SatisfiableItem.html'>descriptor::policy::SatisfiableItem</a></li><li><a href='wallet/address_validator/enum.AddressValidatorError.html'>wallet::address_validator::AddressValidatorError</a></li><li><a href='wallet/signer/enum.SignerError.html'>wallet::signer::SignerError</a></li><li><a href='wallet/signer/enum.SignerId.html'>wallet::signer::SignerId</a></li><li><a href='wallet/tx_builder/enum.ChangeSpendPolicy.html'>wallet::tx_builder::ChangeSpendPolicy</a></li><li><a href='wallet/tx_builder/enum.TxOrdering.html'>wallet::tx_builder::TxOrdering</a></li></ul><h3 id='Traits'>Traits</h3><ul class='traits docblock'><li><a href='blockchain/trait.Blockchain.html'>blockchain::Blockchain</a></li><li><a href='blockchain/trait.BlockchainMarker.html'>blockchain::BlockchainMarker</a></li><li><a href='blockchain/trait.Progress.html'>blockchain::Progress</a></li><li><a href='database/trait.BatchDatabase.html'>database::BatchDatabase</a></li><li><a href='database/trait.BatchOperations.html'>database::BatchOperations</a></li><li><a href='database/trait.Database.html'>database::Database</a></li><li><a href='descriptor/trait.ExtractPolicy.html'>descriptor::ExtractPolicy</a></li><li><a href='descriptor/trait.MiniscriptKey.html'>descriptor::MiniscriptKey</a></li><li><a href='descriptor/trait.ScriptContext.html'>descriptor::ScriptContext</a></li><li><a href='descriptor/trait.ToPublicKey.html'>descriptor::ToPublicKey</a></li><li><a href='wallet/trait.IsDust.html'>wallet::IsDust</a></li><li><a href='wallet/address_validator/trait.AddressValidator.html'>wallet::address_validator::AddressValidator</a></li><li><a href='wallet/coin_selection/trait.CoinSelectionAlgorithm.html'>wallet::coin_selection::CoinSelectionAlgorithm</a></li><li><a href='wallet/signer/trait.Signer.html'>wallet::signer::Signer</a></li></ul><h3 id='Functions'>Functions</h3><ul class='functions docblock'><li><a href='blockchain/fn.log_progress.html'>blockchain::log_progress</a></li><li><a href='blockchain/fn.noop_progress.html'>blockchain::noop_progress</a></li><li><a href='blockchain/fn.progress.html'>blockchain::progress</a></li><li><a href='descriptor/checksum/fn.get_checksum.html'>descriptor::checksum::get_checksum</a></li><li><a href='wallet/time/fn.get_timestamp.html'>wallet::time::get_timestamp</a></li></ul><h3 id='Typedefs'>Typedefs</h3><ul class='typedefs docblock'><li><a href='blockchain/type.ProgressData.html'>blockchain::ProgressData</a></li><li><a href='descriptor/type.ExtendedDescriptor.html'>descriptor::ExtendedDescriptor</a></li><li><a href='descriptor/type.HDKeyPaths.html'>descriptor::HDKeyPaths</a></li><li><a href='descriptor/policy/type.ConditionMap.html'>descriptor::policy::ConditionMap</a></li><li><a href='descriptor/policy/type.FoldedConditionMap.html'>descriptor::policy::FoldedConditionMap</a></li><li><a href='wallet/type.OfflineWallet.html'>wallet::OfflineWallet</a></li><li><a href='wallet/coin_selection/type.DefaultCoinSelectionAlgorithm.html'>wallet::coin_selection::DefaultCoinSelectionAlgorithm</a></li></ul></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "bdk";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `CompactFiltersError` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, CompactFiltersError"><title>bdk::blockchain::compact_filters::CompactFiltersError - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum CompactFiltersError</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.BIP158">BIP158</a><a href="#variant.DB">DB</a><a href="#variant.DataCorruption">DataCorruption</a><a href="#variant.Global">Global</a><a href="#variant.IO">IO</a><a href="#variant.InvalidFilter">InvalidFilter</a><a href="#variant.InvalidFilterHeader">InvalidFilterHeader</a><a href="#variant.InvalidHeaders">InvalidHeaders</a><a href="#variant.InvalidResponse">InvalidResponse</a><a href="#variant.MissingBlock">MissingBlock</a><a href="#variant.NoPeers">NoPeers</a><a href="#variant.NotConnected">NotConnected</a><a href="#variant.Time">Time</a><a href="#variant.Timeout">Timeout</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Error">Error</a><a href="#impl-From%3CCompactFiltersError%3E">From<CompactFiltersError></a><a href="#impl-From%3CError%3E">From<Error></a><a href="#impl-From%3CSystemTimeError%3E">From<SystemTimeError></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>compact_filters</a></p><script>window.sidebarCurrent = {name: 'CompactFiltersError', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#465-498' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>compact_filters</a>::<wbr><a class="enum" href=''>CompactFiltersError</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum CompactFiltersError {
+ InvalidResponse,
+ InvalidHeaders,
+ InvalidFilterHeader,
+ InvalidFilter,
+ MissingBlock,
+ DataCorruption,
+ NotConnected,
+ Timeout,
+ NoPeers,
+ DB(Error),
+ IO(<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>),
+ BIP158(Error),
+ Time(<a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.SystemTimeError.html" title="struct std::time::SystemTimeError">SystemTimeError</a>),
+ Global(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><<a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>),
+}</pre></div><div class='docblock'><p>An error that can occur during sync with a [<code>CompactFiltersBlockchain</code>]</p>
+</div><h2 id='variants' class='variants small-section-header'>
+ Variants<a href='#variants' class='anchor'></a></h2>
+<div id="variant.InvalidResponse" class="variant small-section-header"><a href="#variant.InvalidResponse" class="anchor field"></a><code id='InvalidResponse.v'>InvalidResponse</code></div><div class='docblock'><p>A peer sent an invalid or unexpected response</p>
+</div><div id="variant.InvalidHeaders" class="variant small-section-header"><a href="#variant.InvalidHeaders" class="anchor field"></a><code id='InvalidHeaders.v'>InvalidHeaders</code></div><div class='docblock'><p>The headers returned are invalid</p>
+</div><div id="variant.InvalidFilterHeader" class="variant small-section-header"><a href="#variant.InvalidFilterHeader" class="anchor field"></a><code id='InvalidFilterHeader.v'>InvalidFilterHeader</code></div><div class='docblock'><p>The compact filter headers returned are invalid</p>
+</div><div id="variant.InvalidFilter" class="variant small-section-header"><a href="#variant.InvalidFilter" class="anchor field"></a><code id='InvalidFilter.v'>InvalidFilter</code></div><div class='docblock'><p>The compact filter returned is invalid</p>
+</div><div id="variant.MissingBlock" class="variant small-section-header"><a href="#variant.MissingBlock" class="anchor field"></a><code id='MissingBlock.v'>MissingBlock</code></div><div class='docblock'><p>The peer is missing a block in the valid chain</p>
+</div><div id="variant.DataCorruption" class="variant small-section-header"><a href="#variant.DataCorruption" class="anchor field"></a><code id='DataCorruption.v'>DataCorruption</code></div><div class='docblock'><p>The data stored in the block filters storage are corrupted</p>
+</div><div id="variant.NotConnected" class="variant small-section-header"><a href="#variant.NotConnected" class="anchor field"></a><code id='NotConnected.v'>NotConnected</code></div><div class='docblock'><p>A peer is not connected</p>
+</div><div id="variant.Timeout" class="variant small-section-header"><a href="#variant.Timeout" class="anchor field"></a><code id='Timeout.v'>Timeout</code></div><div class='docblock'><p>A peer took too long to reply to one of our messages</p>
+</div><div id="variant.NoPeers" class="variant small-section-header"><a href="#variant.NoPeers" class="anchor field"></a><code id='NoPeers.v'>NoPeers</code></div><div class='docblock'><p>No peers have been specified</p>
+</div><div id="variant.DB" class="variant small-section-header"><a href="#variant.DB" class="anchor field"></a><code id='DB.v'>DB(Error)</code></div><div class='docblock'><p>Internal database error</p>
+</div><div id="variant.IO" class="variant small-section-header"><a href="#variant.IO" class="anchor field"></a><code id='IO.v'>IO(<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>)</code></div><div class='docblock'><p>Internal I/O error</p>
+</div><div id="variant.BIP158" class="variant small-section-header"><a href="#variant.BIP158" class="anchor field"></a><code id='BIP158.v'>BIP158(Error)</code></div><div class='docblock'><p>Invalid BIP158 filter</p>
+</div><div id="variant.Time" class="variant small-section-header"><a href="#variant.Time" class="anchor field"></a><code id='Time.v'>Time(<a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.SystemTimeError.html" title="struct std::time::SystemTimeError">SystemTimeError</a>)</code></div><div class='docblock'><p>Internal system time error</p>
+</div><div id="variant.Global" class="variant small-section-header"><a href="#variant.Global" class="anchor field"></a><code id='Global.v'>Global(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><<a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>)</code></div><div class='docblock'><p>Wrapper for [<code>crate::error::Error</code>]</p>
+</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#464' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#464' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#500-504' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#501-503' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Error' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-Error' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#506' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.source' class="method hidden"><code id='source.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source' class='fnname'>source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><span class='since' title='Stable since Rust version 1.30.0'>1.30.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#100-102' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
+</div><h4 id='method.backtrace' class="method hidden"><code id='backtrace.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace' class='fnname'>backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#128-130' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>backtrace</code>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
+</div><h4 id='method.description' class="method hidden"><code id='description.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description' class='fnname'>description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#140-142' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
+</div></div><div class='docblock hidden'><p><code>if let Err(e) = "xc".parse::<u32>() { // Print </code>e<code> itself, no need for description(). eprintln!("Error: {}", e); }</code> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></p>
+</div><h4 id='method.cause' class="method hidden"><code id='cause.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#150-152' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
+</div></div></div><h3 id='impl-From%3CCompactFiltersError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>> for <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CCompactFiltersError%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/error.rs.html#133-140' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(other: <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>) -> Self</code><a class='srclink' href='../../../src/bdk/error.rs.html#134-139' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-From%3CError%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#510-514' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#511-513' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-1' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>> for <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-From%3CError%3E-1' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#510-514' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code id='from.v-2'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>) -> Self</code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#511-513' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-2' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-From%3CError%3E-2' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#510-514' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-3' class="method hidden"><code id='from.v-3'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#511-513' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-3' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>> for <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-From%3CError%3E-3' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#523-527' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-5' class="method hidden"><code id='from.v-5'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>) -> Self</code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#524-526' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CSystemTimeError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.SystemTimeError.html" title="struct std::time::SystemTimeError">SystemTimeError</a>> for <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-From%3CSystemTimeError%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#510-514' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-4' class="method hidden"><code id='from.v-4'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.SystemTimeError.html" title="struct std::time::SystemTimeError">SystemTimeError</a>) -> Self</code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#511-513' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-6' class="method hidden"><code id='from.v-6'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2219-2229' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2221-2228' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `compact_filters` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, compact_filters"><title>bdk::blockchain::compact_filters - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module compact_filters</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'compact_filters', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#25-527' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a class="mod" href=''>compact_filters</a></span></h1><div class='docblock'><p>Compact Filters</p>
+<p>This module contains a multithreaded implementation of an [<code>Blockchain</code>] backend that
+uses BIP157 (aka "Neutrino") to populate the wallet's <a href="crate::database::Database">database</a>
+by downloading compact filters from the P2P network.</p>
+<p>Since there are currently very few peers "in the wild" that advertise the required service
+flag, this implementation requires that one or more known peers are provided by the user.
+No dns or other kinds of peer discovery are done internally.</p>
+<p>Moreover, this module doesn't currently support detecting and resolving conflicts between
+messages received by different peers. Thus, it's recommended to use this module by only
+connecting to a single peer at a time, optionally by opening multiple connections if it's
+desirable to use multiple threads at once to sync in parallel.</p>
+<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> <span class="ident">num_threads</span> <span class="op">=</span> <span class="number">4</span>;
+
+<span class="kw">let</span> <span class="ident">mempool</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Mempool</span>::<span class="ident">default</span>());
+<span class="kw">let</span> <span class="ident">peers</span> <span class="op">=</span> (<span class="number">0</span>..<span class="ident">num_threads</span>)
+ .<span class="ident">map</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">Peer</span>::<span class="ident">connect</span>(
+ <span class="string">"btcd-mainnet.lightning.computer:8333"</span>,
+ <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">mempool</span>),
+ <span class="ident">Network</span>::<span class="ident">Bitcoin</span>,
+ ))
+ .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()<span class="question-mark">?</span>;
+<span class="kw">let</span> <span class="ident">blockchain</span> <span class="op">=</span> <span class="ident">CompactFiltersBlockchain</span>::<span class="ident">new</span>(<span class="ident">peers</span>, <span class="string">"./wallet-filters"</span>, <span class="prelude-val">Some</span>(<span class="number">500_000</span>))<span class="question-mark">?</span>;</pre></div>
+</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
+<table><tr class='module-item'><td><a class="struct" href="struct.CompactFiltersBlockchain.html" title='bdk::blockchain::compact_filters::CompactFiltersBlockchain struct'>CompactFiltersBlockchain</a></td><td class='docblock-short'><p>Structure implementing the required blockchain traits</p>
+</td></tr><tr class='module-item'><td><a class="struct" href="struct.Mempool.html" title='bdk::blockchain::compact_filters::Mempool struct'>Mempool</a></td><td class='docblock-short'><p>Container for unconfirmed, but valid Bitcoin transactions</p>
+</td></tr><tr class='module-item'><td><a class="struct" href="struct.Peer.html" title='bdk::blockchain::compact_filters::Peer struct'>Peer</a></td><td class='docblock-short'><p>A Bitcoin peer</p>
+</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
+<table><tr class='module-item'><td><a class="enum" href="enum.CompactFiltersError.html" title='bdk::blockchain::compact_filters::CompactFiltersError enum'>CompactFiltersError</a></td><td class='docblock-short'><p>An error that can occur during sync with a [<code>CompactFiltersBlockchain</code>]</p>
+</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="refresh" content="0;URL=../../../../bdk/blockchain/compact_filters/struct.Mempool.html">
+</head>
+<body>
+ <p>Redirecting to <a href="../../../../bdk/blockchain/compact_filters/struct.Mempool.html">../../../../bdk/blockchain/compact_filters/struct.Mempool.html</a>...</p>
+ <script>location.replace("../../../../bdk/blockchain/compact_filters/struct.Mempool.html" + location.search + location.hash);</script>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="refresh" content="0;URL=../../../../bdk/blockchain/compact_filters/struct.Peer.html">
+</head>
+<body>
+ <p>Redirecting to <a href="../../../../bdk/blockchain/compact_filters/struct.Peer.html">../../../../bdk/blockchain/compact_filters/struct.Peer.html</a>...</p>
+ <script>location.replace("../../../../bdk/blockchain/compact_filters/struct.Peer.html" + location.search + location.hash);</script>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"enum":[["CompactFiltersError","An error that can occur during sync with a [`CompactFiltersBlockchain`]"]],"struct":[["CompactFiltersBlockchain","Structure implementing the required blockchain traits"],["Mempool","Container for unconfirmed, but valid Bitcoin transactions"],["Peer","A Bitcoin peer"]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `CompactFiltersBlockchain` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, CompactFiltersBlockchain"><title>bdk::blockchain::compact_filters::CompactFiltersBlockchain - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct CompactFiltersBlockchain</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Blockchain">Blockchain</a><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-BlockchainMarker">BlockchainMarker</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>compact_filters</a></p><script>window.sidebarCurrent = {name: 'CompactFiltersBlockchain', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#100-104' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>compact_filters</a>::<wbr><a class="struct" href=''>CompactFiltersBlockchain</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct CompactFiltersBlockchain { /* fields omitted */ }</pre></div><div class='docblock'><p>Structure implementing the required blockchain traits</p>
+<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
+<p>See the <a href="crate::blockchain::compact_filters"><code>blockchain::compact_filters</code></a> module for a usage example.</p>
+</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#106-231' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a><P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>>>(<br> peers: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Peer.html" title="struct bdk::blockchain::compact_filters::Peer">Peer</a>>, <br> storage_dir: P, <br> skip_blocks: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#115-149' title='goto source code'>[src]</a></h4><div class='docblock'><p>Construct a new instance given a list of peers, a path to store headers and block
+filters downloaded during the sync and optionally a number of blocks to ignore starting
+from the genesis while scanning for the wallet's outputs.</p>
+<p>For each [<code>Peer</code>] specified a new thread will be spawned to download and verify the filters
+in parallel. It's currently recommended to only connect to a single peer to avoid
+inconsistencies in the data returned, optionally with multiple connections in parallel to
+speed-up the sync process.</p>
+</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Blockchain' class='impl'><code class='in-band'>impl <a class="trait" href="../../../bdk/blockchain/trait.Blockchain.html" title="trait bdk::blockchain::Blockchain">Blockchain</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-Blockchain' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#233-461' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_capabilities' class="method hidden"><code id='get_capabilities.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.get_capabilities' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a>></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#234-236' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the set of [<code>Capability</code>] supported by this backend</p>
+</div><h4 id='method.setup' class="method hidden"><code id='setup.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.setup' class='fnname'>setup</a><D: <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a>>(<br> &self, <br> _stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#238-439' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Setup the backend and populate the internal database for the first time <a href="../../../bdk/blockchain/trait.Blockchain.html#tymethod.setup">Read more</a></p>
+</div><h4 id='method.get_tx' class="method hidden"><code id='get_tx.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.get_tx' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#441-445' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Fetch a transaction from the blockchain given its txid</p>
+</div><h4 id='method.broadcast' class="method hidden"><code id='broadcast.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.broadcast' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#447-451' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Broadcast a transaction</p>
+</div><h4 id='method.get_height' class="method hidden"><code id='get_height.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.get_height' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#453-455' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the current height</p>
+</div><h4 id='method.estimate_fee' class="method hidden"><code id='estimate_fee.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.estimate_fee' class='fnname'>estimate_fee</a>(&self, _target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#457-460' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Estimate the fee rate required to confirm a transaction in a given <code>target</code> of blocks</p>
+</div><h4 id='method.sync' class="method hidden"><code id='sync.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#method.sync' class='fnname'>sync</a><D: <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/mod.rs.html#135-142' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Populate the internal database with transactions and UTXOs <a href="../../../bdk/blockchain/trait.Blockchain.html#method.sync">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#99' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/mod.rs.html#99' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-BlockchainMarker' class='impl'><code class='in-band'>impl<T> <a class="trait" href="../../../bdk/blockchain/trait.BlockchainMarker.html" title="trait bdk::blockchain::BlockchainMarker">BlockchainMarker</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="../../../bdk/blockchain/trait.Blockchain.html" title="trait bdk::blockchain::Blockchain">Blockchain</a>, </span></code><a href='#impl-BlockchainMarker' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/mod.rs.html#88' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Mempool` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Mempool"><title>bdk::blockchain::compact_filters::Mempool - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Mempool</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.add_tx">add_tx</a><a href="#method.get_tx">get_tx</a><a href="#method.has_tx">has_tx</a><a href="#method.iter_txs">iter_txs</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>compact_filters</a></p><script>window.sidebarCurrent = {name: 'Mempool', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#58-60' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>compact_filters</a>::<wbr><a class="struct" href=''>Mempool</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Mempool { /* fields omitted */ }</pre></div><div class='docblock'><p>Container for unconfirmed, but valid Bitcoin transactions</p>
+<p>It is normally shared between [<code>Peer</code>]s with the use of [<code>Arc</code>], so that transactions are not
+duplicated in memory.</p>
+</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Mempool.html" title="struct bdk::blockchain::compact_filters::Mempool">Mempool</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#62-90' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.add_tx' class="method"><code id='add_tx.v'>pub fn <a href='#method.add_tx' class='fnname'>add_tx</a>(&self, tx: Transaction)</code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#67-69' title='goto source code'>[src]</a></h4><div class='docblock'><p>Add a transaction to the mempool</p>
+<p>Note that this doesn't propagate the transaction to other
+peers. To do that, <a href="crate::blockchain::Blockchain::broadcast"><code>broadcast</code></a> should be used.</p>
+</div><h4 id='method.get_tx' class="method"><code id='get_tx.v'>pub fn <a href='#method.get_tx' class='fnname'>get_tx</a>(&self, inventory: &Inventory) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#72-79' title='goto source code'>[src]</a></h4><div class='docblock'><p>Look-up a transaction in the mempool given an [<code>Inventory</code>] request</p>
+</div><h4 id='method.has_tx' class="method"><code id='has_tx.v'>pub fn <a href='#method.has_tx' class='fnname'>has_tx</a>(&self, txid: &Txid) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#82-84' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return whether or not the mempool contains a transaction with a given txid</p>
+</div><h4 id='method.iter_txs' class="method"><code id='iter_txs.v'>pub fn <a href='#method.iter_txs' class='fnname'>iter_txs</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Transaction></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#87-89' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the list of transactions contained in the mempool</p>
+</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Mempool.html" title="struct bdk::blockchain::compact_filters::Mempool">Mempool</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#57' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#57' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Mempool.html" title="struct bdk::blockchain::compact_filters::Mempool">Mempool</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#57' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Mempool.html" title="struct bdk::blockchain::compact_filters::Mempool">Mempool</a></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#57' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Mempool.html" title="struct bdk::blockchain::compact_filters::Mempool">Mempool</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Mempool.html" title="struct bdk::blockchain::compact_filters::Mempool">Mempool</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Mempool.html" title="struct bdk::blockchain::compact_filters::Mempool">Mempool</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Mempool.html" title="struct bdk::blockchain::compact_filters::Mempool">Mempool</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Mempool.html" title="struct bdk::blockchain::compact_filters::Mempool">Mempool</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Peer` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Peer"><title>bdk::blockchain::compact_filters::Peer - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Peer</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.connect">connect</a><a href="#method.connect_proxy">connect_proxy</a><a href="#method.get_mempool">get_mempool</a><a href="#method.get_network">get_network</a><a href="#method.get_version">get_version</a><a href="#method.is_connected">is_connected</a><a href="#method.recv">recv</a><a href="#method.send">send</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>compact_filters</a></p><script>window.sidebarCurrent = {name: 'Peer', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#94-105' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>compact_filters</a>::<wbr><a class="struct" href=''>Peer</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Peer { /* fields omitted */ }</pre></div><div class='docblock'><p>A Bitcoin peer</p>
+</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Peer.html" title="struct bdk::blockchain::compact_filters::Peer">Peer</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#107-387' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.connect' class="method"><code id='connect.v'>pub fn <a href='#method.connect' class='fnname'>connect</a><A: <a class="trait" href="https://doc.rust-lang.org/nightly/std/net/addr/trait.ToSocketAddrs.html" title="trait std::net::addr::ToSocketAddrs">ToSocketAddrs</a>>(<br> address: A, <br> mempool: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Mempool.html" title="struct bdk::blockchain::compact_filters::Mempool">Mempool</a>>, <br> network: Network<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#112-120' title='goto source code'>[src]</a></h4><div class='docblock'><p>Connect to a peer over a plaintext TCP connection</p>
+<p>This function internally spawns a new thread that will monitor incoming messages from the
+peer, and optionally reply to some of them transparently, like <a href="NetworkMessage::Ping">pings</a></p>
+</div><h4 id='method.connect_proxy' class="method"><code id='connect_proxy.v'>pub fn <a href='#method.connect_proxy' class='fnname'>connect_proxy</a><T: <a class="trait" href="https://docs.rs/socks/0.3.0/socks/trait.ToTargetAddr.html" title="trait socks::ToTargetAddr">ToTargetAddr</a>, P: <a class="trait" href="https://doc.rust-lang.org/nightly/std/net/addr/trait.ToSocketAddrs.html" title="trait std::net::addr::ToSocketAddrs">ToSocketAddrs</a>>(<br> target: T, <br> proxy: P, <br> credentials: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <br> mempool: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Mempool.html" title="struct bdk::blockchain::compact_filters::Mempool">Mempool</a>>, <br> network: Network<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#127-141' title='goto source code'>[src]</a></h4><div class='docblock'><p>Connect to a peer through a SOCKS5 proxy, optionally by using some credentials, specified
+as a tuple of <code>(username, password)</code></p>
+<p>This function internally spawns a new thread that will monitor incoming messages from the
+peer, and optionally reply to some of them transparently, like <a href="NetworkMessage::Ping">pings</a></p>
+</div><h4 id='method.get_version' class="method"><code id='get_version.v'>pub fn <a href='#method.get_version' class='fnname'>get_version</a>(&self) -> &VersionMessage</code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#269-271' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the [<code>VersionMessage</code>] sent by the peer</p>
+</div><h4 id='method.get_network' class="method"><code id='get_network.v'>pub fn <a href='#method.get_network' class='fnname'>get_network</a>(&self) -> Network</code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#274-276' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the Bitcoin [<code>Network</code>] in use</p>
+</div><h4 id='method.get_mempool' class="method"><code id='get_mempool.v'>pub fn <a href='#method.get_mempool' class='fnname'>get_mempool</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Mempool.html" title="struct bdk::blockchain::compact_filters::Mempool">Mempool</a>></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#279-281' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the mempool used by this peer</p>
+</div><h4 id='method.is_connected' class="method"><code id='is_connected.v'>pub fn <a href='#method.is_connected' class='fnname'>is_connected</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#284-286' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return whether or not the peer is still connected</p>
+</div><h4 id='method.send' class="method"><code id='send.v'>pub fn <a href='#method.send' class='fnname'>send</a>(&self, payload: NetworkMessage) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#374-377' title='goto source code'>[src]</a></h4><div class='docblock'><p>Send a raw Bitcoin message to the peer</p>
+</div><h4 id='method.recv' class="method"><code id='recv.v'>pub fn <a href='#method.recv' class='fnname'>recv</a>(<br> &self, <br> wait_for: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> timeout: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><NetworkMessage>, <a class="enum" href="../../../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#380-386' title='goto source code'>[src]</a></h4><div class='docblock'><p>Waits for a specific incoming Bitcoin message, optionally with a timeout</p>
+</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Peer.html" title="struct bdk::blockchain::compact_filters::Peer">Peer</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#93' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/blockchain/compact_filters/peer.rs.html#93' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Peer.html" title="struct bdk::blockchain::compact_filters::Peer">Peer</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Peer.html" title="struct bdk::blockchain::compact_filters::Peer">Peer</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Peer.html" title="struct bdk::blockchain::compact_filters::Peer">Peer</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Peer.html" title="struct bdk::blockchain::compact_filters::Peer">Peer</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.Peer.html" title="struct bdk::blockchain::compact_filters::Peer">Peer</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `electrum` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, electrum"><title>bdk::blockchain::electrum - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module electrum</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'electrum', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/blockchain/electrum.rs.html#25-175' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a class="mod" href=''>electrum</a></span></h1><div class='docblock'><p>Electrum</p>
+<p>This module defines a [<code>Blockchain</code>] struct that wraps an [<code>electrum_client::Client</code>]
+and implements the logic required to populate the wallet's <a href="crate::database::Database">database</a> by
+querying the inner client.</p>
+<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> <span class="ident">client</span> <span class="op">=</span> <span class="ident">electrum_client</span>::<span class="ident">Client</span>::<span class="ident">new</span>(<span class="string">"ssl://electrum.blockstream.info:50002"</span>, <span class="prelude-val">None</span>)<span class="question-mark">?</span>;
+<span class="kw">let</span> <span class="ident">blockchain</span> <span class="op">=</span> <span class="ident">ElectrumBlockchain</span>::<span class="ident">from</span>(<span class="ident">client</span>);</pre></div>
+</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
+<table><tr class='module-item'><td><a class="struct" href="struct.ElectrumBlockchain.html" title='bdk::blockchain::electrum::ElectrumBlockchain struct'>ElectrumBlockchain</a></td><td class='docblock-short'><p>Wrapper over an Electrum Client that implements the required blockchain traits</p>
+</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"struct":[["ElectrumBlockchain","Wrapper over an Electrum Client that implements the required blockchain traits"]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ElectrumBlockchain` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, ElectrumBlockchain"><title>bdk::blockchain::electrum::ElectrumBlockchain - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct ElectrumBlockchain</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Blockchain">Blockchain</a><a href="#impl-From%3CClient%3E">From<Client></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-BlockchainMarker">BlockchainMarker</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>electrum</a></p><script>window.sidebarCurrent = {name: 'ElectrumBlockchain', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/blockchain/electrum.rs.html#59' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>electrum</a>::<wbr><a class="struct" href=''>ElectrumBlockchain</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct ElectrumBlockchain(_);</pre></div><div class='docblock'><p>Wrapper over an Electrum Client that implements the required blockchain traits</p>
+<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
+<p>See the <a href="crate::blockchain::electrum"><code>blockchain::electrum</code></a> module for a usage example.</p>
+</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Blockchain' class='impl'><code class='in-band'>impl <a class="trait" href="../../../bdk/blockchain/trait.Blockchain.html" title="trait bdk::blockchain::Blockchain">Blockchain</a> for <a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-Blockchain' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/electrum.rs.html#74-117' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_capabilities' class="method hidden"><code id='get_capabilities.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.get_capabilities' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a>></code><a class='srclink' href='../../../src/bdk/blockchain/electrum.rs.html#75-83' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the set of [<code>Capability</code>] supported by this backend</p>
+</div><h4 id='method.setup' class="method hidden"><code id='setup.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.setup' class='fnname'>setup</a><D: <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>, P: <a class="trait" href="../../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/electrum.rs.html#85-93' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Setup the backend and populate the internal database for the first time <a href="../../../bdk/blockchain/trait.Blockchain.html#tymethod.setup">Read more</a></p>
+</div><h4 id='method.get_tx' class="method hidden"><code id='get_tx.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.get_tx' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/electrum.rs.html#95-97' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Fetch a transaction from the blockchain given its txid</p>
+</div><h4 id='method.broadcast' class="method hidden"><code id='broadcast.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.broadcast' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/electrum.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Broadcast a transaction</p>
+</div><h4 id='method.get_height' class="method hidden"><code id='get_height.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.get_height' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/electrum.rs.html#103-110' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the current height</p>
+</div><h4 id='method.estimate_fee' class="method hidden"><code id='estimate_fee.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.estimate_fee' class='fnname'>estimate_fee</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/electrum.rs.html#112-116' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Estimate the fee rate required to confirm a transaction in a given <code>target</code> of blocks</p>
+</div><h4 id='method.sync' class="method hidden"><code id='sync.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#method.sync' class='fnname'>sync</a><D: <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/mod.rs.html#135-142' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Populate the internal database with transactions and UTXOs <a href="../../../bdk/blockchain/trait.Blockchain.html#method.sync">Read more</a></p>
+</div></div><h3 id='impl-From%3CClient%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Client> for <a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-From%3CClient%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/electrum.rs.html#68-72' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(client: Client) -> Self</code><a class='srclink' href='../../../src/bdk/blockchain/electrum.rs.html#69-71' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-BlockchainMarker' class='impl'><code class='in-band'>impl<T> <a class="trait" href="../../../bdk/blockchain/trait.BlockchainMarker.html" title="trait bdk::blockchain::BlockchainMarker">BlockchainMarker</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="../../../bdk/blockchain/trait.Blockchain.html" title="trait bdk::blockchain::Blockchain">Blockchain</a>, </span></code><a href='#impl-BlockchainMarker' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/mod.rs.html#88' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Capability` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Capability"><title>bdk::blockchain::Capability - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Capability</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.AccurateFees">AccurateFees</a><a href="#variant.FullHistory">FullHistory</a><a href="#variant.GetAnyTx">GetAnyTx</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Eq">Eq</a><a href="#impl-Hash">Hash</a><a href="#impl-PartialEq%3CCapability%3E">PartialEq<Capability></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'Capability', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#65-72' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="enum" href=''>Capability</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Capability {
+ FullHistory,
+ GetAnyTx,
+ AccurateFees,
+}</pre></div><div class='docblock'><p>Capabilities that can be supported by a [<code>Blockchain</code>] backend</p>
+</div><h2 id='variants' class='variants small-section-header'>
+ Variants<a href='#variants' class='anchor'></a></h2>
+<div id="variant.FullHistory" class="variant small-section-header"><a href="#variant.FullHistory" class="anchor field"></a><code id='FullHistory.v'>FullHistory</code></div><div class='docblock'><p>Can recover the full history of a wallet and not only the set of currently spendable UTXOs</p>
+</div><div id="variant.GetAnyTx" class="variant small-section-header"><a href="#variant.GetAnyTx" class="anchor field"></a><code id='GetAnyTx.v'>GetAnyTx</code></div><div class='docblock'><p>Can fetch any historical transaction given its txid</p>
+</div><div id="variant.AccurateFees" class="variant small-section-header"><a href="#variant.AccurateFees" class="anchor field"></a><code id='AccurateFees.v'>AccurateFees</code></div><div class='docblock'><p>Can compute accurate fees for the transactions found during sync</p>
+</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#64' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a></code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#64' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#64' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#64' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#64' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#64' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#64' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code id='hash.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H)</code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#64' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
+</div><h4 id='method.hash_slice' class="method hidden"><code id='hash_slice.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#192-199' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
+</div></div><h3 id='impl-PartialEq%3CCapability%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a>> for <a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a></code><a href='#impl-PartialEq%3CCapability%3E' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#64' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#64' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
+</div><h4 id='method.ne' class="method hidden"><code id='ne.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#216-218' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
+</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#64' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#64' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `EsploraError` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, EsploraError"><title>bdk::blockchain::esplora::EsploraError - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum EsploraError</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.BitcoinEncoding">BitcoinEncoding</a><a href="#variant.Parsing">Parsing</a><a href="#variant.Reqwest">Reqwest</a><a href="#variant.TransactionNotFound">TransactionNotFound</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Error">Error</a><a href="#impl-From%3CError%3E">From<Error></a><a href="#impl-From%3CEsploraError%3E">From<EsploraError></a><a href="#impl-From%3CParseIntError%3E">From<ParseIntError></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>esplora</a></p><script>window.sidebarCurrent = {name: 'EsploraError', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#345-355' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>esplora</a>::<wbr><a class="enum" href=''>EsploraError</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum EsploraError {
+ Reqwest(<a class="struct" href="https://docs.rs/reqwest/0.10.8/reqwest/error/struct.Error.html" title="struct reqwest::error::Error">Error</a>),
+ Parsing(<a class="struct" href="https://doc.rust-lang.org/nightly/core/num/struct.ParseIntError.html" title="struct core::num::ParseIntError">ParseIntError</a>),
+ BitcoinEncoding(Error),
+ TransactionNotFound(Txid),
+}</pre></div><div class='docblock'><p>Errors that can happen during a sync with [<code>EsploraBlockchain</code>]</p>
+</div><h2 id='variants' class='variants small-section-header'>
+ Variants<a href='#variants' class='anchor'></a></h2>
+<div id="variant.Reqwest" class="variant small-section-header"><a href="#variant.Reqwest" class="anchor field"></a><code id='Reqwest.v'>Reqwest(<a class="struct" href="https://docs.rs/reqwest/0.10.8/reqwest/error/struct.Error.html" title="struct reqwest::error::Error">Error</a>)</code></div><div class='docblock'><p>Error with the HTTP call</p>
+</div><div id="variant.Parsing" class="variant small-section-header"><a href="#variant.Parsing" class="anchor field"></a><code id='Parsing.v'>Parsing(<a class="struct" href="https://doc.rust-lang.org/nightly/core/num/struct.ParseIntError.html" title="struct core::num::ParseIntError">ParseIntError</a>)</code></div><div class='docblock'><p>Invalid number returned</p>
+</div><div id="variant.BitcoinEncoding" class="variant small-section-header"><a href="#variant.BitcoinEncoding" class="anchor field"></a><code id='BitcoinEncoding.v'>BitcoinEncoding(Error)</code></div><div class='docblock'><p>Invalid Bitcoin data returned</p>
+</div><div id="variant.TransactionNotFound" class="variant small-section-header"><a href="#variant.TransactionNotFound" class="anchor field"></a><code id='TransactionNotFound.v'>TransactionNotFound(Txid)</code></div><div class='docblock'><p>Transaction not found</p>
+</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#344' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#344' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../../../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#357-361' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#358-360' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Error' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="enum" href="../../../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-Error' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#363' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.source' class="method hidden"><code id='source.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source' class='fnname'>source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><span class='since' title='Stable since Rust version 1.30.0'>1.30.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#100-102' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
+</div><h4 id='method.backtrace' class="method hidden"><code id='backtrace.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace' class='fnname'>backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#128-130' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>backtrace</code>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
+</div><h4 id='method.description' class="method hidden"><code id='description.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description' class='fnname'>description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#140-142' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
+</div></div><div class='docblock hidden'><p><code>if let Err(e) = "xc".parse::<u32>() { // Print </code>e<code> itself, no need for description(). eprintln!("Error: {}", e); }</code> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></p>
+</div><h4 id='method.cause' class="method hidden"><code id='cause.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#150-152' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
+</div></div></div><h3 id='impl-From%3CError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://docs.rs/reqwest/0.10.8/reqwest/error/struct.Error.html" title="struct reqwest::error::Error">Error</a>> for <a class="enum" href="../../../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-From%3CError%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#365-369' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(other: <a class="struct" href="https://docs.rs/reqwest/0.10.8/reqwest/error/struct.Error.html" title="struct reqwest::error::Error">Error</a>) -> Self</code><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#366-368' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-1' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../../../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-From%3CError%3E-1' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#377-381' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-3' class="method hidden"><code id='from.v-3'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(other: Error) -> Self</code><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#378-380' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CEsploraError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a>> for <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CEsploraError%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../../../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a>) -> Self</code><a class='srclink' href='../../../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CParseIntError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/num/struct.ParseIntError.html" title="struct core::num::ParseIntError">ParseIntError</a>> for <a class="enum" href="../../../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-From%3CParseIntError%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#371-375' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code id='from.v-2'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(other: <a class="struct" href="https://doc.rust-lang.org/nightly/core/num/struct.ParseIntError.html" title="struct core::num::ParseIntError">ParseIntError</a>) -> Self</code><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#372-374' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-4' class="method hidden"><code id='from.v-4'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2219-2229' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2221-2228' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `esplora` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, esplora"><title>bdk::blockchain::esplora - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module esplora</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'esplora', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#25-381' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a class="mod" href=''>esplora</a></span></h1><div class='docblock'><p>Esplora</p>
+<p>This module defines a [<code>Blockchain</code>] struct that can query an Esplora backend
+populate the wallet's <a href="crate::database::Database">database</a> by</p>
+<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> <span class="ident">blockchain</span> <span class="op">=</span> <span class="ident">EsploraBlockchain</span>::<span class="ident">new</span>(<span class="string">"https://blockstream.info/testnet/api"</span>);</pre></div>
+</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
+<table><tr class='module-item'><td><a class="struct" href="struct.EsploraBlockchain.html" title='bdk::blockchain::esplora::EsploraBlockchain struct'>EsploraBlockchain</a></td><td class='docblock-short'><p>Structure that implements the logic to sync with Esplora</p>
+</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
+<table><tr class='module-item'><td><a class="enum" href="enum.EsploraError.html" title='bdk::blockchain::esplora::EsploraError enum'>EsploraError</a></td><td class='docblock-short'><p>Errors that can happen during a sync with [<code>EsploraBlockchain</code>]</p>
+</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"enum":[["EsploraError","Errors that can happen during a sync with [`EsploraBlockchain`]"]],"struct":[["EsploraBlockchain","Structure that implements the logic to sync with Esplora"]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `EsploraBlockchain` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, EsploraBlockchain"><title>bdk::blockchain::esplora::EsploraBlockchain - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct EsploraBlockchain</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Blockchain">Blockchain</a><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-BlockchainMarker">BlockchainMarker</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>esplora</a></p><script>window.sidebarCurrent = {name: 'EsploraBlockchain', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#74' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>esplora</a>::<wbr><a class="struct" href=''>EsploraBlockchain</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct EsploraBlockchain(_);</pre></div><div class='docblock'><p>Structure that implements the logic to sync with Esplora</p>
+<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
+<p>See the <a href="crate::blockchain::esplora"><code>blockchain::esplora</code></a> module for a usage example.</p>
+</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#82-90' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>(base_url: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> Self</code><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#84-89' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new instance of the client from a base URL</p>
+</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Blockchain' class='impl'><code class='in-band'>impl <a class="trait" href="../../../bdk/blockchain/trait.Blockchain.html" title="trait bdk::blockchain::Blockchain">Blockchain</a> for <a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-Blockchain' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#93-143' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_capabilities' class="method hidden"><code id='get_capabilities.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.get_capabilities' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a>></code><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#94-102' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the set of [<code>Capability</code>] supported by this backend</p>
+</div><h4 id='method.setup' class="method hidden"><code id='setup.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.setup' class='fnname'>setup</a><D: <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>, P: <a class="trait" href="../../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#104-113' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Setup the backend and populate the internal database for the first time <a href="../../../bdk/blockchain/trait.Blockchain.html#tymethod.setup">Read more</a></p>
+</div><h4 id='method.get_tx' class="method hidden"><code id='get_tx.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.get_tx' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#115-117' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Fetch a transaction from the blockchain given its txid</p>
+</div><h4 id='method.broadcast' class="method hidden"><code id='broadcast.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.broadcast' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#119-121' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Broadcast a transaction</p>
+</div><h4 id='method.get_height' class="method hidden"><code id='get_height.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.get_height' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#123-125' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the current height</p>
+</div><h4 id='method.estimate_fee' class="method hidden"><code id='estimate_fee.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#tymethod.estimate_fee' class='fnname'>estimate_fee</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#127-142' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Estimate the fee rate required to confirm a transaction in a given <code>target</code> of blocks</p>
+</div><h4 id='method.sync' class="method hidden"><code id='sync.v'>fn <a href='../../../bdk/blockchain/trait.Blockchain.html#method.sync' class='fnname'>sync</a><D: <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/blockchain/mod.rs.html#135-142' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Populate the internal database with transactions and UTXOs <a href="../../../bdk/blockchain/trait.Blockchain.html#method.sync">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#73' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/blockchain/esplora.rs.html#73' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-BlockchainMarker' class='impl'><code class='in-band'>impl<T> <a class="trait" href="../../../bdk/blockchain/trait.BlockchainMarker.html" title="trait bdk::blockchain::BlockchainMarker">BlockchainMarker</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="../../../bdk/blockchain/trait.Blockchain.html" title="trait bdk::blockchain::Blockchain">Blockchain</a>, </span></code><a href='#impl-BlockchainMarker' class='anchor'></a><a class='srclink' href='../../../src/bdk/blockchain/mod.rs.html#88' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `log_progress` fn in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, log_progress"><title>bdk::blockchain::log_progress - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'log_progress', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#204-206' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="fn" href=''>log_progress</a></span></h1><pre class='rust fn'>pub fn log_progress() -> <a class="struct" href="../../bdk/blockchain/struct.LogProgress.html" title="struct bdk::blockchain::LogProgress">LogProgress</a></pre><div class='docblock'><p>Create a nwe instance of [<code>LogProgress</code>]</p>
+</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `noop_progress` fn in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, noop_progress"><title>bdk::blockchain::noop_progress - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'noop_progress', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#189-191' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="fn" href=''>noop_progress</a></span></h1><pre class='rust fn'>pub fn noop_progress() -> <a class="struct" href="../../bdk/blockchain/struct.NoopProgress.html" title="struct bdk::blockchain::NoopProgress">NoopProgress</a></pre><div class='docblock'><p>Create a new instance of [<code>NoopProgress</code>]</p>
+</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `progress` fn in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, progress"><title>bdk::blockchain::progress - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'progress', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#169-171' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="fn" href=''>progress</a></span></h1><pre class='rust fn'>pub fn progress() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Sender.html" title="struct std::sync::mpsc::Sender">Sender</a><<a class="type" href="../../bdk/blockchain/type.ProgressData.html" title="type bdk::blockchain::ProgressData">ProgressData</a>>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Receiver.html" title="struct std::sync::mpsc::Receiver">Receiver</a><<a class="type" href="../../bdk/blockchain/type.ProgressData.html" title="type bdk::blockchain::ProgressData">ProgressData</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></pre><div class='docblock'><p>Shortcut to create a [<code>channel</code>] (pair of [<code>Sender</code>] and [<code>Receiver</code>]) that can transport [<code>ProgressData</code>]</p>
+</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `blockchain` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, blockchain"><title>bdk::blockchain - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module blockchain</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'><a href='../index.html'>bdk</a></p><script>window.sidebarCurrent = {name: 'blockchain', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#25-253' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>bdk</a>::<wbr><a class="mod" href=''>blockchain</a></span></h1><div class='docblock'><p>Blockchain backends</p>
+<p>This module provides the implementation of a few commonly-used backends like
+<a href="crate::blockchain::electrum">Electrum</a>, <a href="crate::blockchain::esplora">Esplora</a> and
+<a href="crate::blockchain::compact_filters">Compact Filters/Neutrino</a>, along with a generalized trait
+[<code>Blockchain</code>] that can be implemented to build customized backends.</p>
+</div><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
+<table><tr><td><code>pub use self::electrum::<a class="struct" href="../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a>;</code></td></tr><tr><td><code>pub use self::esplora::<a class="struct" href="../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a>;</code></td></tr><tr><td><code>pub use self::compact_filters::<a class="struct" href="../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a>;</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
+<table><tr class='module-item'><td><a class="mod" href="compact_filters/index.html" title='bdk::blockchain::compact_filters mod'>compact_filters</a></td><td class='docblock-short'><p>Compact Filters</p>
+</td></tr><tr class='module-item'><td><a class="mod" href="electrum/index.html" title='bdk::blockchain::electrum mod'>electrum</a></td><td class='docblock-short'><p>Electrum</p>
+</td></tr><tr class='module-item'><td><a class="mod" href="esplora/index.html" title='bdk::blockchain::esplora mod'>esplora</a></td><td class='docblock-short'><p>Esplora</p>
+</td></tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
+<table><tr class='module-item'><td><a class="struct" href="struct.LogProgress.html" title='bdk::blockchain::LogProgress struct'>LogProgress</a></td><td class='docblock-short'><p>Type that implements [<code>Progress</code>] and logs at level <code>INFO</code> every update received</p>
+</td></tr><tr class='module-item'><td><a class="struct" href="struct.NoopProgress.html" title='bdk::blockchain::NoopProgress struct'>NoopProgress</a></td><td class='docblock-short'><p>Type that implements [<code>Progress</code>] and drops every update received</p>
+</td></tr><tr class='module-item'><td><a class="struct" href="struct.OfflineBlockchain.html" title='bdk::blockchain::OfflineBlockchain struct'>OfflineBlockchain</a></td><td class='docblock-short'><p>Type that only implements [<code>Blockchain</code>] and is always "offline"</p>
+</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
+<table><tr class='module-item'><td><a class="enum" href="enum.Capability.html" title='bdk::blockchain::Capability enum'>Capability</a></td><td class='docblock-short'><p>Capabilities that can be supported by a [<code>Blockchain</code>] backend</p>
+</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
+<table><tr class='module-item'><td><a class="trait" href="trait.Blockchain.html" title='bdk::blockchain::Blockchain trait'>Blockchain</a></td><td class='docblock-short'><p>Trait that defines the actions that must be supported by a blockchain backend</p>
+</td></tr><tr class='module-item'><td><a class="trait" href="trait.BlockchainMarker.html" title='bdk::blockchain::BlockchainMarker trait'>BlockchainMarker</a></td><td class='docblock-short'><p>Marker trait for a blockchain backend</p>
+</td></tr><tr class='module-item'><td><a class="trait" href="trait.Progress.html" title='bdk::blockchain::Progress trait'>Progress</a></td><td class='docblock-short'><p>Trait for types that can receive and process progress updates during [<code>Blockchain::sync</code>] and
+[<code>Blockchain::setup</code>]</p>
+</td></tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
+<table><tr class='module-item'><td><a class="fn" href="fn.log_progress.html" title='bdk::blockchain::log_progress fn'>log_progress</a></td><td class='docblock-short'><p>Create a nwe instance of [<code>LogProgress</code>]</p>
+</td></tr><tr class='module-item'><td><a class="fn" href="fn.noop_progress.html" title='bdk::blockchain::noop_progress fn'>noop_progress</a></td><td class='docblock-short'><p>Create a new instance of [<code>NoopProgress</code>]</p>
+</td></tr><tr class='module-item'><td><a class="fn" href="fn.progress.html" title='bdk::blockchain::progress fn'>progress</a></td><td class='docblock-short'><p>Shortcut to create a [<code>channel</code>] (pair of [<code>Sender</code>] and [<code>Receiver</code>]) that can transport [<code>ProgressData</code>]</p>
+</td></tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
+<table><tr class='module-item'><td><a class="type" href="type.ProgressData.html" title='bdk::blockchain::ProgressData type'>ProgressData</a></td><td class='docblock-short'><p>Data sent with a progress update over a [<code>channel</code>]</p>
+</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"enum":[["Capability","Capabilities that can be supported by a [`Blockchain`] backend"]],"fn":[["log_progress","Create a nwe instance of [`LogProgress`]"],["noop_progress","Create a new instance of [`NoopProgress`]"],["progress","Shortcut to create a [`channel`] (pair of [`Sender`] and [`Receiver`]) that can transport [`ProgressData`]"]],"mod":[["compact_filters","Compact Filters"],["electrum","Electrum"],["esplora","Esplora"]],"struct":[["LogProgress","Type that implements [`Progress`] and logs at level `INFO` every update received"],["NoopProgress","Type that implements [`Progress`] and drops every update received"],["OfflineBlockchain","Type that only implements [`Blockchain`] and is always \"offline\""]],"trait":[["Blockchain","Trait that defines the actions that must be supported by a blockchain backend"],["BlockchainMarker","Marker trait for a blockchain backend"],["Progress","Trait for types that can receive and process progress updates during [`Blockchain::sync`] and [`Blockchain::setup`]"]],"type":[["ProgressData","Data sent with a progress update over a [`channel`]"]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `LogProgress` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, LogProgress"><title>bdk::blockchain::LogProgress - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct LogProgress</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Progress">Progress</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'LogProgress', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#201' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="struct" href=''>LogProgress</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct LogProgress;</pre></div><div class='docblock'><p>Type that implements [<code>Progress</code>] and logs at level <code>INFO</code> every update received</p>
+</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../bdk/blockchain/struct.LogProgress.html" title="struct bdk::blockchain::LogProgress">LogProgress</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#200' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../bdk/blockchain/struct.LogProgress.html" title="struct bdk::blockchain::LogProgress">LogProgress</a></code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#200' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Progress' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a> for <a class="struct" href="../../bdk/blockchain/struct.LogProgress.html" title="struct bdk::blockchain::LogProgress">LogProgress</a></code><a href='#impl-Progress' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#208-214' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.update' class="method hidden"><code id='update.v'>fn <a href='../../bdk/blockchain/trait.Progress.html#tymethod.update' class='fnname'>update</a>(&self, progress: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, message: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#209-213' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Send a new progress update <a href="../../bdk/blockchain/trait.Progress.html#tymethod.update">Read more</a></p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../bdk/blockchain/struct.LogProgress.html" title="struct bdk::blockchain::LogProgress">LogProgress</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../bdk/blockchain/struct.LogProgress.html" title="struct bdk::blockchain::LogProgress">LogProgress</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../bdk/blockchain/struct.LogProgress.html" title="struct bdk::blockchain::LogProgress">LogProgress</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../bdk/blockchain/struct.LogProgress.html" title="struct bdk::blockchain::LogProgress">LogProgress</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../bdk/blockchain/struct.LogProgress.html" title="struct bdk::blockchain::LogProgress">LogProgress</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `NoopProgress` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, NoopProgress"><title>bdk::blockchain::NoopProgress - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct NoopProgress</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Progress">Progress</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'NoopProgress', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#186' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="struct" href=''>NoopProgress</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct NoopProgress;</pre></div><div class='docblock'><p>Type that implements [<code>Progress</code>] and drops every update received</p>
+</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../bdk/blockchain/struct.NoopProgress.html" title="struct bdk::blockchain::NoopProgress">NoopProgress</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#185' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../bdk/blockchain/struct.NoopProgress.html" title="struct bdk::blockchain::NoopProgress">NoopProgress</a></code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#185' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Progress' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a> for <a class="struct" href="../../bdk/blockchain/struct.NoopProgress.html" title="struct bdk::blockchain::NoopProgress">NoopProgress</a></code><a href='#impl-Progress' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#193-197' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.update' class="method hidden"><code id='update.v'>fn <a href='../../bdk/blockchain/trait.Progress.html#tymethod.update' class='fnname'>update</a>(&self, _progress: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, _message: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#194-196' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Send a new progress update <a href="../../bdk/blockchain/trait.Progress.html#tymethod.update">Read more</a></p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../bdk/blockchain/struct.NoopProgress.html" title="struct bdk::blockchain::NoopProgress">NoopProgress</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../bdk/blockchain/struct.NoopProgress.html" title="struct bdk::blockchain::NoopProgress">NoopProgress</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../bdk/blockchain/struct.NoopProgress.html" title="struct bdk::blockchain::NoopProgress">NoopProgress</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../bdk/blockchain/struct.NoopProgress.html" title="struct bdk::blockchain::NoopProgress">NoopProgress</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../bdk/blockchain/struct.NoopProgress.html" title="struct bdk::blockchain::NoopProgress">NoopProgress</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `OfflineBlockchain` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, OfflineBlockchain"><title>bdk::blockchain::OfflineBlockchain - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct OfflineBlockchain</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-BlockchainMarker">BlockchainMarker</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-BlockchainMarker">BlockchainMarker</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'OfflineBlockchain', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#91' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="struct" href=''>OfflineBlockchain</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct OfflineBlockchain;</pre></div><div class='docblock'><p>Type that only implements [<code>Blockchain</code>] and is always "offline"</p>
+</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-BlockchainMarker' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/blockchain/trait.BlockchainMarker.html" title="trait bdk::blockchain::BlockchainMarker">BlockchainMarker</a> for <a class="struct" href="../../bdk/blockchain/struct.OfflineBlockchain.html" title="struct bdk::blockchain::OfflineBlockchain">OfflineBlockchain</a></code><a href='#impl-BlockchainMarker' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#92' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../bdk/blockchain/struct.OfflineBlockchain.html" title="struct bdk::blockchain::OfflineBlockchain">OfflineBlockchain</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../bdk/blockchain/struct.OfflineBlockchain.html" title="struct bdk::blockchain::OfflineBlockchain">OfflineBlockchain</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../bdk/blockchain/struct.OfflineBlockchain.html" title="struct bdk::blockchain::OfflineBlockchain">OfflineBlockchain</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../bdk/blockchain/struct.OfflineBlockchain.html" title="struct bdk::blockchain::OfflineBlockchain">OfflineBlockchain</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../bdk/blockchain/struct.OfflineBlockchain.html" title="struct bdk::blockchain::OfflineBlockchain">OfflineBlockchain</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-BlockchainMarker-1' class='impl'><code class='in-band'>impl<T> <a class="trait" href="../../bdk/blockchain/trait.BlockchainMarker.html" title="trait bdk::blockchain::BlockchainMarker">BlockchainMarker</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="../../bdk/blockchain/trait.Blockchain.html" title="trait bdk::blockchain::Blockchain">Blockchain</a>, </span></code><a href='#impl-BlockchainMarker-1' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#88' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Blockchain` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Blockchain"><title>bdk::blockchain::Blockchain - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait Blockchain</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.broadcast">broadcast</a><a href="#tymethod.estimate_fee">estimate_fee</a><a href="#tymethod.get_capabilities">get_capabilities</a><a href="#tymethod.get_height">get_height</a><a href="#tymethod.get_tx">get_tx</a><a href="#tymethod.setup">setup</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.sync">sync</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-Blockchain-for-Arc%3CT%3E">Arc<T></a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'Blockchain', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#96-153' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="trait" href=''>Blockchain</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait Blockchain: <a class="trait" href="../../bdk/blockchain/trait.BlockchainMarker.html" title="trait bdk::blockchain::BlockchainMarker">BlockchainMarker</a> {
+ fn <a href='#tymethod.get_capabilities' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.setup' class='fnname'>setup</a><D: <a class="trait" href="../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.get_tx' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.broadcast' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.get_height' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.estimate_fee' class='fnname'>estimate_fee</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+
+ fn <a href='#method.sync' class='fnname'>sync</a><D: <a class="trait" href="../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>> { ... }
+}</pre></div><div class='docblock'><p>Trait that defines the actions that must be supported by a blockchain backend</p>
+</div>
+ <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.get_capabilities' class='method'><code id='get_capabilities.v'>fn <a href='#tymethod.get_capabilities' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a>></code></h3><div class='docblock'><p>Return the set of [<code>Capability</code>] supported by this backend</p>
+</div><h3 id='tymethod.setup' class='method'><code id='setup.v'>fn <a href='#tymethod.setup' class='fnname'>setup</a><D: <a class="trait" href="../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Setup the backend and populate the internal database for the first time</p>
+<p>This method is the equivalent of [<code>Blockchain::sync</code>], but it's guaranteed to only be
+called once, at the first <a href="crate::wallet::Wallet::sync"><code>Wallet::sync</code></a>.</p>
+<p>The rationale behind the distinction between <code>sync</code> and <code>setup</code> is that some custom backends
+might need to perform specific actions only the first time they are synced.</p>
+<p>For types that do not have that distinction, only this method can be implemented, since
+[<code>Blockchain::sync</code>] defaults to calling this internally if not overridden.</p>
+</div><h3 id='tymethod.get_tx' class='method'><code id='get_tx.v'>fn <a href='#tymethod.get_tx' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Fetch a transaction from the blockchain given its txid</p>
+</div><h3 id='tymethod.broadcast' class='method'><code id='broadcast.v'>fn <a href='#tymethod.broadcast' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Broadcast a transaction</p>
+</div><h3 id='tymethod.get_height' class='method'><code id='get_height.v'>fn <a href='#tymethod.get_height' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Return the current height</p>
+</div><h3 id='tymethod.estimate_fee' class='method'><code id='estimate_fee.v'>fn <a href='#tymethod.estimate_fee' class='fnname'>estimate_fee</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Estimate the fee rate required to confirm a transaction in a given <code>target</code> of blocks</p>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='provided-methods' class='small-section-header'>Provided methods<a href='#provided-methods' class='anchor'></a></h2><div class='methods'><h3 id='method.sync' class='method'><code id='sync.v'>fn <a href='#method.sync' class='fnname'>sync</a><D: <a class="trait" href="../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Populate the internal database with transactions and UTXOs</p>
+<p>If not overridden, it defaults to calling [<code>Blockchain::setup</code>] internally.</p>
+<p>This method should implement the logic required to iterate over the list of the wallet's
+script_pubkeys using <a href="crate::database::Database::iter_script_pubkeys"><code>Database::iter_script_pubkeys</code></a> and look for relevant transactions
+in the blockchain to populate the database with <a href="crate::database::BatchOperations::set_tx"><code>BatchOperations::set_tx</code></a> and
+<a href="crate::database::BatchOperations::set_utxo"><code>BatchOperations::set_utxo</code></a>.</p>
+<p>This method should also take care of removing UTXOs that are seen as spent in the
+blockchain, using <a href="crate::database::BatchOperations::del_utxo"><code>BatchOperations::del_utxo</code></a>.</p>
+<p>The <code>progress_update</code> object can be used to give the caller updates about the progress by using
+[<code>Progress::update</code>].</p>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-Blockchain-for-Arc%3CT%3E' class='impl'><code class='in-band'>impl<T: <a class="trait" href="../../bdk/blockchain/trait.Blockchain.html" title="trait bdk::blockchain::Blockchain">Blockchain</a>> <a class="trait" href="../../bdk/blockchain/trait.Blockchain.html" title="trait bdk::blockchain::Blockchain">Blockchain</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><T></code><a href='#impl-Blockchain-for-Arc%3CT%3E' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#217-253' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_capabilities' class="method hidden"><code id='get_capabilities.v-1'>fn <a href='#method.get_capabilities' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a>></code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#218-220' title='goto source code'>[src]</a></h4><h4 id='method.setup' class="method hidden"><code id='setup.v-1'>fn <a href='#method.setup' class='fnname'>setup</a><D: <a class="trait" href="../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#222-229' title='goto source code'>[src]</a></h4><h4 id='method.sync-1' class="method hidden"><code id='sync.v-1'>fn <a href='#method.sync' class='fnname'>sync</a><D: <a class="trait" href="../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#231-238' title='goto source code'>[src]</a></h4><h4 id='method.get_tx' class="method hidden"><code id='get_tx.v-1'>fn <a href='#method.get_tx' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#240-242' title='goto source code'>[src]</a></h4><h4 id='method.broadcast' class="method hidden"><code id='broadcast.v-1'>fn <a href='#method.broadcast' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#243-245' title='goto source code'>[src]</a></h4><h4 id='method.get_height' class="method hidden"><code id='get_height.v-1'>fn <a href='#method.get_height' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#247-249' title='goto source code'>[src]</a></h4><h4 id='method.estimate_fee' class="method hidden"><code id='estimate_fee.v-1'>fn <a href='#method.estimate_fee' class='fnname'>estimate_fee</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#250-252' title='goto source code'>[src]</a></h4></div><span class='loading-content'>Loading content...</span>
+ <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-Blockchain' class='impl'><code class='in-band'>impl Blockchain for <a class="struct" href="../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-Blockchain' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/compact_filters/mod.rs.html#233-461' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_capabilities-1' class="method hidden"><code id='get_capabilities.v-2'>fn <a href='#method.get_capabilities-1' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a>></code><a class='srclink' href='../../src/bdk/blockchain/compact_filters/mod.rs.html#234-236' title='goto source code'>[src]</a></h4><h4 id='method.setup-1' class="method hidden"><code id='setup.v-2'>fn <a href='#method.setup-1' class='fnname'>setup</a><D: <a class="trait" href="../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a>>(<br> &self, <br> _stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/compact_filters/mod.rs.html#238-439' title='goto source code'>[src]</a></h4><h4 id='method.get_tx-1' class="method hidden"><code id='get_tx.v-2'>fn <a href='#method.get_tx-1' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/compact_filters/mod.rs.html#441-445' title='goto source code'>[src]</a></h4><h4 id='method.broadcast-1' class="method hidden"><code id='broadcast.v-2'>fn <a href='#method.broadcast-1' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/compact_filters/mod.rs.html#447-451' title='goto source code'>[src]</a></h4><h4 id='method.get_height-1' class="method hidden"><code id='get_height.v-2'>fn <a href='#method.get_height-1' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/compact_filters/mod.rs.html#453-455' title='goto source code'>[src]</a></h4><h4 id='method.estimate_fee-1' class="method hidden"><code id='estimate_fee.v-2'>fn <a href='#method.estimate_fee-1' class='fnname'>estimate_fee</a>(&self, _target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/compact_filters/mod.rs.html#457-460' title='goto source code'>[src]</a></h4></div><h3 id='impl-Blockchain-1' class='impl'><code class='in-band'>impl Blockchain for <a class="struct" href="../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-Blockchain-1' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/electrum.rs.html#74-117' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_capabilities-2' class="method hidden"><code id='get_capabilities.v-3'>fn <a href='#method.get_capabilities-2' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a>></code><a class='srclink' href='../../src/bdk/blockchain/electrum.rs.html#75-83' title='goto source code'>[src]</a></h4><h4 id='method.setup-2' class="method hidden"><code id='setup.v-3'>fn <a href='#method.setup-2' class='fnname'>setup</a><D: <a class="trait" href="../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>, P: <a class="trait" href="../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/electrum.rs.html#85-93' title='goto source code'>[src]</a></h4><h4 id='method.get_tx-2' class="method hidden"><code id='get_tx.v-3'>fn <a href='#method.get_tx-2' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/electrum.rs.html#95-97' title='goto source code'>[src]</a></h4><h4 id='method.broadcast-2' class="method hidden"><code id='broadcast.v-3'>fn <a href='#method.broadcast-2' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/electrum.rs.html#99-101' title='goto source code'>[src]</a></h4><h4 id='method.get_height-2' class="method hidden"><code id='get_height.v-3'>fn <a href='#method.get_height-2' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/electrum.rs.html#103-110' title='goto source code'>[src]</a></h4><h4 id='method.estimate_fee-2' class="method hidden"><code id='estimate_fee.v-3'>fn <a href='#method.estimate_fee-2' class='fnname'>estimate_fee</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/electrum.rs.html#112-116' title='goto source code'>[src]</a></h4></div><h3 id='impl-Blockchain-2' class='impl'><code class='in-band'>impl Blockchain for <a class="struct" href="../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-Blockchain-2' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/esplora.rs.html#93-143' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_capabilities-3' class="method hidden"><code id='get_capabilities.v-4'>fn <a href='#method.get_capabilities-3' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a>></code><a class='srclink' href='../../src/bdk/blockchain/esplora.rs.html#94-102' title='goto source code'>[src]</a></h4><h4 id='method.setup-3' class="method hidden"><code id='setup.v-4'>fn <a href='#method.setup-3' class='fnname'>setup</a><D: <a class="trait" href="../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>, P: <a class="trait" href="../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/esplora.rs.html#104-113' title='goto source code'>[src]</a></h4><h4 id='method.get_tx-3' class="method hidden"><code id='get_tx.v-4'>fn <a href='#method.get_tx-3' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/esplora.rs.html#115-117' title='goto source code'>[src]</a></h4><h4 id='method.broadcast-3' class="method hidden"><code id='broadcast.v-4'>fn <a href='#method.broadcast-3' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/esplora.rs.html#119-121' title='goto source code'>[src]</a></h4><h4 id='method.get_height-3' class="method hidden"><code id='get_height.v-4'>fn <a href='#method.get_height-3' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/esplora.rs.html#123-125' title='goto source code'>[src]</a></h4><h4 id='method.estimate_fee-3' class="method hidden"><code id='estimate_fee.v-4'>fn <a href='#method.estimate_fee-3' class='fnname'>estimate_fee</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/esplora.rs.html#127-142' title='goto source code'>[src]</a></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/bdk/blockchain/trait.Blockchain.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BlockchainMarker` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, BlockchainMarker"><title>bdk::blockchain::BlockchainMarker - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait BlockchainMarker</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'BlockchainMarker', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#85' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="trait" href=''>BlockchainMarker</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait BlockchainMarker { }</pre></div><div class='docblock'><p>Marker trait for a blockchain backend</p>
+<p>This is a marker trait for blockchain types. It is automatically implemented for types that
+implement [<code>Blockchain</code>], so as a user of the library you won't have to implement this
+manually.</p>
+<p>Users of the library will probably never have to implement this trait manually, but they
+could still need to import it to define types and structs with generics;
+Implementing only the marker trait is pointless, since [<code>OfflineBlockchain</code>]
+already does that, and whenever [<code>Blockchain</code>] is implemented, the marker trait is also
+automatically implemented by the library.</p>
+</div>
+ <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-BlockchainMarker' class='impl'><code class='in-band'>impl BlockchainMarker for <a class="struct" href="../../bdk/blockchain/struct.OfflineBlockchain.html" title="struct bdk::blockchain::OfflineBlockchain">OfflineBlockchain</a></code><a href='#impl-BlockchainMarker' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#92' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-BlockchainMarker-1' class='impl'><code class='in-band'>impl<T: <a class="trait" href="../../bdk/blockchain/trait.Blockchain.html" title="trait bdk::blockchain::Blockchain">Blockchain</a>> BlockchainMarker for T</code><a href='#impl-BlockchainMarker-1' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#88' title='goto source code'>[src]</a></h3><div class='docblock'><p>The [<code>BlockchainMarker</code>] marker trait is automatically implemented for [<code>Blockchain</code>] types</p>
+</div><div class='impl-items'></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/bdk/blockchain/trait.BlockchainMarker.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Progress` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Progress"><title>bdk::blockchain::Progress - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait Progress</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.update">update</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-Progress-for-Sender%3CProgressData%3E">Sender<ProgressData></a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'Progress', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#160-166' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="trait" href=''>Progress</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait Progress: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> {
+ fn <a href='#tymethod.update' class='fnname'>update</a>(<br> &self, <br> progress: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, <br> message: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+}</pre></div><div class='docblock'><p>Trait for types that can receive and process progress updates during [<code>Blockchain::sync</code>] and
+[<code>Blockchain::setup</code>]</p>
+</div>
+ <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.update' class='method'><code id='update.v'>fn <a href='#tymethod.update' class='fnname'>update</a>(&self, progress: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, message: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Send a new progress update</p>
+<p>The <code>progress</code> value should be in the range 0.0 - 100.0, and the <code>message</code> value is an
+optional text message that can be displayed to the user.</p>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-Progress-for-Sender%3CProgressData%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Sender.html" title="struct std::sync::mpsc::Sender">Sender</a><<a class="type" href="../../bdk/blockchain/type.ProgressData.html" title="type bdk::blockchain::ProgressData">ProgressData</a>></code><a href='#impl-Progress-for-Sender%3CProgressData%3E' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#173-182' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.update' class="method hidden"><code id='update.v-1'>fn <a href='#method.update' class='fnname'>update</a>(&self, progress: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, message: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#174-181' title='goto source code'>[src]</a></h4></div><span class='loading-content'>Loading content...</span>
+ <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-Progress' class='impl'><code class='in-band'>impl Progress for <a class="struct" href="../../bdk/blockchain/struct.LogProgress.html" title="struct bdk::blockchain::LogProgress">LogProgress</a></code><a href='#impl-Progress' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#208-214' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.update-1' class="method hidden"><code id='update.v-2'>fn <a href='#method.update-1' class='fnname'>update</a>(&self, progress: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, message: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#209-213' title='goto source code'>[src]</a></h4></div><h3 id='impl-Progress-1' class='impl'><code class='in-band'>impl Progress for <a class="struct" href="../../bdk/blockchain/struct.NoopProgress.html" title="struct bdk::blockchain::NoopProgress">NoopProgress</a></code><a href='#impl-Progress-1' class='anchor'></a><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#193-197' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.update-2' class="method hidden"><code id='update.v-3'>fn <a href='#method.update-2' class='fnname'>update</a>(&self, _progress: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, _message: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#194-196' title='goto source code'>[src]</a></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/bdk/blockchain/trait.Progress.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ProgressData` type in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, ProgressData"><title>bdk::blockchain::ProgressData - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition ProgressData</p><div class="sidebar-elems"><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'ProgressData', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/blockchain/mod.rs.html#156' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="type" href=''>ProgressData</a></span></h1><pre class='rust typedef'>type ProgressData = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>;</pre><div class='docblock'><p>Data sent with a progress update over a [<code>channel</code>]</p>
+</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `database` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, database"><title>bdk::database - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module database</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#traits">Traits</a></li></ul></div><p class='location'><a href='../index.html'>bdk</a></p><script>window.sidebarCurrent = {name: 'database', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/database/mod.rs.html#25-368' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>bdk</a>::<wbr><a class="mod" href=''>database</a></span></h1><div class='docblock'><p>Database types</p>
+<p>This module provides the implementation of some defaults database types, along with traits that
+can be implemented externally to let <a href="crate::wallet::Wallet"><code>Wallet</code></a>s use customized databases.</p>
+<p>It's important to note that the databases defined here only contains "blockchain-related" data.
+They can be seen more as a cache than a critical piece of storage that contains secrets and
+keys.</p>
+<p>The currently recommended database is [<code>sled</code>], which is a pretty simple key-value embedded
+database written in Rust. If the <code>key-value-db</code> feature is enabled (which by default is),
+this library automatically implements all the required traits for [<code>sled::Tree</code>].</p>
+</div><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
+<table><tr><td><code>pub use memory::<a class="struct" href="../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a>;</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
+<table><tr class='module-item'><td><a class="mod" href="memory/index.html" title='bdk::database::memory mod'>memory</a></td><td class='docblock-short'><p>In-memory ephemeral database</p>
+</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
+<table><tr class='module-item'><td><a class="trait" href="trait.BatchDatabase.html" title='bdk::database::BatchDatabase trait'>BatchDatabase</a></td><td class='docblock-short'><p>Trait for a database that supports batch operations</p>
+</td></tr><tr class='module-item'><td><a class="trait" href="trait.BatchOperations.html" title='bdk::database::BatchOperations trait'>BatchOperations</a></td><td class='docblock-short'><p>Trait for operations that can be batched</p>
+</td></tr><tr class='module-item'><td><a class="trait" href="trait.Database.html" title='bdk::database::Database trait'>Database</a></td><td class='docblock-short'><p>Trait for reading data from a database</p>
+</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `memory` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, memory"><title>bdk::database::memory - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module memory</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>database</a></p><script>window.sidebarCurrent = {name: 'memory', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/database/memory.rs.html#25-558' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>database</a>::<wbr><a class="mod" href=''>memory</a></span></h1><div class='docblock'><p>In-memory ephemeral database</p>
+<p>This module defines an in-memory database type called [<code>MemoryDatabase</code>] that is based on a
+[<code>BTreeMap</code>].</p>
+</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
+<table><tr class='module-item'><td><a class="struct" href="struct.MemoryDatabase.html" title='bdk::database::memory::MemoryDatabase struct'>MemoryDatabase</a></td><td class='docblock-short'><p>In-memory ephemeral database</p>
+</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"struct":[["MemoryDatabase","In-memory ephemeral database"]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `MemoryDatabase` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, MemoryDatabase"><title>bdk::database::memory::MemoryDatabase - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct MemoryDatabase</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-BatchDatabase">BatchDatabase</a><a href="#impl-BatchOperations">BatchOperations</a><a href="#impl-Database">Database</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>database</a>::<wbr><a href='index.html'>memory</a></p><script>window.sidebarCurrent = {name: 'MemoryDatabase', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/database/memory.rs.html#125-128' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>database</a>::<wbr><a href='index.html'>memory</a>::<wbr><a class="struct" href=''>MemoryDatabase</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct MemoryDatabase { /* fields omitted */ }</pre></div><div class='docblock'><p>In-memory ephemeral database</p>
+<p>This database can be used as a temporary storage for wallets that are not kept permanently on
+a device, or on platforms that don't provide a filesystem, like <code>wasm32</code>.</p>
+<p>Once it's dropped its content will be lost.</p>
+<p>If you are looking for a permanent storage solution, you can try with the default key-value
+database called [<code>sled</code>]. See the <a href="crate::database"><code>database</code></a> module documentation for more defailts.</p>
+</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/bdk/database/memory.rs.html#130-138' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>() -> Self</code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#132-137' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new empty database</p>
+</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-BatchDatabase' class='impl'><code class='in-band'>impl <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a> for <a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-BatchDatabase' class='anchor'></a><a class='srclink' href='../../../src/bdk/database/memory.rs.html#437-451' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Batch' class="type"><code id='Batch.t'>type <a href='../../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch' class="type">Batch</a> = Self</code></h4><div class='docblock'><p>Container for the operations</p>
+</div><h4 id='method.begin_batch' class="method hidden"><code id='begin_batch.v'>fn <a href='../../../bdk/database/trait.BatchDatabase.html#tymethod.begin_batch' class='fnname'>begin_batch</a>(&self) -> Self::<a class="type" href="../../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#440-442' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Create a new batch container</p>
+</div><h4 id='method.commit_batch' class="method hidden"><code id='commit_batch.v'>fn <a href='../../../bdk/database/trait.BatchDatabase.html#tymethod.commit_batch' class='fnname'>commit_batch</a>(&mut self, batch: Self::<a class="type" href="../../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#444-450' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Consume and apply a batch of operations</p>
+</div></div><h3 id='impl-BatchOperations' class='impl'><code class='in-band'>impl <a class="trait" href="../../../bdk/database/trait.BatchOperations.html" title="trait bdk::database::BatchOperations">BatchOperations</a> for <a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-BatchOperations' class='anchor'></a><a class='srclink' href='../../../src/bdk/database/memory.rs.html#140-285' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.set_script_pubkey' class="method hidden"><code id='set_script_pubkey.v'>fn <a href='../../../bdk/database/trait.BatchOperations.html#tymethod.set_script_pubkey' class='fnname'>set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> script_type: <a class="enum" href="../../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#141-158' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Store a script_pubkey along with its script type and child number</p>
+</div><h4 id='method.set_utxo' class="method hidden"><code id='set_utxo.v'>fn <a href='../../../bdk/database/trait.BatchOperations.html#tymethod.set_utxo' class='fnname'>set_utxo</a>(&mut self, utxo: &<a class="struct" href="../../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#160-166' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Store a [<code>UTXO</code>]</p>
+</div><h4 id='method.set_raw_tx' class="method hidden"><code id='set_raw_tx.v'>fn <a href='../../../bdk/database/trait.BatchOperations.html#tymethod.set_raw_tx' class='fnname'>set_raw_tx</a>(&mut self, transaction: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#167-172' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Store a raw transaction</p>
+</div><h4 id='method.set_tx' class="method hidden"><code id='set_tx.v'>fn <a href='../../../bdk/database/trait.BatchOperations.html#tymethod.set_tx' class='fnname'>set_tx</a>(&mut self, transaction: &<a class="struct" href="../../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#173-188' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Store the metadata of a transaction</p>
+</div><h4 id='method.set_last_index' class="method hidden"><code id='set_last_index.v'>fn <a href='../../../bdk/database/trait.BatchOperations.html#tymethod.set_last_index' class='fnname'>set_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#189-194' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Store the last derivation index for a given script type</p>
+</div><h4 id='method.del_script_pubkey_from_path' class="method hidden"><code id='del_script_pubkey_from_path.v'>fn <a href='../../../bdk/database/trait.BatchOperations.html#tymethod.del_script_pubkey_from_path' class='fnname'>del_script_pubkey_from_path</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#196-206' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Delete a script_pubkey given the script type and its child number</p>
+</div><h4 id='method.del_path_from_script_pubkey' class="method hidden"><code id='del_path_from_script_pubkey.v'>fn <a href='../../../bdk/database/trait.BatchOperations.html#tymethod.del_path_from_script_pubkey' class='fnname'>del_path_from_script_pubkey</a>(<br> &mut self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#207-225' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Delete the data related to a specific script_pubkey, meaning the script type and the child number <a href="../../../bdk/database/trait.BatchOperations.html#tymethod.del_path_from_script_pubkey">Read more</a></p>
+</div><h4 id='method.del_utxo' class="method hidden"><code id='del_utxo.v'>fn <a href='../../../bdk/database/trait.BatchOperations.html#tymethod.del_utxo' class='fnname'>del_utxo</a>(&mut self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#226-242' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Delete a [<code>UTXO</code>] given its [<code>OutPoint</code>]</p>
+</div><h4 id='method.del_raw_tx' class="method hidden"><code id='del_raw_tx.v'>fn <a href='../../../bdk/database/trait.BatchOperations.html#tymethod.del_raw_tx' class='fnname'>del_raw_tx</a>(&mut self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#243-249' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Delete a raw transaction given its [<code>Txid</code>]</p>
+</div><h4 id='method.del_tx' class="method hidden"><code id='del_tx.v'>fn <a href='../../../bdk/database/trait.BatchOperations.html#tymethod.del_tx' class='fnname'>del_tx</a>(<br> &mut self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#250-274' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Delete the metadata of a transaction and optionally the raw transaction itself</p>
+</div><h4 id='method.del_last_index' class="method hidden"><code id='del_last_index.v'>fn <a href='../../../bdk/database/trait.BatchOperations.html#tymethod.del_last_index' class='fnname'>del_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#275-284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Delete the last derivation index for a script type</p>
+</div></div><h3 id='impl-Database' class='impl'><code class='in-band'>impl <a class="trait" href="../../../bdk/database/trait.Database.html" title="trait bdk::database::Database">Database</a> for <a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-Database' class='anchor'></a><a class='srclink' href='../../../src/bdk/database/memory.rs.html#287-435' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.check_descriptor_checksum' class="method hidden"><code id='check_descriptor_checksum.v'>fn <a href='../../../bdk/database/trait.Database.html#tymethod.check_descriptor_checksum' class='fnname'>check_descriptor_checksum</a><B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>>(<br> &mut self, <br> script_type: <a class="enum" href="../../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> bytes: B<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#288-309' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Read and checks the descriptor checksum for a given script type <a href="../../../bdk/database/trait.Database.html#tymethod.check_descriptor_checksum">Read more</a></p>
+</div><h4 id='method.iter_script_pubkeys' class="method hidden"><code id='iter_script_pubkeys.v'>fn <a href='../../../bdk/database/trait.Database.html#tymethod.iter_script_pubkeys' class='fnname'>iter_script_pubkeys</a>(<br> &self, <br> script_type: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Script>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#311-317' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the list of script_pubkeys</p>
+</div><h4 id='method.iter_utxos' class="method hidden"><code id='iter_utxos.v'>fn <a href='../../../bdk/database/trait.Database.html#tymethod.iter_utxos' class='fnname'>iter_utxos</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#319-333' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the list of [<code>UTXO</code>]s</p>
+</div><h4 id='method.iter_raw_txs' class="method hidden"><code id='iter_raw_txs.v'>fn <a href='../../../bdk/database/trait.Database.html#tymethod.iter_raw_txs' class='fnname'>iter_raw_txs</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Transaction>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#335-341' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the list of raw transactions</p>
+</div><h4 id='method.iter_txs' class="method hidden"><code id='iter_txs.v'>fn <a href='../../../bdk/database/trait.Database.html#tymethod.iter_txs' class='fnname'>iter_txs</a>(&self, include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#343-357' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the list of transactions metadata</p>
+</div><h4 id='method.get_script_pubkey_from_path' class="method hidden"><code id='get_script_pubkey_from_path.v'>fn <a href='../../../bdk/database/trait.Database.html#tymethod.get_script_pubkey_from_path' class='fnname'>get_script_pubkey_from_path</a>(<br> &self, <br> script_type: <a class="enum" href="../../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#359-369' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Fetch a script_pubkey given the script type and child number</p>
+</div><h4 id='method.get_path_from_script_pubkey' class="method hidden"><code id='get_path_from_script_pubkey.v'>fn <a href='../../../bdk/database/trait.Database.html#tymethod.get_path_from_script_pubkey' class='fnname'>get_path_from_script_pubkey</a>(<br> &self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#371-383' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Fetch the script type and child number of a given script_pubkey</p>
+</div><h4 id='method.get_utxo' class="method hidden"><code id='get_utxo.v'>fn <a href='../../../bdk/database/trait.Database.html#tymethod.get_utxo' class='fnname'>get_utxo</a>(&self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#385-395' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Fetch a [<code>UTXO</code>] given its [<code>OutPoint</code>]</p>
+</div><h4 id='method.get_raw_tx' class="method hidden"><code id='get_raw_tx.v'>fn <a href='../../../bdk/database/trait.Database.html#tymethod.get_raw_tx' class='fnname'>get_raw_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#397-403' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Fetch a raw transaction given its [<code>Txid</code>]</p>
+</div><h4 id='method.get_tx' class="method hidden"><code id='get_tx.v'>fn <a href='../../../bdk/database/trait.Database.html#tymethod.get_tx' class='fnname'>get_tx</a>(<br> &self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#405-415' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Fetch the transaction metadata and optionally also the raw transaction</p>
+</div><h4 id='method.get_last_index' class="method hidden"><code id='get_last_index.v'>fn <a href='../../../bdk/database/trait.Database.html#tymethod.get_last_index' class='fnname'>get_last_index</a>(&self, script_type: <a class="enum" href="../../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#417-420' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the last defivation index for a script type</p>
+</div><h4 id='method.increment_last_index' class="method hidden"><code id='increment_last_index.v'>fn <a href='../../../bdk/database/trait.Database.html#tymethod.increment_last_index' class='fnname'>increment_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#423-434' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Increment the last derivation index for a script type and returns it <a href="../../../bdk/database/trait.Database.html#tymethod.increment_last_index">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/database/memory.rs.html#124' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#124' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/bdk/database/memory.rs.html#124' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a class='srclink' href='../../../src/bdk/database/memory.rs.html#124' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"mod":[["memory","In-memory ephemeral database"]],"trait":[["BatchDatabase","Trait for a database that supports batch operations"],["BatchOperations","Trait for operations that can be batched"],["Database","Trait for reading data from a database"]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BatchDatabase` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, BatchDatabase"><title>bdk::database::BatchDatabase - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait BatchDatabase</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-types">Associated Types</a><div class="sidebar-links"><a href="#associatedtype.Batch">Batch</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.begin_batch">begin_batch</a><a href="#tymethod.commit_batch">commit_batch</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-BatchDatabase-for-Tree">Tree</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>database</a></p><script>window.sidebarCurrent = {name: 'BatchDatabase', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/database/mod.rs.html#152-160' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>database</a>::<wbr><a class="trait" href=''>BatchDatabase</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait BatchDatabase: <a class="trait" href="../../bdk/database/trait.Database.html" title="trait bdk::database::Database">Database</a> {
+ type <a href='#associatedtype.Batch' class="type">Batch</a>: <a class="trait" href="../../bdk/database/trait.BatchOperations.html" title="trait bdk::database::BatchOperations">BatchOperations</a>;
+ fn <a href='#tymethod.begin_batch' class='fnname'>begin_batch</a>(&self) -> Self::<a class="type" href="../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a>;
+<div class='item-spacer'></div> fn <a href='#tymethod.commit_batch' class='fnname'>commit_batch</a>(&mut self, batch: Self::<a class="type" href="../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+}</pre></div><div class='docblock'><p>Trait for a database that supports batch operations</p>
+<p>This trait defines the methods to start and apply a batch of operations.</p>
+</div>
+ <h2 id='associated-types' class='small-section-header'>Associated Types<a href='#associated-types' class='anchor'></a></h2><div class='methods'><h3 id='associatedtype.Batch' class='method'><code id='Batch.t'>type <a href='#associatedtype.Batch' class="type">Batch</a>: <a class="trait" href="../../bdk/database/trait.BatchOperations.html" title="trait bdk::database::BatchOperations">BatchOperations</a></code></h3><div class='docblock'><p>Container for the operations</p>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.begin_batch' class='method'><code id='begin_batch.v'>fn <a href='#tymethod.begin_batch' class='fnname'>begin_batch</a>(&self) -> Self::<a class="type" href="../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a></code></h3><div class='docblock'><p>Create a new batch container</p>
+</div><h3 id='tymethod.commit_batch' class='method'><code id='commit_batch.v'>fn <a href='#tymethod.commit_batch' class='fnname'>commit_batch</a>(&mut self, batch: Self::<a class="type" href="../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Consume and apply a batch of operations</p>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-BatchDatabase-for-Tree' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a> for Tree</code><a href='#impl-BatchDatabase-for-Tree' class='anchor'></a><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#385-395' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Batch-1' class="type"><code id='Batch.t-1'>type <a href='#associatedtype.Batch' class="type">Batch</a> = Batch</code></h4><h4 id='method.begin_batch' class="method hidden"><code id='begin_batch.v-1'>fn <a href='#method.begin_batch' class='fnname'>begin_batch</a>(&self) -> Self::<a class="type" href="../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#388-390' title='goto source code'>[src]</a></h4><h4 id='method.commit_batch' class="method hidden"><code id='commit_batch.v-1'>fn <a href='#method.commit_batch' class='fnname'>commit_batch</a>(&mut self, batch: Self::<a class="type" href="../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#392-394' title='goto source code'>[src]</a></h4></div><span class='loading-content'>Loading content...</span>
+ <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-BatchDatabase' class='impl'><code class='in-band'>impl BatchDatabase for <a class="struct" href="../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-BatchDatabase' class='anchor'></a><a class='srclink' href='../../src/bdk/database/memory.rs.html#437-451' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Batch-2' class="type"><code id='Batch.t-2'>type <a href='#associatedtype.Batch-2' class="type">Batch</a> = Self</code></h4><h4 id='method.begin_batch-1' class="method hidden"><code id='begin_batch.v-2'>fn <a href='#method.begin_batch-1' class='fnname'>begin_batch</a>(&self) -> Self::<a class="type" href="../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#440-442' title='goto source code'>[src]</a></h4><h4 id='method.commit_batch-1' class="method hidden"><code id='commit_batch.v-2'>fn <a href='#method.commit_batch-1' class='fnname'>commit_batch</a>(&mut self, batch: Self::<a class="type" href="../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#444-450' title='goto source code'>[src]</a></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/bdk/database/trait.BatchDatabase.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BatchOperations` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, BatchOperations"><title>bdk::database::BatchOperations - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait BatchOperations</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.del_last_index">del_last_index</a><a href="#tymethod.del_path_from_script_pubkey">del_path_from_script_pubkey</a><a href="#tymethod.del_raw_tx">del_raw_tx</a><a href="#tymethod.del_script_pubkey_from_path">del_script_pubkey_from_path</a><a href="#tymethod.del_tx">del_tx</a><a href="#tymethod.del_utxo">del_utxo</a><a href="#tymethod.set_last_index">set_last_index</a><a href="#tymethod.set_raw_tx">set_raw_tx</a><a href="#tymethod.set_script_pubkey">set_script_pubkey</a><a href="#tymethod.set_tx">set_tx</a><a href="#tymethod.set_utxo">set_utxo</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-BatchOperations-for-Batch">Batch</a><a href="#impl-BatchOperations-for-Tree">Tree</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>database</a></p><script>window.sidebarCurrent = {name: 'BatchOperations', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/database/mod.rs.html#56-97' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>database</a>::<wbr><a class="trait" href=''>BatchOperations</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait BatchOperations {
+ fn <a href='#tymethod.set_script_pubkey' class='fnname'>set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> child: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.set_utxo' class='fnname'>set_utxo</a>(&mut self, utxo: &<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.set_raw_tx' class='fnname'>set_raw_tx</a>(&mut self, transaction: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.set_tx' class='fnname'>set_tx</a>(&mut self, transaction: &<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.set_last_index' class='fnname'>set_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.del_script_pubkey_from_path' class='fnname'>del_script_pubkey_from_path</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> child: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.del_path_from_script_pubkey' class='fnname'>del_path_from_script_pubkey</a>(<br> &mut self, <br> script: &Script<br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.del_utxo' class='fnname'>del_utxo</a>(&mut self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.del_raw_tx' class='fnname'>del_raw_tx</a>(&mut self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.del_tx' class='fnname'>del_tx</a>(<br> &mut self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.del_last_index' class='fnname'>del_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+}</pre></div><div class='docblock'><p>Trait for operations that can be batched</p>
+<p>This trait defines the list of operations that must be implemented on the [<code>Database</code>] type and
+the [<code>BatchDatabase::Batch</code>] type.</p>
+</div>
+ <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.set_script_pubkey' class='method'><code id='set_script_pubkey.v'>fn <a href='#tymethod.set_script_pubkey' class='fnname'>set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> child: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Store a script_pubkey along with its script type and child number</p>
+</div><h3 id='tymethod.set_utxo' class='method'><code id='set_utxo.v'>fn <a href='#tymethod.set_utxo' class='fnname'>set_utxo</a>(&mut self, utxo: &<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Store a [<code>UTXO</code>]</p>
+</div><h3 id='tymethod.set_raw_tx' class='method'><code id='set_raw_tx.v'>fn <a href='#tymethod.set_raw_tx' class='fnname'>set_raw_tx</a>(&mut self, transaction: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Store a raw transaction</p>
+</div><h3 id='tymethod.set_tx' class='method'><code id='set_tx.v'>fn <a href='#tymethod.set_tx' class='fnname'>set_tx</a>(&mut self, transaction: &<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Store the metadata of a transaction</p>
+</div><h3 id='tymethod.set_last_index' class='method'><code id='set_last_index.v'>fn <a href='#tymethod.set_last_index' class='fnname'>set_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Store the last derivation index for a given script type</p>
+</div><h3 id='tymethod.del_script_pubkey_from_path' class='method'><code id='del_script_pubkey_from_path.v'>fn <a href='#tymethod.del_script_pubkey_from_path' class='fnname'>del_script_pubkey_from_path</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> child: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Delete a script_pubkey given the script type and its child number</p>
+</div><h3 id='tymethod.del_path_from_script_pubkey' class='method'><code id='del_path_from_script_pubkey.v'>fn <a href='#tymethod.del_path_from_script_pubkey' class='fnname'>del_path_from_script_pubkey</a>(<br> &mut self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Delete the data related to a specific script_pubkey, meaning the script type and the child
+number</p>
+</div><h3 id='tymethod.del_utxo' class='method'><code id='del_utxo.v'>fn <a href='#tymethod.del_utxo' class='fnname'>del_utxo</a>(&mut self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Delete a [<code>UTXO</code>] given its [<code>OutPoint</code>]</p>
+</div><h3 id='tymethod.del_raw_tx' class='method'><code id='del_raw_tx.v'>fn <a href='#tymethod.del_raw_tx' class='fnname'>del_raw_tx</a>(&mut self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Delete a raw transaction given its [<code>Txid</code>]</p>
+</div><h3 id='tymethod.del_tx' class='method'><code id='del_tx.v'>fn <a href='#tymethod.del_tx' class='fnname'>del_tx</a>(<br> &mut self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Delete the metadata of a transaction and optionally the raw transaction itself</p>
+</div><h3 id='tymethod.del_last_index' class='method'><code id='del_last_index.v'>fn <a href='#tymethod.del_last_index' class='fnname'>del_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Delete the last derivation index for a script type</p>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-BatchOperations-for-Tree' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/database/trait.BatchOperations.html" title="trait bdk::database::BatchOperations">BatchOperations</a> for Tree</code><a href='#impl-BatchOperations-for-Tree' class='anchor'></a><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#192-194' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.set_script_pubkey' class="method hidden"><code id='set_script_pubkey.v-1'>fn <a href='#method.set_script_pubkey' class='fnname'>set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#40-52' title='goto source code'>[src]</a></h4><h4 id='method.set_utxo' class="method hidden"><code id='set_utxo.v-1'>fn <a href='#method.set_utxo' class='fnname'>set_utxo</a>(&mut self, utxo: &<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#54-63' title='goto source code'>[src]</a></h4><h4 id='method.set_raw_tx' class="method hidden"><code id='set_raw_tx.v-1'>fn <a href='#method.set_raw_tx' class='fnname'>set_raw_tx</a>(&mut self, transaction: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#65-71' title='goto source code'>[src]</a></h4><h4 id='method.set_tx' class="method hidden"><code id='set_tx.v-1'>fn <a href='#method.set_tx' class='fnname'>set_tx</a>(&mut self, transaction: &<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#73-89' title='goto source code'>[src]</a></h4><h4 id='method.set_last_index' class="method hidden"><code id='set_last_index.v-1'>fn <a href='#method.set_last_index' class='fnname'>set_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#91-96' title='goto source code'>[src]</a></h4><h4 id='method.del_script_pubkey_from_path' class="method hidden"><code id='del_script_pubkey_from_path.v-1'>fn <a href='#method.del_script_pubkey_from_path' class='fnname'>del_script_pubkey_from_path</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#98-104' title='goto source code'>[src]</a></h4><h4 id='method.del_path_from_script_pubkey' class="method hidden"><code id='del_path_from_script_pubkey.v-1'>fn <a href='#method.del_path_from_script_pubkey' class='fnname'>del_path_from_script_pubkey</a>(<br> &mut self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#106-121' title='goto source code'>[src]</a></h4><h4 id='method.del_utxo' class="method hidden"><code id='del_utxo.v-1'>fn <a href='#method.del_utxo' class='fnname'>del_utxo</a>(&mut self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#123-138' title='goto source code'>[src]</a></h4><h4 id='method.del_raw_tx' class="method hidden"><code id='del_raw_tx.v-1'>fn <a href='#method.del_raw_tx' class='fnname'>del_raw_tx</a>(&mut self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#140-146' title='goto source code'>[src]</a></h4><h4 id='method.del_tx' class="method hidden"><code id='del_tx.v-1'>fn <a href='#method.del_tx' class='fnname'>del_tx</a>(<br> &mut self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#148-168' title='goto source code'>[src]</a></h4><h4 id='method.del_last_index' class="method hidden"><code id='del_last_index.v-1'>fn <a href='#method.del_last_index' class='fnname'>del_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#170-183' title='goto source code'>[src]</a></h4></div><h3 id='impl-BatchOperations-for-Batch' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/database/trait.BatchOperations.html" title="trait bdk::database::BatchOperations">BatchOperations</a> for Batch</code><a href='#impl-BatchOperations-for-Batch' class='anchor'></a><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#202-204' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.set_script_pubkey-1' class="method hidden"><code id='set_script_pubkey.v-2'>fn <a href='#method.set_script_pubkey' class='fnname'>set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#40-52' title='goto source code'>[src]</a></h4><h4 id='method.set_utxo-1' class="method hidden"><code id='set_utxo.v-2'>fn <a href='#method.set_utxo' class='fnname'>set_utxo</a>(&mut self, utxo: &<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#54-63' title='goto source code'>[src]</a></h4><h4 id='method.set_raw_tx-1' class="method hidden"><code id='set_raw_tx.v-2'>fn <a href='#method.set_raw_tx' class='fnname'>set_raw_tx</a>(&mut self, transaction: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#65-71' title='goto source code'>[src]</a></h4><h4 id='method.set_tx-1' class="method hidden"><code id='set_tx.v-2'>fn <a href='#method.set_tx' class='fnname'>set_tx</a>(&mut self, transaction: &<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#73-89' title='goto source code'>[src]</a></h4><h4 id='method.set_last_index-1' class="method hidden"><code id='set_last_index.v-2'>fn <a href='#method.set_last_index' class='fnname'>set_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#91-96' title='goto source code'>[src]</a></h4><h4 id='method.del_script_pubkey_from_path-1' class="method hidden"><code id='del_script_pubkey_from_path.v-2'>fn <a href='#method.del_script_pubkey_from_path' class='fnname'>del_script_pubkey_from_path</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#98-104' title='goto source code'>[src]</a></h4><h4 id='method.del_path_from_script_pubkey-1' class="method hidden"><code id='del_path_from_script_pubkey.v-2'>fn <a href='#method.del_path_from_script_pubkey' class='fnname'>del_path_from_script_pubkey</a>(<br> &mut self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#106-121' title='goto source code'>[src]</a></h4><h4 id='method.del_utxo-1' class="method hidden"><code id='del_utxo.v-2'>fn <a href='#method.del_utxo' class='fnname'>del_utxo</a>(&mut self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#123-138' title='goto source code'>[src]</a></h4><h4 id='method.del_raw_tx-1' class="method hidden"><code id='del_raw_tx.v-2'>fn <a href='#method.del_raw_tx' class='fnname'>del_raw_tx</a>(&mut self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#140-146' title='goto source code'>[src]</a></h4><h4 id='method.del_tx-1' class="method hidden"><code id='del_tx.v-2'>fn <a href='#method.del_tx' class='fnname'>del_tx</a>(<br> &mut self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#148-168' title='goto source code'>[src]</a></h4><h4 id='method.del_last_index-1' class="method hidden"><code id='del_last_index.v-2'>fn <a href='#method.del_last_index' class='fnname'>del_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#170-183' title='goto source code'>[src]</a></h4></div><span class='loading-content'>Loading content...</span>
+ <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-BatchOperations' class='impl'><code class='in-band'>impl BatchOperations for <a class="struct" href="../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-BatchOperations' class='anchor'></a><a class='srclink' href='../../src/bdk/database/memory.rs.html#140-285' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.set_script_pubkey-2' class="method hidden"><code id='set_script_pubkey.v-3'>fn <a href='#method.set_script_pubkey-2' class='fnname'>set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#141-158' title='goto source code'>[src]</a></h4><h4 id='method.set_utxo-2' class="method hidden"><code id='set_utxo.v-3'>fn <a href='#method.set_utxo-2' class='fnname'>set_utxo</a>(&mut self, utxo: &<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#160-166' title='goto source code'>[src]</a></h4><h4 id='method.set_raw_tx-2' class="method hidden"><code id='set_raw_tx.v-3'>fn <a href='#method.set_raw_tx-2' class='fnname'>set_raw_tx</a>(&mut self, transaction: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#167-172' title='goto source code'>[src]</a></h4><h4 id='method.set_tx-2' class="method hidden"><code id='set_tx.v-3'>fn <a href='#method.set_tx-2' class='fnname'>set_tx</a>(&mut self, transaction: &<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#173-188' title='goto source code'>[src]</a></h4><h4 id='method.set_last_index-2' class="method hidden"><code id='set_last_index.v-3'>fn <a href='#method.set_last_index-2' class='fnname'>set_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#189-194' title='goto source code'>[src]</a></h4><h4 id='method.del_script_pubkey_from_path-2' class="method hidden"><code id='del_script_pubkey_from_path.v-3'>fn <a href='#method.del_script_pubkey_from_path-2' class='fnname'>del_script_pubkey_from_path</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#196-206' title='goto source code'>[src]</a></h4><h4 id='method.del_path_from_script_pubkey-2' class="method hidden"><code id='del_path_from_script_pubkey.v-3'>fn <a href='#method.del_path_from_script_pubkey-2' class='fnname'>del_path_from_script_pubkey</a>(<br> &mut self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#207-225' title='goto source code'>[src]</a></h4><h4 id='method.del_utxo-2' class="method hidden"><code id='del_utxo.v-3'>fn <a href='#method.del_utxo-2' class='fnname'>del_utxo</a>(&mut self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#226-242' title='goto source code'>[src]</a></h4><h4 id='method.del_raw_tx-2' class="method hidden"><code id='del_raw_tx.v-3'>fn <a href='#method.del_raw_tx-2' class='fnname'>del_raw_tx</a>(&mut self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#243-249' title='goto source code'>[src]</a></h4><h4 id='method.del_tx-2' class="method hidden"><code id='del_tx.v-3'>fn <a href='#method.del_tx-2' class='fnname'>del_tx</a>(<br> &mut self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#250-274' title='goto source code'>[src]</a></h4><h4 id='method.del_last_index-2' class="method hidden"><code id='del_last_index.v-3'>fn <a href='#method.del_last_index-2' class='fnname'>del_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#275-284' title='goto source code'>[src]</a></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/bdk/database/trait.BatchOperations.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Database` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Database"><title>bdk::database::Database - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait Database</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.check_descriptor_checksum">check_descriptor_checksum</a><a href="#tymethod.get_last_index">get_last_index</a><a href="#tymethod.get_path_from_script_pubkey">get_path_from_script_pubkey</a><a href="#tymethod.get_raw_tx">get_raw_tx</a><a href="#tymethod.get_script_pubkey_from_path">get_script_pubkey_from_path</a><a href="#tymethod.get_tx">get_tx</a><a href="#tymethod.get_utxo">get_utxo</a><a href="#tymethod.increment_last_index">increment_last_index</a><a href="#tymethod.iter_raw_txs">iter_raw_txs</a><a href="#tymethod.iter_script_pubkeys">iter_script_pubkeys</a><a href="#tymethod.iter_txs">iter_txs</a><a href="#tymethod.iter_utxos">iter_utxos</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-Database-for-Tree">Tree</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>database</a></p><script>window.sidebarCurrent = {name: 'Database', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/database/mod.rs.html#102-147' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>database</a>::<wbr><a class="trait" href=''>Database</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait Database: <a class="trait" href="../../bdk/database/trait.BatchOperations.html" title="trait bdk::database::BatchOperations">BatchOperations</a> {
+ fn <a href='#tymethod.check_descriptor_checksum' class='fnname'>check_descriptor_checksum</a><B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> bytes: B<br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.iter_script_pubkeys' class='fnname'>iter_script_pubkeys</a>(<br> &self, <br> script_type: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Script>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.iter_utxos' class='fnname'>iter_utxos</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.iter_raw_txs' class='fnname'>iter_raw_txs</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.iter_txs' class='fnname'>iter_txs</a>(<br> &self, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.get_script_pubkey_from_path' class='fnname'>get_script_pubkey_from_path</a>(<br> &self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> child: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.get_path_from_script_pubkey' class='fnname'>get_path_from_script_pubkey</a>(<br> &self, <br> script: &Script<br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.get_utxo' class='fnname'>get_utxo</a>(&self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.get_raw_tx' class='fnname'>get_raw_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.get_tx' class='fnname'>get_tx</a>(<br> &self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.get_last_index' class='fnname'>get_last_index</a>(<br> &self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.increment_last_index' class='fnname'>increment_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+}</pre></div><div class='docblock'><p>Trait for reading data from a database</p>
+<p>This traits defines the operations that can be used to read data out of a database</p>
+</div>
+ <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.check_descriptor_checksum' class='method'><code id='check_descriptor_checksum.v'>fn <a href='#tymethod.check_descriptor_checksum' class='fnname'>check_descriptor_checksum</a><B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> bytes: B<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Read and checks the descriptor checksum for a given script type</p>
+<p>Should return <a href="crate::error::Error::ChecksumMismatch"><code>Error::ChecksumMismatch</code></a> if the
+checksum doesn't match. If there's no checksum in the database, simply store it for the
+next time.</p>
+</div><h3 id='tymethod.iter_script_pubkeys' class='method'><code id='iter_script_pubkeys.v'>fn <a href='#tymethod.iter_script_pubkeys' class='fnname'>iter_script_pubkeys</a>(<br> &self, <br> script_type: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Script>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Return the list of script_pubkeys</p>
+</div><h3 id='tymethod.iter_utxos' class='method'><code id='iter_utxos.v'>fn <a href='#tymethod.iter_utxos' class='fnname'>iter_utxos</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Return the list of [<code>UTXO</code>]s</p>
+</div><h3 id='tymethod.iter_raw_txs' class='method'><code id='iter_raw_txs.v'>fn <a href='#tymethod.iter_raw_txs' class='fnname'>iter_raw_txs</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Return the list of raw transactions</p>
+</div><h3 id='tymethod.iter_txs' class='method'><code id='iter_txs.v'>fn <a href='#tymethod.iter_txs' class='fnname'>iter_txs</a>(&self, include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Return the list of transactions metadata</p>
+</div><h3 id='tymethod.get_script_pubkey_from_path' class='method'><code id='get_script_pubkey_from_path.v'>fn <a href='#tymethod.get_script_pubkey_from_path' class='fnname'>get_script_pubkey_from_path</a>(<br> &self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> child: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Fetch a script_pubkey given the script type and child number</p>
+</div><h3 id='tymethod.get_path_from_script_pubkey' class='method'><code id='get_path_from_script_pubkey.v'>fn <a href='#tymethod.get_path_from_script_pubkey' class='fnname'>get_path_from_script_pubkey</a>(<br> &self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Fetch the script type and child number of a given script_pubkey</p>
+</div><h3 id='tymethod.get_utxo' class='method'><code id='get_utxo.v'>fn <a href='#tymethod.get_utxo' class='fnname'>get_utxo</a>(&self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Fetch a [<code>UTXO</code>] given its [<code>OutPoint</code>]</p>
+</div><h3 id='tymethod.get_raw_tx' class='method'><code id='get_raw_tx.v'>fn <a href='#tymethod.get_raw_tx' class='fnname'>get_raw_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Fetch a raw transaction given its [<code>Txid</code>]</p>
+</div><h3 id='tymethod.get_tx' class='method'><code id='get_tx.v'>fn <a href='#tymethod.get_tx' class='fnname'>get_tx</a>(<br> &self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Fetch the transaction metadata and optionally also the raw transaction</p>
+</div><h3 id='tymethod.get_last_index' class='method'><code id='get_last_index.v'>fn <a href='#tymethod.get_last_index' class='fnname'>get_last_index</a>(&self, script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Return the last defivation index for a script type</p>
+</div><h3 id='tymethod.increment_last_index' class='method'><code id='increment_last_index.v'>fn <a href='#tymethod.increment_last_index' class='fnname'>increment_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Increment the last derivation index for a script type and returns it</p>
+<p>It should insert and return <code>0</code> if not present in the database</p>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-Database-for-Tree' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/database/trait.Database.html" title="trait bdk::database::Database">Database</a> for Tree</code><a href='#impl-Database-for-Tree' class='anchor'></a><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#206-383' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.check_descriptor_checksum' class="method hidden"><code id='check_descriptor_checksum.v-1'>fn <a href='#method.check_descriptor_checksum' class='fnname'>check_descriptor_checksum</a><B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> bytes: B<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#207-225' title='goto source code'>[src]</a></h4><h4 id='method.iter_script_pubkeys' class="method hidden"><code id='iter_script_pubkeys.v-1'>fn <a href='#method.iter_script_pubkeys' class='fnname'>iter_script_pubkeys</a>(<br> &self, <br> script_type: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Script>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#227-235' title='goto source code'>[src]</a></h4><h4 id='method.iter_utxos' class="method hidden"><code id='iter_utxos.v-1'>fn <a href='#method.iter_utxos' class='fnname'>iter_utxos</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#237-255' title='goto source code'>[src]</a></h4><h4 id='method.iter_raw_txs' class="method hidden"><code id='iter_raw_txs.v-1'>fn <a href='#method.iter_raw_txs' class='fnname'>iter_raw_txs</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#257-265' title='goto source code'>[src]</a></h4><h4 id='method.iter_txs' class="method hidden"><code id='iter_txs.v-1'>fn <a href='#method.iter_txs' class='fnname'>iter_txs</a>(&self, include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#267-281' title='goto source code'>[src]</a></h4><h4 id='method.get_script_pubkey_from_path' class="method hidden"><code id='get_script_pubkey_from_path.v-1'>fn <a href='#method.get_script_pubkey_from_path' class='fnname'>get_script_pubkey_from_path</a>(<br> &self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#283-290' title='goto source code'>[src]</a></h4><h4 id='method.get_path_from_script_pubkey' class="method hidden"><code id='get_path_from_script_pubkey.v-1'>fn <a href='#method.get_path_from_script_pubkey' class='fnname'>get_path_from_script_pubkey</a>(<br> &self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#292-306' title='goto source code'>[src]</a></h4><h4 id='method.get_utxo' class="method hidden"><code id='get_utxo.v-1'>fn <a href='#method.get_utxo' class='fnname'>get_utxo</a>(&self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#308-323' title='goto source code'>[src]</a></h4><h4 id='method.get_raw_tx' class="method hidden"><code id='get_raw_tx.v-1'>fn <a href='#method.get_raw_tx' class='fnname'>get_raw_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#325-328' title='goto source code'>[src]</a></h4><h4 id='method.get_tx' class="method hidden"><code id='get_tx.v-1'>fn <a href='#method.get_tx' class='fnname'>get_tx</a>(<br> &self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#330-342' title='goto source code'>[src]</a></h4><h4 id='method.get_last_index' class="method hidden"><code id='get_last_index.v-1'>fn <a href='#method.get_last_index' class='fnname'>get_last_index</a>(&self, script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#344-356' title='goto source code'>[src]</a></h4><h4 id='method.increment_last_index' class="method hidden"><code id='increment_last_index.v-1'>fn <a href='#method.increment_last_index' class='fnname'>increment_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/keyvalue.rs.html#359-382' title='goto source code'>[src]</a></h4></div><span class='loading-content'>Loading content...</span>
+ <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-Database' class='impl'><code class='in-band'>impl Database for <a class="struct" href="../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-Database' class='anchor'></a><a class='srclink' href='../../src/bdk/database/memory.rs.html#287-435' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.check_descriptor_checksum-1' class="method hidden"><code id='check_descriptor_checksum.v-2'>fn <a href='#method.check_descriptor_checksum-1' class='fnname'>check_descriptor_checksum</a><B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> bytes: B<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#288-309' title='goto source code'>[src]</a></h4><h4 id='method.iter_script_pubkeys-1' class="method hidden"><code id='iter_script_pubkeys.v-2'>fn <a href='#method.iter_script_pubkeys-1' class='fnname'>iter_script_pubkeys</a>(<br> &self, <br> script_type: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Script>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#311-317' title='goto source code'>[src]</a></h4><h4 id='method.iter_utxos-1' class="method hidden"><code id='iter_utxos.v-2'>fn <a href='#method.iter_utxos-1' class='fnname'>iter_utxos</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#319-333' title='goto source code'>[src]</a></h4><h4 id='method.iter_raw_txs-1' class="method hidden"><code id='iter_raw_txs.v-2'>fn <a href='#method.iter_raw_txs-1' class='fnname'>iter_raw_txs</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#335-341' title='goto source code'>[src]</a></h4><h4 id='method.iter_txs-1' class="method hidden"><code id='iter_txs.v-2'>fn <a href='#method.iter_txs-1' class='fnname'>iter_txs</a>(&self, include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#343-357' title='goto source code'>[src]</a></h4><h4 id='method.get_script_pubkey_from_path-1' class="method hidden"><code id='get_script_pubkey_from_path.v-2'>fn <a href='#method.get_script_pubkey_from_path-1' class='fnname'>get_script_pubkey_from_path</a>(<br> &self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#359-369' title='goto source code'>[src]</a></h4><h4 id='method.get_path_from_script_pubkey-1' class="method hidden"><code id='get_path_from_script_pubkey.v-2'>fn <a href='#method.get_path_from_script_pubkey-1' class='fnname'>get_path_from_script_pubkey</a>(<br> &self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#371-383' title='goto source code'>[src]</a></h4><h4 id='method.get_utxo-1' class="method hidden"><code id='get_utxo.v-2'>fn <a href='#method.get_utxo-1' class='fnname'>get_utxo</a>(&self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#385-395' title='goto source code'>[src]</a></h4><h4 id='method.get_raw_tx-1' class="method hidden"><code id='get_raw_tx.v-2'>fn <a href='#method.get_raw_tx-1' class='fnname'>get_raw_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#397-403' title='goto source code'>[src]</a></h4><h4 id='method.get_tx-1' class="method hidden"><code id='get_tx.v-2'>fn <a href='#method.get_tx-1' class='fnname'>get_tx</a>(<br> &self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#405-415' title='goto source code'>[src]</a></h4><h4 id='method.get_last_index-1' class="method hidden"><code id='get_last_index.v-2'>fn <a href='#method.get_last_index-1' class='fnname'>get_last_index</a>(&self, script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#417-420' title='goto source code'>[src]</a></h4><h4 id='method.increment_last_index-1' class="method hidden"><code id='increment_last_index.v-2'>fn <a href='#method.increment_last_index-1' class='fnname'>increment_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/database/memory.rs.html#423-434' title='goto source code'>[src]</a></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/bdk/database/trait.Database.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `get_checksum` fn in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, get_checksum"><title>bdk::descriptor::checksum::get_checksum - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>checksum</a></p><script>window.sidebarCurrent = {name: 'get_checksum', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/descriptor/checksum.rs.html#60-94' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>checksum</a>::<wbr><a class="fn" href=''>get_checksum</a></span></h1><pre class='rust fn'>pub fn get_checksum(desc: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a>></pre><div class='docblock'><p>Compute the checksum of a descriptor</p>
+</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `checksum` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, checksum"><title>bdk::descriptor::checksum - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module checksum</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'checksum', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/descriptor/checksum.rs.html#25-94' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a class="mod" href=''>checksum</a></span></h1><div class='docblock'><p>Descriptor checksum</p>
+<p>This module contains a re-implementation of the function used by Bitcoin Core to calculate the
+checksum of a descriptor</p>
+</div><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
+<table><tr class='module-item'><td><a class="fn" href="fn.get_checksum.html" title='bdk::descriptor::checksum::get_checksum fn'>get_checksum</a></td><td class='docblock-short'><p>Compute the checksum of a descriptor</p>
+</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"fn":[["get_checksum","Compute the checksum of a descriptor"]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Descriptor` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Descriptor"><title>bdk::descriptor::Descriptor - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Descriptor</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Bare">Bare</a><a href="#variant.Pk">Pk</a><a href="#variant.Pkh">Pkh</a><a href="#variant.Sh">Sh</a><a href="#variant.ShWpkh">ShWpkh</a><a href="#variant.ShWsh">ShWsh</a><a href="#variant.Wpkh">Wpkh</a><a href="#variant.Wsh">Wsh</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.address">address</a><a href="#method.derive">derive</a><a href="#method.max_satisfaction_weight">max_satisfaction_weight</a><a href="#method.parse_secret">parse_secret</a><a href="#method.satisfy">satisfy</a><a href="#method.script_pubkey">script_pubkey</a><a href="#method.to_string_with_secret">to_string_with_secret</a><a href="#method.translate_pk">translate_pk</a><a href="#method.unsigned_script_sig">unsigned_script_sig</a><a href="#method.witness_script">witness_script</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-ExtractPolicy">ExtractPolicy</a><a href="#impl-FromStr">FromStr</a><a href="#impl-FromTree">FromTree</a><a href="#impl-Liftable%3CPk%3E">Liftable<Pk></a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CDescriptor%3CPk%3E%3E">PartialEq<Descriptor<Pk>></a><a href="#impl-PartialOrd%3CDescriptor%3CPk%3E%3E">PartialOrd<Descriptor<Pk>></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'Descriptor', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span></span><span class='in-band'>Enum <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="enum" href=''>Descriptor</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Descriptor<Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span> {
+ Bare(<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>>),
+ Pk(Pk),
+ Pkh(Pk),
+ Wpkh(Pk),
+ ShWpkh(Pk),
+ Sh(<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>>),
+ Wsh(<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>),
+ ShWsh(<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>),
+}</pre></div><div class='docblock'><p>Script descriptor</p>
+</div><h2 id='variants' class='variants small-section-header'>
+ Variants<a href='#variants' class='anchor'></a></h2>
+<div id="variant.Bare" class="variant small-section-header"><a href="#variant.Bare" class="anchor field"></a><code id='Bare.v'>Bare(<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>>)</code></div><div class='docblock'><p>A raw scriptpubkey (including pay-to-pubkey) under Legacy context</p>
+</div><div id="variant.Pk" class="variant small-section-header"><a href="#variant.Pk" class="anchor field"></a><code id='Pk.v'>Pk(Pk)</code></div><div class='docblock'><p>Pay-to-Pubkey</p>
+</div><div id="variant.Pkh" class="variant small-section-header"><a href="#variant.Pkh" class="anchor field"></a><code id='Pkh.v'>Pkh(Pk)</code></div><div class='docblock'><p>Pay-to-PubKey-Hash</p>
+</div><div id="variant.Wpkh" class="variant small-section-header"><a href="#variant.Wpkh" class="anchor field"></a><code id='Wpkh.v'>Wpkh(Pk)</code></div><div class='docblock'><p>Pay-to-Witness-PubKey-Hash</p>
+</div><div id="variant.ShWpkh" class="variant small-section-header"><a href="#variant.ShWpkh" class="anchor field"></a><code id='ShWpkh.v'>ShWpkh(Pk)</code></div><div class='docblock'><p>Pay-to-Witness-PubKey-Hash inside P2SH</p>
+</div><div id="variant.Sh" class="variant small-section-header"><a href="#variant.Sh" class="anchor field"></a><code id='Sh.v'>Sh(<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>>)</code></div><div class='docblock'><p>Pay-to-ScriptHash with Legacy context</p>
+</div><div id="variant.Wsh" class="variant small-section-header"><a href="#variant.Wsh" class="anchor field"></a><code id='Wsh.v'>Wsh(<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>)</code></div><div class='docblock'><p>Pay-to-Witness-ScriptHash with Segwitv0 context</p>
+</div><div id="variant.ShWsh" class="variant small-section-header"><a href="#variant.ShWsh" class="anchor field"></a><code id='ShWsh.v'>ShWsh(<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>)</code></div><div class='docblock'><p>P2SH-P2WSH with Segwitv0 context</p>
+</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<Pk> <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl' class='anchor'></a></h3><div class='impl-items'><h4 id='method.translate_pk' class="method"><code id='translate_pk.v'>pub fn <a href='#method.translate_pk' class='fnname'>translate_pk</a><Fpk, Fpkh, Q, E>(<br> &self, <br> translatefpk: Fpk, <br> translatefpkh: Fpkh<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Q>, E> <span class="where fmt-newline">where<br> Fpk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Pk) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Q, E>,<br> Fpkh: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&<Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Q as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>, E>,<br> Q: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><div class='docblock'><p>Convert a descriptor using abstract keys to one using specific keys
+This will panic if translatefpk returns an uncompressed key when
+converting to a Segwit descriptor. To prevent this panic, ensure
+translatefpk returns an error in this case instead.</p>
+</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl<Pk> <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a>, </span></code><a href='#impl-1' class='anchor'></a></h3><div class='impl-items'><h4 id='method.address' class="method"><code id='address.v'>pub fn <a href='#method.address' class='fnname'>address</a>(&self, network: Network) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Address></code></h4><div class='docblock'><p>Computes the Bitcoin address of the descriptor, if one exists</p>
+</div><h4 id='method.script_pubkey' class="method"><code id='script_pubkey.v'>pub fn <a href='#method.script_pubkey' class='fnname'>script_pubkey</a>(&self) -> Script</code></h4><div class='docblock'><p>Computes the scriptpubkey of the descriptor</p>
+</div><h4 id='method.unsigned_script_sig' class="method"><code id='unsigned_script_sig.v'>pub fn <a href='#method.unsigned_script_sig' class='fnname'>unsigned_script_sig</a>(&self) -> Script</code></h4><div class='docblock'><p>Computes the scriptSig that will be in place for an unsigned
+input spending an output with this descriptor. For pre-segwit
+descriptors, which use the scriptSig for signatures, this
+returns the empty script.</p>
+<p>This is used in Segwit transactions to produce an unsigned
+transaction whose txid will not change during signing (since
+only the witness data will change).</p>
+</div><h4 id='method.witness_script' class="method"><code id='witness_script.v'>pub fn <a href='#method.witness_script' class='fnname'>witness_script</a>(&self) -> Script</code></h4><div class='docblock'><p>Computes the "witness script" of the descriptor, i.e. the underlying
+script before any hashing is done. For <code>Bare</code>, <code>Pkh</code> and <code>Wpkh</code> this
+is the scriptPubkey; for <code>ShWpkh</code> and <code>Sh</code> this is the redeemScript;
+for the others it is the witness script.</p>
+</div><h4 id='method.satisfy' class="method"><code id='satisfy.v'>pub fn <a href='#method.satisfy' class='fnname'>satisfy</a><S>(&self, txin: &mut TxIn, satisfier: S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Error> <span class="where fmt-newline">where<br> S: Satisfier<Pk>, </span></code></h4><div class='docblock'><p>Attempts to produce a satisfying witness and scriptSig to spend an
+output controlled by the given descriptor; add the data to a given
+<code>TxIn</code> output.</p>
+</div><h4 id='method.max_satisfaction_weight' class="method"><code id='max_satisfaction_weight.v'>pub fn <a href='#method.max_satisfaction_weight' class='fnname'>max_satisfaction_weight</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock'><p>Computes an upper bound on the weight of a satisfying witness to the
+transaction. Assumes all signatures are 73 bytes, including push opcode
+and sighash suffix. Includes the weight of the VarInts encoding the
+scriptSig and witness stack length.</p>
+</div></div><h3 id='impl-2' class='impl'><code class='in-band'>impl <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><DescriptorPublicKey></code><a href='#impl-2' class='anchor'></a></h3><div class='impl-items'><h4 id='method.derive' class="method"><code id='derive.v'>pub fn <a href='#method.derive' class='fnname'>derive</a>(&self, path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a>ChildNumber<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><DescriptorPublicKey></code></h4><div class='docblock'><p>Derives all wildcard keys in the descriptor using the supplied <code>path</code></p>
+</div><h4 id='method.parse_secret' class="method"><code id='parse_secret.v'>pub fn <a href='#method.parse_secret' class='fnname'>parse_secret</a>(<br> s: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><DescriptorPublicKey>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><DescriptorPublicKey, DescriptorSecretKey, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.RandomState.html" title="struct std::collections::hash::map::RandomState">RandomState</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, Error></code></h4><h4 id='method.to_string_with_secret' class="method"><code id='to_string_with_secret.v'>pub fn <a href='#method.to_string_with_secret' class='fnname'>to_string_with_secret</a>(<br> &self, <br> key_map: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><DescriptorPublicKey, DescriptorSecretKey, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.RandomState.html" title="struct std::collections::hash::map::RandomState">RandomState</a>><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-Clone' class='anchor'></a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk></code></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Debug' class='anchor'></a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></code></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Display' class='anchor'></a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></code></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>, </span></code><a href='#impl-Eq' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-ExtractPolicy' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/descriptor/trait.ExtractPolicy.html" title="trait bdk::descriptor::ExtractPolicy">ExtractPolicy</a> for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><DescriptorPublicKey></code><a href='#impl-ExtractPolicy' class='anchor'></a><a class='srclink' href='../../src/bdk/descriptor/policy.rs.html#781-795' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.extract_policy' class="method hidden"><code id='extract_policy.v'>fn <a href='../../bdk/descriptor/trait.ExtractPolicy.html#tymethod.extract_policy' class='fnname'>extract_policy</a>(<br> &self, <br> signers: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a>>, <a class="enum" href="../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a>></code><a class='srclink' href='../../src/bdk/descriptor/policy.rs.html#782-794' title='goto source code'>[src]</a></h4></div><h3 id='impl-FromStr' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a> for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>,<br> <Pk as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>,<br> <<Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>, </span></code><a href='#impl-FromStr' class='anchor'></a></h3><div class='impl-items'><h4 id='associatedtype.Err' class="type"><code id='Err.t'>type <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err' class="type">Err</a> = Error</code></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
+</div><h4 id='method.from_str' class="method hidden"><code id='from_str.v'>fn <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str' class='fnname'>from_str</a>(s: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk>, Error></code></h4><div class='docblock hidden'><p>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str">Read more</a></p>
+</div></div><h3 id='impl-FromTree' class='impl'><code class='in-band'>impl<Pk> FromTree for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>,<br> <Pk as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>,<br> <<Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>, </span></code><a href='#impl-FromTree' class='anchor'></a></h3><div class='impl-items'><h4 id='method.from_tree' class="method"><code id='from_tree.v'>fn <a href='#method.from_tree' class='fnname'>from_tree</a>(top: &Tree) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk>, Error></code></h4><div class='docblock'><p>Parse an expression tree into a descriptor</p>
+</div></div><h3 id='impl-Liftable%3CPk%3E' class='impl'><code class='in-band'>impl<Pk> Liftable<Pk> for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Liftable%3CPk%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.lift' class="method hidden"><code id='lift.v'>fn <a href='#method.lift' class='fnname'>lift</a>(&self) -> Policy<Pk></code></h4><div class='docblock hidden'><p>Convert the object into an abstract policy</p>
+</div></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, </span></code><a href='#impl-Ord' class='anchor'></a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code id='cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
+</div><h4 id='method.max' class="method hidden"><code id='max.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#600-605' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
+</div><h4 id='method.min' class="method hidden"><code id='min.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#620-625' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
+</div><h4 id='method.clamp' class="method hidden"><code id='clamp.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#647-659' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
+</div></div><h3 id='impl-PartialEq%3CDescriptor%3CPk%3E%3E' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk>> for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><Pk>, </span></code><a href='#impl-PartialEq%3CDescriptor%3CPk%3E%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
+</div><h4 id='method.ne' class="method hidden"><code id='ne.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
+</div></div><h3 id='impl-PartialOrd%3CDescriptor%3CPk%3E%3E' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk>> for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><Pk>, </span></code><a href='#impl-PartialOrd%3CDescriptor%3CPk%3E%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code id='partial_cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
+</div><h4 id='method.lt' class="method hidden"><code id='lt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
+</div><h4 id='method.le' class="method hidden"><code id='le.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
+</div><h4 id='method.gt' class="method hidden"><code id='gt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
+</div><h4 id='method.ge' class="method hidden"><code id='ge.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
+</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-StructuralEq' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-StructuralPartialEq' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>, </span></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>, </span></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2219-2229' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2221-2228' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Legacy` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Legacy"><title>bdk::descriptor::Legacy - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Legacy</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Eq">Eq</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CLegacy%3E">PartialEq<Legacy></a><a href="#impl-PartialOrd%3CLegacy%3E">PartialOrd<Legacy></a><a href="#impl-ScriptContext">ScriptContext</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'Legacy', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span></span><span class='in-band'>Enum <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="enum" href=''>Legacy</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Legacy {}</pre></div><div class='docblock'><p>Legacy ScriptContext</p>
+</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a></code><a href='#impl-Clone' class='anchor'></a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a></code></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a></code><a href='#impl-Debug' class='anchor'></a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></code></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a></code><a href='#impl-Eq' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a></code><a href='#impl-Ord' class='anchor'></a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code id='cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
+</div><h4 id='method.max' class="method hidden"><code id='max.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#600-605' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
+</div><h4 id='method.min' class="method hidden"><code id='min.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#620-625' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
+</div><h4 id='method.clamp' class="method hidden"><code id='clamp.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#647-659' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
+</div></div><h3 id='impl-PartialEq%3CLegacy%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>> for <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a></code><a href='#impl-PartialEq%3CLegacy%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
+</div><h4 id='method.ne' class="method hidden"><code id='ne.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#216-218' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
+</div></div><h3 id='impl-PartialOrd%3CLegacy%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>> for <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a></code><a href='#impl-PartialOrd%3CLegacy%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code id='partial_cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
+</div><h4 id='method.lt' class="method hidden"><code id='lt.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#842-844' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
+</div><h4 id='method.le' class="method hidden"><code id='le.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#861-863' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
+</div><h4 id='method.gt' class="method hidden"><code id='gt.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#879-881' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
+</div><h4 id='method.ge' class="method hidden"><code id='ge.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#898-900' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
+</div></div><h3 id='impl-ScriptContext' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a> for <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a></code><a href='#impl-ScriptContext' class='anchor'></a></h3><div class='impl-items'><h4 id='method.check_frag_non_malleable' class="method hidden"><code id='check_frag_non_malleable.v'>fn <a href='../../bdk/descriptor/trait.ScriptContext.html#tymethod.check_frag_non_malleable' class='fnname'>check_frag_non_malleable</a><Pk, Ctx>(<br> frag: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><div class='docblock hidden'><p>Depending on ScriptContext, fragments can be malleable. For Example, under Legacy context, PkH is malleable because it is possible to estimate the cost of satisfaction because of compressed keys This is currently only used in compiler code for removing malleable compilations. This does NOT recursively check if the children of the fragment are valid or not. Since the compilation proceeds in a leaf to root fashion, a recursive check is unnecessary. <a href="../../bdk/descriptor/trait.ScriptContext.html#tymethod.check_frag_non_malleable">Read more</a></p>
+</div><h4 id='method.check_frag_validity' class="method hidden"><code id='check_frag_validity.v'>fn <a href='../../bdk/descriptor/trait.ScriptContext.html#tymethod.check_frag_validity' class='fnname'>check_frag_validity</a><Pk, Ctx>(<br> _frag: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><div class='docblock hidden'><p>Depending on script Context, some of the Terminals might not be valid. For example, in Segwit Context with MiniscriptKey as bitcoin::PublicKey uncompressed public keys are non-standard and thus invalid. Post Tapscript upgrade, this would have to consider other nodes. This does not recursively check <a href="../../bdk/descriptor/trait.ScriptContext.html#tymethod.check_frag_validity">Read more</a></p>
+</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a></code><a href='#impl-StructuralEq' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Segwitv0` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Segwitv0"><title>bdk::descriptor::Segwitv0 - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Segwitv0</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Eq">Eq</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CSegwitv0%3E">PartialEq<Segwitv0></a><a href="#impl-PartialOrd%3CSegwitv0%3E">PartialOrd<Segwitv0></a><a href="#impl-ScriptContext">ScriptContext</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'Segwitv0', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span></span><span class='in-band'>Enum <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="enum" href=''>Segwitv0</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Segwitv0 {}</pre></div><div class='docblock'><p>Segwitv0 ScriptContext</p>
+</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-Clone' class='anchor'></a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a></code></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-Debug' class='anchor'></a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></code></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-Eq' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-Ord' class='anchor'></a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code id='cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
+</div><h4 id='method.max' class="method hidden"><code id='max.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#600-605' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
+</div><h4 id='method.min' class="method hidden"><code id='min.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#620-625' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
+</div><h4 id='method.clamp' class="method hidden"><code id='clamp.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#647-659' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
+</div></div><h3 id='impl-PartialEq%3CSegwitv0%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>> for <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-PartialEq%3CSegwitv0%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
+</div><h4 id='method.ne' class="method hidden"><code id='ne.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#216-218' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
+</div></div><h3 id='impl-PartialOrd%3CSegwitv0%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>> for <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-PartialOrd%3CSegwitv0%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code id='partial_cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
+</div><h4 id='method.lt' class="method hidden"><code id='lt.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#842-844' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
+</div><h4 id='method.le' class="method hidden"><code id='le.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#861-863' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
+</div><h4 id='method.gt' class="method hidden"><code id='gt.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#879-881' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
+</div><h4 id='method.ge' class="method hidden"><code id='ge.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#898-900' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
+</div></div><h3 id='impl-ScriptContext' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a> for <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-ScriptContext' class='anchor'></a></h3><div class='impl-items'><h4 id='method.check_frag_non_malleable' class="method hidden"><code id='check_frag_non_malleable.v'>fn <a href='../../bdk/descriptor/trait.ScriptContext.html#tymethod.check_frag_non_malleable' class='fnname'>check_frag_non_malleable</a><Pk, Ctx>(<br> _frag: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><div class='docblock hidden'><p>Depending on ScriptContext, fragments can be malleable. For Example, under Legacy context, PkH is malleable because it is possible to estimate the cost of satisfaction because of compressed keys This is currently only used in compiler code for removing malleable compilations. This does NOT recursively check if the children of the fragment are valid or not. Since the compilation proceeds in a leaf to root fashion, a recursive check is unnecessary. <a href="../../bdk/descriptor/trait.ScriptContext.html#tymethod.check_frag_non_malleable">Read more</a></p>
+</div><h4 id='method.check_frag_validity' class="method hidden"><code id='check_frag_validity.v'>fn <a href='../../bdk/descriptor/trait.ScriptContext.html#tymethod.check_frag_validity' class='fnname'>check_frag_validity</a><Pk, Ctx>(<br> frag: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><div class='docblock hidden'><p>Depending on script Context, some of the Terminals might not be valid. For example, in Segwit Context with MiniscriptKey as bitcoin::PublicKey uncompressed public keys are non-standard and thus invalid. Post Tapscript upgrade, this would have to consider other nodes. This does not recursively check <a href="../../bdk/descriptor/trait.ScriptContext.html#tymethod.check_frag_validity">Read more</a></p>
+</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-StructuralEq' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Terminal` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Terminal"><title>bdk::descriptor::Terminal - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Terminal</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.After">After</a><a href="#variant.Alt">Alt</a><a href="#variant.AndB">AndB</a><a href="#variant.AndOr">AndOr</a><a href="#variant.AndV">AndV</a><a href="#variant.Check">Check</a><a href="#variant.DupIf">DupIf</a><a href="#variant.False">False</a><a href="#variant.Hash160">Hash160</a><a href="#variant.Hash256">Hash256</a><a href="#variant.Multi">Multi</a><a href="#variant.NonZero">NonZero</a><a href="#variant.Older">Older</a><a href="#variant.OrB">OrB</a><a href="#variant.OrC">OrC</a><a href="#variant.OrD">OrD</a><a href="#variant.OrI">OrI</a><a href="#variant.PkH">PkH</a><a href="#variant.PkK">PkK</a><a href="#variant.Ripemd160">Ripemd160</a><a href="#variant.Sha256">Sha256</a><a href="#variant.Swap">Swap</a><a href="#variant.Thresh">Thresh</a><a href="#variant.True">True</a><a href="#variant.Verify">Verify</a><a href="#variant.ZeroNotEqual">ZeroNotEqual</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.encode">encode</a><a href="#method.max_dissatisfaction_size">max_dissatisfaction_size</a><a href="#method.max_dissatisfaction_witness_elements">max_dissatisfaction_witness_elements</a><a href="#method.max_satisfaction_size">max_satisfaction_size</a><a href="#method.max_satisfaction_witness_elements">max_satisfaction_witness_elements</a><a href="#method.script_size">script_size</a><a href="#method.translate_pk">translate_pk</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-FromTree">FromTree</a><a href="#impl-Hash">Hash</a><a href="#impl-Liftable%3CPk%3E">Liftable<Pk></a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CTerminal%3CPk%2C%20Ctx%3E%3E">PartialEq<Terminal<Pk, Ctx>></a><a href="#impl-PartialOrd%3CTerminal%3CPk%2C%20Ctx%3E%3E">PartialOrd<Terminal<Pk, Ctx>></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'Terminal', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span></span><span class='in-band'>Enum <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="enum" href=''>Terminal</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Terminal<Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span> {
+ True,
+ False,
+ PkK(Pk),
+ PkH(<Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>),
+ After(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>),
+ Older(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>),
+ Sha256(Hash),
+ Hash256(Hash),
+ Ripemd160(Hash),
+ Hash160(Hash),
+ Alt(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
+ Swap(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
+ Check(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
+ DupIf(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
+ Verify(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
+ NonZero(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
+ ZeroNotEqual(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
+ AndV(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
+ AndB(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
+ AndOr(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
+ OrB(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
+ OrD(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
+ OrC(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
+ OrI(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
+ Thresh(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>>),
+ Multi(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Pk>),
+}</pre></div><div class='docblock'><p>All AST elements</p>
+</div><h2 id='variants' class='variants small-section-header'>
+ Variants<a href='#variants' class='anchor'></a></h2>
+<div id="variant.True" class="variant small-section-header"><a href="#variant.True" class="anchor field"></a><code id='True.v'>True</code></div><div class='docblock'><p><code>1</code></p>
+</div><div id="variant.False" class="variant small-section-header"><a href="#variant.False" class="anchor field"></a><code id='False.v'>False</code></div><div class='docblock'><p><code>0</code></p>
+</div><div id="variant.PkK" class="variant small-section-header"><a href="#variant.PkK" class="anchor field"></a><code id='PkK.v'>PkK(Pk)</code></div><div class='docblock'><p><code><key></code></p>
+</div><div id="variant.PkH" class="variant small-section-header"><a href="#variant.PkH" class="anchor field"></a><code id='PkH.v'>PkH(<Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>)</code></div><div class='docblock'><p><code>DUP HASH160 <keyhash> EQUALVERIFY</code></p>
+</div><div id="variant.After" class="variant small-section-header"><a href="#variant.After" class="anchor field"></a><code id='After.v'>After(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>)</code></div><div class='docblock'><p><code>n CHECKLOCKTIMEVERIFY</code></p>
+</div><div id="variant.Older" class="variant small-section-header"><a href="#variant.Older" class="anchor field"></a><code id='Older.v'>Older(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>)</code></div><div class='docblock'><p><code>n CHECKSEQUENCEVERIFY</code></p>
+</div><div id="variant.Sha256" class="variant small-section-header"><a href="#variant.Sha256" class="anchor field"></a><code id='Sha256.v'>Sha256(Hash)</code></div><div class='docblock'><p><code>SIZE 32 EQUALVERIFY SHA256 <hash> EQUAL</code></p>
+</div><div id="variant.Hash256" class="variant small-section-header"><a href="#variant.Hash256" class="anchor field"></a><code id='Hash256.v'>Hash256(Hash)</code></div><div class='docblock'><p><code>SIZE 32 EQUALVERIFY HASH256 <hash> EQUAL</code></p>
+</div><div id="variant.Ripemd160" class="variant small-section-header"><a href="#variant.Ripemd160" class="anchor field"></a><code id='Ripemd160.v'>Ripemd160(Hash)</code></div><div class='docblock'><p><code>SIZE 32 EQUALVERIFY RIPEMD160 <hash> EQUAL</code></p>
+</div><div id="variant.Hash160" class="variant small-section-header"><a href="#variant.Hash160" class="anchor field"></a><code id='Hash160.v'>Hash160(Hash)</code></div><div class='docblock'><p><code>SIZE 32 EQUALVERIFY HASH160 <hash> EQUAL</code></p>
+</div><div id="variant.Alt" class="variant small-section-header"><a href="#variant.Alt" class="anchor field"></a><code id='Alt.v'>Alt(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p><code>TOALTSTACK [E] FROMALTSTACK</code></p>
+</div><div id="variant.Swap" class="variant small-section-header"><a href="#variant.Swap" class="anchor field"></a><code id='Swap.v'>Swap(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p><code>SWAP [E1]</code></p>
+</div><div id="variant.Check" class="variant small-section-header"><a href="#variant.Check" class="anchor field"></a><code id='Check.v'>Check(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p><code>[Kt]/[Ke] CHECKSIG</code></p>
+</div><div id="variant.DupIf" class="variant small-section-header"><a href="#variant.DupIf" class="anchor field"></a><code id='DupIf.v'>DupIf(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p><code>DUP IF [V] ENDIF</code></p>
+</div><div id="variant.Verify" class="variant small-section-header"><a href="#variant.Verify" class="anchor field"></a><code id='Verify.v'>Verify(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>[T] VERIFY</p>
+</div><div id="variant.NonZero" class="variant small-section-header"><a href="#variant.NonZero" class="anchor field"></a><code id='NonZero.v'>NonZero(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>SIZE 0NOTEQUAL IF [Fn] ENDIF</p>
+</div><div id="variant.ZeroNotEqual" class="variant small-section-header"><a href="#variant.ZeroNotEqual" class="anchor field"></a><code id='ZeroNotEqual.v'>ZeroNotEqual(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>[X] 0NOTEQUAL</p>
+</div><div id="variant.AndV" class="variant small-section-header"><a href="#variant.AndV" class="anchor field"></a><code id='AndV.v'>AndV(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>[V] [T]/[V]/[F]/[Kt]</p>
+</div><div id="variant.AndB" class="variant small-section-header"><a href="#variant.AndB" class="anchor field"></a><code id='AndB.v'>AndB(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>[E] [W] BOOLAND</p>
+</div><div id="variant.AndOr" class="variant small-section-header"><a href="#variant.AndOr" class="anchor field"></a><code id='AndOr.v'>AndOr(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>[various] NOTIF [various] ELSE [various] ENDIF</p>
+</div><div id="variant.OrB" class="variant small-section-header"><a href="#variant.OrB" class="anchor field"></a><code id='OrB.v'>OrB(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>[E] [W] BOOLOR</p>
+</div><div id="variant.OrD" class="variant small-section-header"><a href="#variant.OrD" class="anchor field"></a><code id='OrD.v'>OrD(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>[E] IFDUP NOTIF [T]/[E] ENDIF</p>
+</div><div id="variant.OrC" class="variant small-section-header"><a href="#variant.OrC" class="anchor field"></a><code id='OrC.v'>OrC(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>[E] NOTIF [V] ENDIF</p>
+</div><div id="variant.OrI" class="variant small-section-header"><a href="#variant.OrI" class="anchor field"></a><code id='OrI.v'>OrI(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>IF [various] ELSE [various] ENDIF</p>
+</div><div id="variant.Thresh" class="variant small-section-header"><a href="#variant.Thresh" class="anchor field"></a><code id='Thresh.v'>Thresh(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>>)</code></div><div class='docblock'><p>[E] ([W] ADD)* k EQUAL</p>
+</div><div id="variant.Multi" class="variant small-section-header"><a href="#variant.Multi" class="anchor field"></a><code id='Multi.v'>Multi(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Pk>)</code></div><div class='docblock'><p>k (<key>)* n CHECKMULTISIG</p>
+</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl' class='anchor'></a></h3><div class='impl-items'><h4 id='method.translate_pk' class="method"><code id='translate_pk.v'>pub fn <a href='#method.translate_pk' class='fnname'>translate_pk</a><FPk, FPkh, Q, Error>(<br> &self, <br> translatefpk: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>FPk, <br> translatefpkh: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>FPkh<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Q, Ctx>, Error> <span class="where fmt-newline">where<br> FPk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Pk) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Q, Error>,<br> FPkh: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&<Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Q as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>, Error>,<br> Q: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><div class='docblock'><p>Convert an AST element with one public key type to one of another
+public key type .This will panic while converting to
+Segwit Miniscript using uncompressed public keys</p>
+</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a>, </span></code><a href='#impl-1' class='anchor'></a></h3><div class='impl-items'><h4 id='method.encode' class="method"><code id='encode.v'>pub fn <a href='#method.encode' class='fnname'>encode</a>(&self, builder: Builder) -> Builder</code></h4><div class='docblock'><p>Encode the element as a fragment of Bitcoin Script. The inverse
+function, from Script to an AST element, is implemented in the
+<code>parse</code> module.</p>
+</div><h4 id='method.script_size' class="method"><code id='script_size.v'>pub fn <a href='#method.script_size' class='fnname'>script_size</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock'><p>Size, in bytes of the script-pubkey. If this Miniscript is used outside
+of segwit (e.g. in a bare or P2SH descriptor), this quantity should be
+multiplied by 4 to compute the weight.</p>
+<p>In general, it is not recommended to use this function directly, but
+to instead call the corresponding function on a <code>Descriptor</code>, which
+will handle the segwit/non-segwit technicalities for you.</p>
+</div><h4 id='method.max_dissatisfaction_witness_elements' class="method"><code id='max_dissatisfaction_witness_elements.v'>pub fn <a href='#method.max_dissatisfaction_witness_elements' class='fnname'>max_dissatisfaction_witness_elements</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code></h4><div class='docblock'><p>Maximum number of witness elements used to dissatisfy the Miniscript
+fragment. Used to estimate the weight of the <code>VarInt</code> that specifies
+this number in a serialized transaction.</p>
+<p>Will panic if the fragment is not an E, W or Ke.</p>
+</div><h4 id='method.max_dissatisfaction_size' class="method"><code id='max_dissatisfaction_size.v'>pub fn <a href='#method.max_dissatisfaction_size' class='fnname'>max_dissatisfaction_size</a>(&self, one_cost: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code></h4><div class='docblock'><p>Maximum dissatisfaction cost, in bytes, of a Miniscript fragment,
+if it is possible to compute this. This function should probably
+not ever be used directly. It is called from <code>max_satisfaction_size</code>.</p>
+<p>Will panic if the fragment is not E, W or Ke</p>
+</div><h4 id='method.max_satisfaction_witness_elements' class="method"><code id='max_satisfaction_witness_elements.v'>pub fn <a href='#method.max_satisfaction_witness_elements' class='fnname'>max_satisfaction_witness_elements</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock'><p>Maximum number of witness elements used to satisfy the Miniscript
+fragment. Used to estimate the weight of the <code>VarInt</code> that specifies
+this number in a serialized transaction.</p>
+<p>This number does not include the witness script itself, so 1 needs
+to be added to the final result.</p>
+</div><h4 id='method.max_satisfaction_size' class="method"><code id='max_satisfaction_size.v'>pub fn <a href='#method.max_satisfaction_size' class='fnname'>max_satisfaction_size</a>(&self, one_cost: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock'><p>Maximum size, in bytes, of a satisfying witness. For Segwit outputs
+<code>one_cost</code> should be set to 2, since the number <code>1</code> requires two
+bytes to encode. For non-segwit outputs <code>one_cost</code> should be set to
+1, since <code>OP_1</code> is available in scriptSigs.</p>
+<p>In general, it is not recommended to use this function directly, but
+to instead call the corresponding function on a <code>Descriptor</code>, which
+will handle the segwit/non-segwit technicalities for you.</p>
+<p>All signatures are assumed to be 73 bytes in size, including the
+length prefix (segwit) or push opcode (pre-segwit) and sighash
+postfix.</p>
+<p>This function may panic on misformed <code>Miniscript</code> objects which do not
+correspond to semantically sane Scripts. (Such scripts should be rejected
+at parse time. Any exceptions are bugs.)</p>
+</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-Clone' class='anchor'></a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx></code></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Debug' class='anchor'></a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></code></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Display' class='anchor'></a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></code></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>, </span></code><a href='#impl-Eq' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-FromTree' class='impl'><code class='in-band'>impl<Pk, Ctx> FromTree for <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>,<br> <Pk as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>,<br> <<Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>, </span></code><a href='#impl-FromTree' class='anchor'></a></h3><div class='impl-items'><h4 id='method.from_tree' class="method hidden"><code id='from_tree.v'>fn <a href='#method.from_tree' class='fnname'>from_tree</a>(top: &Tree) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx>, Error></code></h4></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>, </span></code><a href='#impl-Hash' class='anchor'></a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code id='hash.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H) <span class="where fmt-newline">where<br> __H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
+</div><h4 id='method.hash_slice' class="method hidden"><code id='hash_slice.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#192-199' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
+</div></div><h3 id='impl-Liftable%3CPk%3E' class='impl'><code class='in-band'>impl<Pk, Ctx> Liftable<Pk> for <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Liftable%3CPk%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.lift' class="method hidden"><code id='lift.v'>fn <a href='#method.lift' class='fnname'>lift</a>(&self) -> Policy<Pk></code></h4><div class='docblock hidden'><p>Convert the object into an abstract policy</p>
+</div></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, </span></code><a href='#impl-Ord' class='anchor'></a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code id='cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
+</div><h4 id='method.max' class="method hidden"><code id='max.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#600-605' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
+</div><h4 id='method.min' class="method hidden"><code id='min.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#620-625' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
+</div><h4 id='method.clamp' class="method hidden"><code id='clamp.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#647-659' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
+</div></div><h3 id='impl-PartialEq%3CTerminal%3CPk%2C%20Ctx%3E%3E' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx>> for <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><Ctx>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><Pk>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>>, </span></code><a href='#impl-PartialEq%3CTerminal%3CPk%2C%20Ctx%3E%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
+</div><h4 id='method.ne' class="method hidden"><code id='ne.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
+</div></div><h3 id='impl-PartialOrd%3CTerminal%3CPk%2C%20Ctx%3E%3E' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx>> for <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><Ctx>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><Pk>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>>, </span></code><a href='#impl-PartialOrd%3CTerminal%3CPk%2C%20Ctx%3E%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code id='partial_cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
+</div><h4 id='method.lt' class="method hidden"><code id='lt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
+</div><h4 id='method.le' class="method hidden"><code id='le.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
+</div><h4 id='method.gt' class="method hidden"><code id='gt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
+</div><h4 id='method.ge' class="method hidden"><code id='ge.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
+</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-StructuralEq' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-StructuralPartialEq' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>, </span></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>, </span></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2219-2229' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2221-2228' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Error` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Error"><title>bdk::descriptor::error::Error - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Error</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.BIP32">BIP32</a><a href="#variant.Base58">Base58</a><a href="#variant.CantDeriveWithMiniscript">CantDeriveWithMiniscript</a><a href="#variant.HardenedDerivationOnXpub">HardenedDerivationOnXpub</a><a href="#variant.Hex">Hex</a><a href="#variant.InputIndexDoesntExist">InputIndexDoesntExist</a><a href="#variant.InternalError">InternalError</a><a href="#variant.InvalidDescriptorCharacter">InvalidDescriptorCharacter</a><a href="#variant.InvalidPrefix">InvalidPrefix</a><a href="#variant.KeyParsingError">KeyParsingError</a><a href="#variant.MalformedInput">MalformedInput</a><a href="#variant.Miniscript">Miniscript</a><a href="#variant.MissingDetails">MissingDetails</a><a href="#variant.MissingPublicKey">MissingPublicKey</a><a href="#variant.PK">PK</a><a href="#variant.Policy">Policy</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Error">Error</a><a href="#impl-From%3CError%3E">From<Error></a><a href="#impl-From%3CPolicyError%3E">From<PolicyError></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>error</a></p><script>window.sidebarCurrent = {name: 'Error', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/descriptor/error.rs.html#29-51' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>error</a>::<wbr><a class="enum" href=''>Error</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Error {
+ InternalError,
+ InvalidPrefix(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>),
+ HardenedDerivationOnXpub,
+ MalformedInput,
+ KeyParsingError(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
+ Policy(<a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a>),
+ InputIndexDoesntExist,
+ MissingPublicKey,
+ MissingDetails,
+ InvalidDescriptorCharacter(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a>),
+ CantDeriveWithMiniscript,
+ BIP32(Error),
+ Base58(Error),
+ PK(Error),
+ Miniscript(Error),
+ Hex(Error),
+}</pre></div><div class='docblock'><p>Errors related to the parsing and usage of descriptors</p>
+</div><h2 id='variants' class='variants small-section-header'>
+ Variants<a href='#variants' class='anchor'></a></h2>
+<div id="variant.InternalError" class="variant small-section-header"><a href="#variant.InternalError" class="anchor field"></a><code id='InternalError.v'>InternalError</code></div><div id="variant.InvalidPrefix" class="variant small-section-header"><a href="#variant.InvalidPrefix" class="anchor field"></a><code id='InvalidPrefix.v'>InvalidPrefix(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>)</code></div><div id="variant.HardenedDerivationOnXpub" class="variant small-section-header"><a href="#variant.HardenedDerivationOnXpub" class="anchor field"></a><code id='HardenedDerivationOnXpub.v'>HardenedDerivationOnXpub</code></div><div id="variant.MalformedInput" class="variant small-section-header"><a href="#variant.MalformedInput" class="anchor field"></a><code id='MalformedInput.v'>MalformedInput</code></div><div id="variant.KeyParsingError" class="variant small-section-header"><a href="#variant.KeyParsingError" class="anchor field"></a><code id='KeyParsingError.v'>KeyParsingError(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></div><div id="variant.Policy" class="variant small-section-header"><a href="#variant.Policy" class="anchor field"></a><code id='Policy.v'>Policy(<a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a>)</code></div><div id="variant.InputIndexDoesntExist" class="variant small-section-header"><a href="#variant.InputIndexDoesntExist" class="anchor field"></a><code id='InputIndexDoesntExist.v'>InputIndexDoesntExist</code></div><div id="variant.MissingPublicKey" class="variant small-section-header"><a href="#variant.MissingPublicKey" class="anchor field"></a><code id='MissingPublicKey.v'>MissingPublicKey</code></div><div id="variant.MissingDetails" class="variant small-section-header"><a href="#variant.MissingDetails" class="anchor field"></a><code id='MissingDetails.v'>MissingDetails</code></div><div id="variant.InvalidDescriptorCharacter" class="variant small-section-header"><a href="#variant.InvalidDescriptorCharacter" class="anchor field"></a><code id='InvalidDescriptorCharacter.v'>InvalidDescriptorCharacter(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a>)</code></div><div id="variant.CantDeriveWithMiniscript" class="variant small-section-header"><a href="#variant.CantDeriveWithMiniscript" class="anchor field"></a><code id='CantDeriveWithMiniscript.v'>CantDeriveWithMiniscript</code></div><div id="variant.BIP32" class="variant small-section-header"><a href="#variant.BIP32" class="anchor field"></a><code id='BIP32.v'>BIP32(Error)</code></div><div id="variant.Base58" class="variant small-section-header"><a href="#variant.Base58" class="anchor field"></a><code id='Base58.v'>Base58(Error)</code></div><div id="variant.PK" class="variant small-section-header"><a href="#variant.PK" class="anchor field"></a><code id='PK.v'>PK(Error)</code></div><div id="variant.Miniscript" class="variant small-section-header"><a href="#variant.Miniscript" class="anchor field"></a><code id='Miniscript.v'>Miniscript(Error)</code></div><div id="variant.Hex" class="variant small-section-header"><a href="#variant.Hex" class="anchor field"></a><code id='Hex.v'>Hex(Error)</code></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/error.rs.html#28' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/descriptor/error.rs.html#28' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/error.rs.html#53-57' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/descriptor/error.rs.html#54-56' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Error' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a></code><a href='#impl-Error' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/error.rs.html#59' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.source' class="method hidden"><code id='source.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source' class='fnname'>source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><span class='since' title='Stable since Rust version 1.30.0'>1.30.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#100-102' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
+</div><h4 id='method.backtrace' class="method hidden"><code id='backtrace.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace' class='fnname'>backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#128-130' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>backtrace</code>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
+</div><h4 id='method.description' class="method hidden"><code id='description.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description' class='fnname'>description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#140-142' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
+</div></div><div class='docblock hidden'><p><code>if let Err(e) = "xc".parse::<u32>() { // Print </code>e<code> itself, no need for description(). eprintln!("Error: {}", e); }</code> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></p>
+</div><h4 id='method.cause' class="method hidden"><code id='cause.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#150-152' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
+</div></div></div><h3 id='impl-From%3CError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a>> for <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CError%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a>) -> Self</code><a class='srclink' href='../../../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-1' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a></code><a href='#impl-From%3CError%3E-1' class='anchor'></a><a class='srclink' href='../../../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../../../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-2' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a></code><a href='#impl-From%3CError%3E-2' class='anchor'></a><a class='srclink' href='../../../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code id='from.v-2'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../../../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-3' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a></code><a href='#impl-From%3CError%3E-3' class='anchor'></a><a class='srclink' href='../../../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-3' class="method hidden"><code id='from.v-3'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../../../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-4' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a></code><a href='#impl-From%3CError%3E-4' class='anchor'></a><a class='srclink' href='../../../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-4' class="method hidden"><code id='from.v-4'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../../../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-5' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a></code><a href='#impl-From%3CError%3E-5' class='anchor'></a><a class='srclink' href='../../../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-5' class="method hidden"><code id='from.v-5'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../../../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CPolicyError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a>> for <a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a></code><a href='#impl-From%3CPolicyError%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-6' class="method hidden"><code id='from.v-6'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a>) -> Self</code><a class='srclink' href='../../../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-7' class="method hidden"><code id='from.v-7'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2219-2229' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2221-2228' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `error` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, error"><title>bdk::descriptor::error - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module error</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#enums">Enums</a></li></ul></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'error', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/descriptor/error.rs.html#25-66' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a class="mod" href=''>error</a></span></h1><div class='docblock'><p>Descriptor errors</p>
+</div><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
+<table><tr class='module-item'><td><a class="enum" href="enum.Error.html" title='bdk::descriptor::error::Error enum'>Error</a></td><td class='docblock-short'><p>Errors related to the parsing and usage of descriptors</p>
+</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"enum":[["Error","Errors related to the parsing and usage of descriptors"]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `descriptor` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, descriptor"><title>bdk::descriptor - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module descriptor</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'><a href='../index.html'>bdk</a></p><script>window.sidebarCurrent = {name: 'descriptor', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/descriptor/mod.rs.html#25-440' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>bdk</a>::<wbr><a class="mod" href=''>descriptor</a></span></h1><div class='docblock'><p>Descriptors</p>
+<p>This module contains generic utilities to work with descriptors, plus some re-exported types
+from [<code>miniscript</code>].</p>
+</div><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
+<table><tr><td><code>pub use self::checksum::<a class="fn" href="../../bdk/descriptor/checksum/fn.get_checksum.html" title="fn bdk::descriptor::checksum::get_checksum">get_checksum</a>;</code></td></tr><tr><td><code>pub use self::policy::<a class="struct" href="../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a>;</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
+<table><tr class='module-item'><td><a class="mod" href="checksum/index.html" title='bdk::descriptor::checksum mod'>checksum</a></td><td class='docblock-short'><p>Descriptor checksum</p>
+</td></tr><tr class='module-item'><td><a class="mod" href="error/index.html" title='bdk::descriptor::error mod'>error</a></td><td class='docblock-short'><p>Descriptor errors</p>
+</td></tr><tr class='module-item'><td><a class="mod" href="policy/index.html" title='bdk::descriptor::policy mod'>policy</a></td><td class='docblock-short'><p>Descriptor policy</p>
+</td></tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
+<table><tr class='module-item'><td><a class="struct" href="struct.Miniscript.html" title='bdk::descriptor::Miniscript struct'>Miniscript</a></td><td class='docblock-short'><p>Top-level script AST type</p>
+</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
+<table><tr class='module-item'><td><a class="enum" href="enum.Descriptor.html" title='bdk::descriptor::Descriptor enum'>Descriptor</a></td><td class='docblock-short'><p>Script descriptor</p>
+</td></tr><tr class='module-item'><td><a class="enum" href="enum.Legacy.html" title='bdk::descriptor::Legacy enum'>Legacy</a></td><td class='docblock-short'><p>Legacy ScriptContext</p>
+</td></tr><tr class='module-item'><td><a class="enum" href="enum.Segwitv0.html" title='bdk::descriptor::Segwitv0 enum'>Segwitv0</a></td><td class='docblock-short'><p>Segwitv0 ScriptContext</p>
+</td></tr><tr class='module-item'><td><a class="enum" href="enum.Terminal.html" title='bdk::descriptor::Terminal enum'>Terminal</a></td><td class='docblock-short'><p>All AST elements</p>
+</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
+<table><tr class='module-item'><td><a class="trait" href="trait.ExtractPolicy.html" title='bdk::descriptor::ExtractPolicy trait'>ExtractPolicy</a></td><td class='docblock-short'><p>Trait implemented on [<code>Descriptor</code>]s to add a method to extract the spending [<code>policy</code>]</p>
+</td></tr><tr class='module-item'><td><a class="trait" href="trait.MiniscriptKey.html" title='bdk::descriptor::MiniscriptKey trait'>MiniscriptKey</a></td><td class='docblock-short'><p>Public key trait which can be converted to Hash type</p>
+</td></tr><tr class='module-item'><td><a class="trait" href="trait.ScriptContext.html" title='bdk::descriptor::ScriptContext trait'>ScriptContext</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="trait" href="trait.ToPublicKey.html" title='bdk::descriptor::ToPublicKey trait'>ToPublicKey</a></td><td class='docblock-short'><p>Trait describing public key types which can be converted to bitcoin pubkeys</p>
+</td></tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
+<table><tr class='module-item'><td><a class="type" href="type.ExtendedDescriptor.html" title='bdk::descriptor::ExtendedDescriptor type'>ExtendedDescriptor</a></td><td class='docblock-short'><p>Alias for a [<code>Descriptor</code>] that can contain extended keys using [<code>DescriptorPublicKey</code>]</p>
+</td></tr><tr class='module-item'><td><a class="type" href="type.HDKeyPaths.html" title='bdk::descriptor::HDKeyPaths type'>HDKeyPaths</a></td><td class='docblock-short'><p>Alias for the type of maps that represent derivation paths in a <a href="bitcoin::util::psbt::Input"><code>psbt::Input</code></a> or
+<a href="bitcoin::util::psbt::Output"><code>psbt::Output</code></a></p>
+</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `PolicyError` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, PolicyError"><title>bdk::descriptor::policy::PolicyError - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum PolicyError</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.AddOnLeaf">AddOnLeaf</a><a href="#variant.AddOnPartialComplete">AddOnPartialComplete</a><a href="#variant.IncompatibleConditions">IncompatibleConditions</a><a href="#variant.IndexOutOfRange">IndexOutOfRange</a><a href="#variant.MixedTimelockUnits">MixedTimelockUnits</a><a href="#variant.NotEnoughItemsSelected">NotEnoughItemsSelected</a><a href="#variant.TooManyItemsSelected">TooManyItemsSelected</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Error">Error</a><a href="#impl-From%3CPolicyError%3E">From<PolicyError></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a></p><script>window.sidebarCurrent = {name: 'PolicyError', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#461-469' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a>::<wbr><a class="enum" href=''>PolicyError</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum PolicyError {
+ NotEnoughItemsSelected(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
+ TooManyItemsSelected(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
+ IndexOutOfRange(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>),
+ AddOnLeaf,
+ AddOnPartialComplete,
+ MixedTimelockUnits,
+ IncompatibleConditions,
+}</pre></div><div class='docblock'><p>Errors that can happen while extracting and manipulating policies</p>
+</div><h2 id='variants' class='variants small-section-header'>
+ Variants<a href='#variants' class='anchor'></a></h2>
+<div id="variant.NotEnoughItemsSelected" class="variant small-section-header"><a href="#variant.NotEnoughItemsSelected" class="anchor field"></a><code id='NotEnoughItemsSelected.v'>NotEnoughItemsSelected(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></div><div id="variant.TooManyItemsSelected" class="variant small-section-header"><a href="#variant.TooManyItemsSelected" class="anchor field"></a><code id='TooManyItemsSelected.v'>TooManyItemsSelected(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></div><div id="variant.IndexOutOfRange" class="variant small-section-header"><a href="#variant.IndexOutOfRange" class="anchor field"></a><code id='IndexOutOfRange.v'>IndexOutOfRange(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></div><div id="variant.AddOnLeaf" class="variant small-section-header"><a href="#variant.AddOnLeaf" class="anchor field"></a><code id='AddOnLeaf.v'>AddOnLeaf</code></div><div id="variant.AddOnPartialComplete" class="variant small-section-header"><a href="#variant.AddOnPartialComplete" class="anchor field"></a><code id='AddOnPartialComplete.v'>AddOnPartialComplete</code></div><div id="variant.MixedTimelockUnits" class="variant small-section-header"><a href="#variant.MixedTimelockUnits" class="anchor field"></a><code id='MixedTimelockUnits.v'>MixedTimelockUnits</code></div><div id="variant.IncompatibleConditions" class="variant small-section-header"><a href="#variant.IncompatibleConditions" class="anchor field"></a><code id='IncompatibleConditions.v'>IncompatibleConditions</code></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#460' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#460' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#471-475' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#472-474' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Error' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a></code><a href='#impl-Error' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#477' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.source' class="method hidden"><code id='source.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source' class='fnname'>source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><span class='since' title='Stable since Rust version 1.30.0'>1.30.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#100-102' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
+</div><h4 id='method.backtrace' class="method hidden"><code id='backtrace.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace' class='fnname'>backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#128-130' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>backtrace</code>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
+</div><h4 id='method.description' class="method hidden"><code id='description.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description' class='fnname'>description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#140-142' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
+</div></div><div class='docblock hidden'><p><code>if let Err(e) = "xc".parse::<u32>() { // Print </code>e<code> itself, no need for description(). eprintln!("Error: {}", e); }</code> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></p>
+</div><h4 id='method.cause' class="method hidden"><code id='cause.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#150-152' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
+</div></div></div><h3 id='impl-From%3CPolicyError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a>> for <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CPolicyError%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a>) -> Self</code><a class='srclink' href='../../../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CPolicyError%3E-1' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a>> for <a class="enum" href="../../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a></code><a href='#impl-From%3CPolicyError%3E-1' class='anchor'></a><a class='srclink' href='../../../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a>) -> Self</code><a class='srclink' href='../../../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code id='from.v-2'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2219-2229' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2221-2228' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Satisfaction` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Satisfaction"><title>bdk::descriptor::policy::Satisfaction - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Satisfaction</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Complete">Complete</a><a href="#variant.None">None</a><a href="#variant.Partial">Partial</a><a href="#variant.PartialComplete">PartialComplete</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.is_leaf">is_leaf</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-From%3Cbool%3E">From<bool></a><a href="#impl-Serialize">Serialize</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a></p><script>window.sidebarCurrent = {name: 'Satisfaction', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#237-273' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a>::<wbr><a class="enum" href=''>Satisfaction</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Satisfaction {
+ Partial {
+ n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
+ m: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
+ items: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>,
+ conditions: <a class="type" href="../../../bdk/descriptor/policy/type.ConditionMap.html" title="type bdk::descriptor::policy::ConditionMap">ConditionMap</a>,
+ },
+ PartialComplete {
+ n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
+ m: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
+ items: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>,
+ conditions: <a class="type" href="../../../bdk/descriptor/policy/type.FoldedConditionMap.html" title="type bdk::descriptor::policy::FoldedConditionMap">FoldedConditionMap</a>,
+ },
+ Complete {
+ condition: <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a>,
+ },
+ None,
+}</pre></div><div class='docblock'><p>Represent if and how much a policy item is satisfied by the wallet's descriptor</p>
+</div><h2 id='variants' class='variants small-section-header'>
+ Variants<a href='#variants' class='anchor'></a></h2>
+<div id="variant.Partial" class="variant small-section-header"><a href="#variant.Partial" class="anchor field"></a><code id='Partial.v'>Partial</code></div><div class='docblock'><p>Only a partial satisfaction of some kind of threshold policy</p>
+</div><div class='autohide sub-variant' id='variant.Partial.fields'><h3>Fields of <b>Partial</b></h3><div><span id="variant.Partial.field.n" class="variant small-section-header"><a href="#variant.Partial.field.n" class="anchor field"></a><code id='Partial.v.n.v'>n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span><div class='docblock'><p>Total number of items</p>
+</div><span id="variant.Partial.field.m" class="variant small-section-header"><a href="#variant.Partial.field.m" class="anchor field"></a><code id='Partial.v.m.v'>m: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span><div class='docblock'><p>Threshold</p>
+</div><span id="variant.Partial.field.items" class="variant small-section-header"><a href="#variant.Partial.field.items" class="anchor field"></a><code id='Partial.v.items.v'>items: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code></span><div class='docblock'><p>The items that can be satisfied by the descriptor</p>
+</div><span id="variant.Partial.field.conditions" class="variant small-section-header"><a href="#variant.Partial.field.conditions" class="anchor field"></a><code id='Partial.v.conditions.v'>conditions: <a class="type" href="../../../bdk/descriptor/policy/type.ConditionMap.html" title="type bdk::descriptor::policy::ConditionMap">ConditionMap</a></code></span><div class='docblock'><p>Extra conditions that also need to be satisfied</p>
+</div></div></div><div id="variant.PartialComplete" class="variant small-section-header"><a href="#variant.PartialComplete" class="anchor field"></a><code id='PartialComplete.v'>PartialComplete</code></div><div class='docblock'><p>Can reach the threshold of some kind of threshold policy</p>
+</div><div class='autohide sub-variant' id='variant.PartialComplete.fields'><h3>Fields of <b>PartialComplete</b></h3><div><span id="variant.PartialComplete.field.n" class="variant small-section-header"><a href="#variant.PartialComplete.field.n" class="anchor field"></a><code id='PartialComplete.v.n.v'>n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span><div class='docblock'><p>Total number of items</p>
+</div><span id="variant.PartialComplete.field.m" class="variant small-section-header"><a href="#variant.PartialComplete.field.m" class="anchor field"></a><code id='PartialComplete.v.m.v'>m: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span><div class='docblock'><p>Threshold</p>
+</div><span id="variant.PartialComplete.field.items" class="variant small-section-header"><a href="#variant.PartialComplete.field.items" class="anchor field"></a><code id='PartialComplete.v.items.v'>items: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code></span><div class='docblock'><p>The items that can be satisfied by the descriptor</p>
+</div><span id="variant.PartialComplete.field.conditions" class="variant small-section-header"><a href="#variant.PartialComplete.field.conditions" class="anchor field"></a><code id='PartialComplete.v.conditions.v'>conditions: <a class="type" href="../../../bdk/descriptor/policy/type.FoldedConditionMap.html" title="type bdk::descriptor::policy::FoldedConditionMap">FoldedConditionMap</a></code></span><div class='docblock'><p>Extra conditions that also need to be satisfied</p>
+</div></div></div><div id="variant.Complete" class="variant small-section-header"><a href="#variant.Complete" class="anchor field"></a><code id='Complete.v'>Complete</code></div><div class='docblock'><p>Can satisfy the policy item</p>
+</div><div class='autohide sub-variant' id='variant.Complete.fields'><h3>Fields of <b>Complete</b></h3><div><span id="variant.Complete.field.condition" class="variant small-section-header"><a href="#variant.Complete.field.condition" class="anchor field"></a><code id='Complete.v.condition.v'>condition: <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code></span><div class='docblock'><p>Extra conditions that also need to be satisfied</p>
+</div></div></div><div id="variant.None" class="variant small-section-header"><a href="#variant.None" class="anchor field"></a><code id='None.v'>None</code></div><div class='docblock'><p>Cannot satisfy or contribute to the policy item</p>
+</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="enum" href="../../../bdk/descriptor/policy/enum.Satisfaction.html" title="enum bdk::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#275-389' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.is_leaf' class="method"><code id='is_leaf.v'>pub fn <a href='#method.is_leaf' class='fnname'>is_leaf</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#276-281' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.Satisfaction.html" title="enum bdk::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#235' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../bdk/descriptor/policy/enum.Satisfaction.html" title="enum bdk::descriptor::policy::Satisfaction">Satisfaction</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#235' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.Satisfaction.html" title="enum bdk::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#235' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#235' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-From%3Cbool%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>> for <a class="enum" href="../../../bdk/descriptor/policy/enum.Satisfaction.html" title="enum bdk::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-From%3Cbool%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#391-401' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> Self</code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#392-400' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.Satisfaction.html" title="enum bdk::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#235' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code id='serialize.v'>fn <a href='https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#235' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.Satisfaction.html" title="enum bdk::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.Satisfaction.html" title="enum bdk::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.Satisfaction.html" title="enum bdk::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.Satisfaction.html" title="enum bdk::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.Satisfaction.html" title="enum bdk::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `SatisfiableItem` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, SatisfiableItem"><title>bdk::descriptor::policy::SatisfiableItem - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum SatisfiableItem</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.AbsoluteTimelock">AbsoluteTimelock</a><a href="#variant.HASH160Preimage">HASH160Preimage</a><a href="#variant.HASH256Preimage">HASH256Preimage</a><a href="#variant.Multisig">Multisig</a><a href="#variant.RIPEMD160Preimage">RIPEMD160Preimage</a><a href="#variant.RelativeTimelock">RelativeTimelock</a><a href="#variant.SHA256Preimage">SHA256Preimage</a><a href="#variant.Signature">Signature</a><a href="#variant.SignatureKey">SignatureKey</a><a href="#variant.Thresh">Thresh</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.id">id</a><a href="#method.is_leaf">is_leaf</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-From%3CSatisfiableItem%3E">From<SatisfiableItem></a><a href="#impl-Serialize">Serialize</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a></p><script>window.sidebarCurrent = {name: 'SatisfiableItem', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#107-139' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a>::<wbr><a class="enum" href=''>SatisfiableItem</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum SatisfiableItem {
+ Signature(<a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a>),
+ SignatureKey(<a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a>),
+ SHA256Preimage {
+ hash: Hash,
+ },
+ HASH256Preimage {
+ hash: Hash,
+ },
+ RIPEMD160Preimage {
+ hash: Hash,
+ },
+ HASH160Preimage {
+ hash: Hash,
+ },
+ AbsoluteTimelock {
+ value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
+ },
+ RelativeTimelock {
+ value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
+ },
+ Thresh {
+ items: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a>>,
+ threshold: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
+ },
+ Multisig {
+ keys: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a>>,
+ threshold: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
+ },
+}</pre></div><div class='docblock'><p>An item that need to be satisfied</p>
+</div><h2 id='variants' class='variants small-section-header'>
+ Variants<a href='#variants' class='anchor'></a></h2>
+<div id="variant.Signature" class="variant small-section-header"><a href="#variant.Signature" class="anchor field"></a><code id='Signature.v'>Signature(<a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a>)</code></div><div id="variant.SignatureKey" class="variant small-section-header"><a href="#variant.SignatureKey" class="anchor field"></a><code id='SignatureKey.v'>SignatureKey(<a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a>)</code></div><div id="variant.SHA256Preimage" class="variant small-section-header"><a href="#variant.SHA256Preimage" class="anchor field"></a><code id='SHA256Preimage.v'>SHA256Preimage</code></div><div class='autohide sub-variant' id='variant.SHA256Preimage.fields'><h3>Fields of <b>SHA256Preimage</b></h3><div><span id="variant.SHA256Preimage.field.hash" class="variant small-section-header"><a href="#variant.SHA256Preimage.field.hash" class="anchor field"></a><code id='SHA256Preimage.v.hash.v'>hash: Hash</code></span></div></div><div id="variant.HASH256Preimage" class="variant small-section-header"><a href="#variant.HASH256Preimage" class="anchor field"></a><code id='HASH256Preimage.v'>HASH256Preimage</code></div><div class='autohide sub-variant' id='variant.HASH256Preimage.fields'><h3>Fields of <b>HASH256Preimage</b></h3><div><span id="variant.HASH256Preimage.field.hash" class="variant small-section-header"><a href="#variant.HASH256Preimage.field.hash" class="anchor field"></a><code id='HASH256Preimage.v.hash.v'>hash: Hash</code></span></div></div><div id="variant.RIPEMD160Preimage" class="variant small-section-header"><a href="#variant.RIPEMD160Preimage" class="anchor field"></a><code id='RIPEMD160Preimage.v'>RIPEMD160Preimage</code></div><div class='autohide sub-variant' id='variant.RIPEMD160Preimage.fields'><h3>Fields of <b>RIPEMD160Preimage</b></h3><div><span id="variant.RIPEMD160Preimage.field.hash" class="variant small-section-header"><a href="#variant.RIPEMD160Preimage.field.hash" class="anchor field"></a><code id='RIPEMD160Preimage.v.hash.v'>hash: Hash</code></span></div></div><div id="variant.HASH160Preimage" class="variant small-section-header"><a href="#variant.HASH160Preimage" class="anchor field"></a><code id='HASH160Preimage.v'>HASH160Preimage</code></div><div class='autohide sub-variant' id='variant.HASH160Preimage.fields'><h3>Fields of <b>HASH160Preimage</b></h3><div><span id="variant.HASH160Preimage.field.hash" class="variant small-section-header"><a href="#variant.HASH160Preimage.field.hash" class="anchor field"></a><code id='HASH160Preimage.v.hash.v'>hash: Hash</code></span></div></div><div id="variant.AbsoluteTimelock" class="variant small-section-header"><a href="#variant.AbsoluteTimelock" class="anchor field"></a><code id='AbsoluteTimelock.v'>AbsoluteTimelock</code></div><div class='autohide sub-variant' id='variant.AbsoluteTimelock.fields'><h3>Fields of <b>AbsoluteTimelock</b></h3><div><span id="variant.AbsoluteTimelock.field.value" class="variant small-section-header"><a href="#variant.AbsoluteTimelock.field.value" class="anchor field"></a><code id='AbsoluteTimelock.v.value.v'>value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code></span></div></div><div id="variant.RelativeTimelock" class="variant small-section-header"><a href="#variant.RelativeTimelock" class="anchor field"></a><code id='RelativeTimelock.v'>RelativeTimelock</code></div><div class='autohide sub-variant' id='variant.RelativeTimelock.fields'><h3>Fields of <b>RelativeTimelock</b></h3><div><span id="variant.RelativeTimelock.field.value" class="variant small-section-header"><a href="#variant.RelativeTimelock.field.value" class="anchor field"></a><code id='RelativeTimelock.v.value.v'>value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code></span></div></div><div id="variant.Thresh" class="variant small-section-header"><a href="#variant.Thresh" class="anchor field"></a><code id='Thresh.v'>Thresh</code></div><div class='autohide sub-variant' id='variant.Thresh.fields'><h3>Fields of <b>Thresh</b></h3><div><span id="variant.Thresh.field.items" class="variant small-section-header"><a href="#variant.Thresh.field.items" class="anchor field"></a><code id='Thresh.v.items.v'>items: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a>></code></span><span id="variant.Thresh.field.threshold" class="variant small-section-header"><a href="#variant.Thresh.field.threshold" class="anchor field"></a><code id='Thresh.v.threshold.v'>threshold: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span></div></div><div id="variant.Multisig" class="variant small-section-header"><a href="#variant.Multisig" class="anchor field"></a><code id='Multisig.v'>Multisig</code></div><div class='autohide sub-variant' id='variant.Multisig.fields'><h3>Fields of <b>Multisig</b></h3><div><span id="variant.Multisig.field.keys" class="variant small-section-header"><a href="#variant.Multisig.field.keys" class="anchor field"></a><code id='Multisig.v.keys.v'>keys: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a>></code></span><span id="variant.Multisig.field.threshold" class="variant small-section-header"><a href="#variant.Multisig.field.threshold" class="anchor field"></a><code id='Multisig.v.threshold.v'>threshold: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span></div></div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="enum" href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="enum bdk::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#141-156' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.is_leaf' class="method"><code id='is_leaf.v'>pub fn <a href='#method.is_leaf' class='fnname'>is_leaf</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#142-150' title='goto source code'>[src]</a></h4><h4 id='method.id' class="method"><code id='id.v'>pub fn <a href='#method.id' class='fnname'>id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#152-155' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="enum bdk::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#105' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="enum bdk::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#105' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="enum bdk::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#105' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#105' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-From%3CSatisfiableItem%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="enum bdk::descriptor::policy::SatisfiableItem">SatisfiableItem</a>> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a></code><a href='#impl-From%3CSatisfiableItem%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#643-647' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(other: <a class="enum" href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="enum bdk::descriptor::policy::SatisfiableItem">SatisfiableItem</a>) -> Self</code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#644-646' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="enum bdk::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#105' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code id='serialize.v'>fn <a href='https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#105' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="enum bdk::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="enum bdk::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="enum bdk::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="enum bdk::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="enum bdk::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `policy` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, policy"><title>bdk::descriptor::policy - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module policy</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'policy', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#25-795' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a class="mod" href=''>policy</a></span></h1><div class='docblock'><p>Descriptor policy</p>
+<p>This module implements the logic to extract and represent the spending policies of a descriptor
+in a more human-readable format.</p>
+<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"wsh(and_v(v:pk(cV3oCth6zxZ1UVsHLnGothsWNsaoxRhC6aeNi5VbSdFpwUkgkEci),or_d(pk(cVMTy7uebJgvFaSBwcgvwk8qn8xSLc97dKow4MBetjrrahZoimm2),older(12960))))"</span>;
+
+<span class="kw">let</span> (<span class="ident">extended_desc</span>, <span class="ident">key_map</span>) <span class="op">=</span> <span class="ident">ExtendedDescriptor</span>::<span class="ident">parse_secret</span>(<span class="ident">desc</span>)<span class="question-mark">?</span>;
+<span class="macro">println</span><span class="macro">!</span>(<span class="string">"{:?}"</span>, <span class="ident">extended_desc</span>);
+
+<span class="kw">let</span> <span class="ident">signers</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">key_map</span>.<span class="ident">into</span>());
+<span class="kw">let</span> <span class="ident">policy</span> <span class="op">=</span> <span class="ident">extended_desc</span>.<span class="ident">extract_policy</span>(<span class="ident">signers</span>)<span class="question-mark">?</span>;
+<span class="macro">println</span><span class="macro">!</span>(<span class="string">"policy: {}"</span>, <span class="ident">serde_json</span>::<span class="ident">to_string</span>(<span class="kw-2">&</span><span class="ident">policy</span>)<span class="question-mark">?</span>);</pre></div>
+</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
+<table><tr class='module-item'><td><a class="struct" href="struct.Condition.html" title='bdk::descriptor::policy::Condition struct'>Condition</a></td><td class='docblock-short'><p>An extra condition that must be satisfied but that is out of control of the user</p>
+</td></tr><tr class='module-item'><td><a class="struct" href="struct.PKOrF.html" title='bdk::descriptor::policy::PKOrF struct'>PKOrF</a></td><td class='docblock-short'><p>Raw public key or extended key fingerprint</p>
+</td></tr><tr class='module-item'><td><a class="struct" href="struct.Policy.html" title='bdk::descriptor::policy::Policy struct'>Policy</a></td><td class='docblock-short'><p>Descriptor spending policy</p>
+</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
+<table><tr class='module-item'><td><a class="enum" href="enum.PolicyError.html" title='bdk::descriptor::policy::PolicyError enum'>PolicyError</a></td><td class='docblock-short'><p>Errors that can happen while extracting and manipulating policies</p>
+</td></tr><tr class='module-item'><td><a class="enum" href="enum.Satisfaction.html" title='bdk::descriptor::policy::Satisfaction enum'>Satisfaction</a></td><td class='docblock-short'><p>Represent if and how much a policy item is satisfied by the wallet's descriptor</p>
+</td></tr><tr class='module-item'><td><a class="enum" href="enum.SatisfiableItem.html" title='bdk::descriptor::policy::SatisfiableItem enum'>SatisfiableItem</a></td><td class='docblock-short'><p>An item that need to be satisfied</p>
+</td></tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
+<table><tr class='module-item'><td><a class="type" href="type.ConditionMap.html" title='bdk::descriptor::policy::ConditionMap type'>ConditionMap</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="type" href="type.FoldedConditionMap.html" title='bdk::descriptor::policy::FoldedConditionMap type'>FoldedConditionMap</a></td><td class='docblock-short'></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"enum":[["PolicyError","Errors that can happen while extracting and manipulating policies"],["Satisfaction","Represent if and how much a policy item is satisfied by the wallet's descriptor"],["SatisfiableItem","An item that need to be satisfied"]],"struct":[["Condition","An extra condition that must be satisfied but that is out of control of the user"],["PKOrF","Raw public key or extended key fingerprint"],["Policy","Descriptor spending policy"]],"type":[["ConditionMap",""],["FoldedConditionMap",""]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Condition` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Condition"><title>bdk::descriptor::policy::Condition - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Condition</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.csv">csv</a><a href="#structfield.timelock">timelock</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.is_null">is_null</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Eq">Eq</a><a href="#impl-Hash">Hash</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CCondition%3E">PartialEq<Condition></a><a href="#impl-PartialOrd%3CCondition%3E">PartialOrd<Condition></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a></p><script>window.sidebarCurrent = {name: 'Condition', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#420-425' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a>::<wbr><a class="struct" href=''>Condition</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Condition {
+ pub csv: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>,
+ pub timelock: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>,
+}</pre></div><div class='docblock'><p>An extra condition that must be satisfied but that is out of control of the user</p>
+</div><h2 id='fields' class='fields small-section-header'>
+ Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.csv" class="structfield small-section-header"><a href="#structfield.csv" class="anchor field"></a><code id="csv.v">csv: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>></code></span><span id="structfield.timelock" class="structfield small-section-header"><a href="#structfield.timelock" class="anchor field"></a><code id="timelock.v">timelock: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>></code></span><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#427-457' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.is_null' class="method"><code id='is_null.v'>pub fn <a href='#method.is_null' class='fnname'>is_null</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#454-456' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
+</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code id='hash.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H)</code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
+</div><h4 id='method.hash_slice' class="method hidden"><code id='hash_slice.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#192-199' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
+</div></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl-Ord' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code id='cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
+</div><h4 id='method.max' class="method hidden"><code id='max.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#600-605' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
+</div><h4 id='method.min' class="method hidden"><code id='min.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#620-625' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
+</div><h4 id='method.clamp' class="method hidden"><code id='clamp.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#647-659' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
+</div></div><h3 id='impl-PartialEq%3CCondition%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a>> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl-PartialEq%3CCondition%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
+</div><h4 id='method.ne' class="method hidden"><code id='ne.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
+</div></div><h3 id='impl-PartialOrd%3CCondition%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a>> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl-PartialOrd%3CCondition%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code id='partial_cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
+</div><h4 id='method.lt' class="method hidden"><code id='lt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: &<a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
+</div><h4 id='method.le' class="method hidden"><code id='le.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: &<a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
+</div><h4 id='method.gt' class="method hidden"><code id='gt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: &<a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
+</div><h4 id='method.ge' class="method hidden"><code id='ge.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: &<a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
+</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code id='serialize.v'>fn <a href='https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
+</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `PKOrF` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, PKOrF"><title>bdk::descriptor::policy::PKOrF - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct PKOrF</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Serialize">Serialize</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a></p><script>window.sidebarCurrent = {name: 'PKOrF', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#73-80' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a>::<wbr><a class="struct" href=''>PKOrF</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct PKOrF { /* fields omitted */ }</pre></div><div class='docblock'><p>Raw public key or extended key fingerprint</p>
+</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#72' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#72' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#72' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#72' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#72' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#72' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
+</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#72' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code id='serialize.v'>fn <a href='https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#72' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Policy` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Policy"><title>bdk::descriptor::policy::Policy - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Policy</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.contribution">contribution</a><a href="#structfield.id">id</a><a href="#structfield.item">item</a><a href="#structfield.satisfaction">satisfaction</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.get_condition">get_condition</a><a href="#method.requires_path">requires_path</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-From%3CSatisfiableItem%3E">From<SatisfiableItem></a><a href="#impl-Serialize">Serialize</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a></p><script>window.sidebarCurrent = {name: 'Policy', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#405-416' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a>::<wbr><a class="struct" href=''>Policy</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Policy {
+ pub id: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
+ pub item: <a class="enum" href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="enum bdk::descriptor::policy::SatisfiableItem">SatisfiableItem</a>,
+ pub satisfaction: <a class="enum" href="../../../bdk/descriptor/policy/enum.Satisfaction.html" title="enum bdk::descriptor::policy::Satisfaction">Satisfaction</a>,
+ pub contribution: <a class="enum" href="../../../bdk/descriptor/policy/enum.Satisfaction.html" title="enum bdk::descriptor::policy::Satisfaction">Satisfaction</a>,
+}</pre></div><div class='docblock'><p>Descriptor spending policy</p>
+</div><h2 id='fields' class='fields small-section-header'>
+ Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.id" class="structfield small-section-header"><a href="#structfield.id" class="anchor field"></a><code id="id.v">id: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></span><div class='docblock'><p>Identifier for this policy node</p>
+</div><span id="structfield.item" class="structfield small-section-header"><a href="#structfield.item" class="anchor field"></a><code id="item.v">item: <a class="enum" href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="enum bdk::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code></span><div class='docblock'><p>Type of this policy node</p>
+</div><span id="structfield.satisfaction" class="structfield small-section-header"><a href="#structfield.satisfaction" class="anchor field"></a><code id="satisfaction.v">satisfaction: <a class="enum" href="../../../bdk/descriptor/policy/enum.Satisfaction.html" title="enum bdk::descriptor::policy::Satisfaction">Satisfaction</a></code></span><div class='docblock'><p>How a much given PSBT already satisfies this polcy node <strong>(currently unused)</strong></p>
+</div><span id="structfield.contribution" class="structfield small-section-header"><a href="#structfield.contribution" class="anchor field"></a><code id="contribution.v">contribution: <a class="enum" href="../../../bdk/descriptor/policy/enum.Satisfaction.html" title="enum bdk::descriptor::policy::Satisfaction">Satisfaction</a></code></span><div class='docblock'><p>How the wallet's descriptor can satisfy this policy node</p>
+</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#479-641' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.requires_path' class="method"><code id='requires_path.v'>pub fn <a href='#method.requires_path' class='fnname'>requires_path</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#572-574' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return whether or not a specific path in the policy tree is required to unambiguously
+create a transaction</p>
+<p>What this means is that for some spending policies the user should select which paths in
+the tree it intends to satisfy while signing, because the transaction must be created differently based
+on that.</p>
+</div><h4 id='method.get_condition' class="method"><code id='get_condition.v'>pub fn <a href='#method.get_condition' class='fnname'>get_condition</a>(<br> &self, <br> path: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/collections/btree/map/struct.BTreeMap.html" title="struct alloc::collections::btree::map::BTreeMap">BTreeMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a>, <a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a>></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#578-640' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the conditions that are set by the spending policy for a given path in the
+policy tree</p>
+</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#404' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#404' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#404' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#404' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-From%3CSatisfiableItem%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="enum bdk::descriptor::policy::SatisfiableItem">SatisfiableItem</a>> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a></code><a href='#impl-From%3CSatisfiableItem%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#643-647' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(other: <a class="enum" href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="enum bdk::descriptor::policy::SatisfiableItem">SatisfiableItem</a>) -> Self</code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#644-646' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#404' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code id='serialize.v'>fn <a href='https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#404' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ConditionMap` type in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, ConditionMap"><title>bdk::descriptor::policy::ConditionMap - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition ConditionMap</p><div class="sidebar-elems"><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a></p><script>window.sidebarCurrent = {name: 'ConditionMap', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#216' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a>::<wbr><a class="type" href=''>ConditionMap</a></span></h1><pre class='rust typedef'>type ConditionMap = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/collections/btree/map/struct.BTreeMap.html" title="struct alloc::collections::btree::map::BTreeMap">BTreeMap</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a>>>;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `FoldedConditionMap` type in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, FoldedConditionMap"><title>bdk::descriptor::policy::FoldedConditionMap - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition FoldedConditionMap</p><div class="sidebar-elems"><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a></p><script>window.sidebarCurrent = {name: 'FoldedConditionMap', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/descriptor/policy.rs.html#217' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a>::<wbr><a class="type" href=''>FoldedConditionMap</a></span></h1><pre class='rust typedef'>type FoldedConditionMap = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/collections/btree/map/struct.BTreeMap.html" title="struct alloc::collections::btree::map::BTreeMap">BTreeMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../../../bdk/descriptor/policy/struct.Condition.html" title="struct bdk::descriptor::policy::Condition">Condition</a>>>;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"enum":[["Descriptor","Script descriptor"],["Legacy","Legacy ScriptContext"],["Segwitv0","Segwitv0 ScriptContext"],["Terminal","All AST elements"]],"mod":[["checksum","Descriptor checksum"],["error","Descriptor errors"],["policy","Descriptor policy"]],"struct":[["Miniscript","Top-level script AST type"]],"trait":[["ExtractPolicy","Trait implemented on [`Descriptor`]s to add a method to extract the spending [`policy`]"],["MiniscriptKey","Public key trait which can be converted to Hash type"],["ScriptContext",""],["ToPublicKey","Trait describing public key types which can be converted to bitcoin pubkeys"]],"type":[["ExtendedDescriptor","Alias for a [`Descriptor`] that can contain extended keys using [`DescriptorPublicKey`]"],["HDKeyPaths","Alias for the type of maps that represent derivation paths in a [`psbt::Input`] or [`psbt::Output`]"]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Miniscript` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Miniscript"><title>bdk::descriptor::Miniscript - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Miniscript</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.ext">ext</a><a href="#structfield.node">node</a><a href="#structfield.ty">ty</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.as_inner">as_inner</a><a href="#method.encode">encode</a><a href="#method.from_ast">from_ast</a><a href="#method.into_inner">into_inner</a><a href="#method.max_satisfaction_size">max_satisfaction_size</a><a href="#method.max_satisfaction_witness_elements">max_satisfaction_witness_elements</a><a href="#method.parse">parse</a><a href="#method.satisfy">satisfy</a><a href="#method.script_size">script_size</a><a href="#method.translate_pk">translate_pk</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-ExtractPolicy">ExtractPolicy</a><a href="#impl-FromStr">FromStr</a><a href="#impl-FromTree">FromTree</a><a href="#impl-Hash">Hash</a><a href="#impl-Liftable%3CPk%3E">Liftable<Pk></a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CMiniscript%3CPk%2C%20Ctx%3E%3E">PartialEq<Miniscript<Pk, Ctx>></a><a href="#impl-PartialOrd%3CMiniscript%3CPk%2C%20Ctx%3E%3E">PartialOrd<Miniscript<Pk, Ctx>></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'Miniscript', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span></span><span class='in-band'>Struct <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="struct" href=''>Miniscript</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Miniscript<Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span> {
+ pub node: <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx>,
+ pub ty: Type,
+ pub ext: ExtData,
+ // some fields omitted
+}</pre></div><div class='docblock'><p>Top-level script AST type</p>
+</div><h2 id='fields' class='fields small-section-header'>
+ Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.node" class="structfield small-section-header"><a href="#structfield.node" class="anchor field"></a><code id="node.v">node: <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx></code></span><div class='docblock'><p>A node in the Abstract Syntax Tree(</p>
+</div><span id="structfield.ty" class="structfield small-section-header"><a href="#structfield.ty" class="anchor field"></a><code id="ty.v">ty: Type</code></span><div class='docblock'><p>The correctness and malleability type information for the AST node</p>
+</div><span id="structfield.ext" class="structfield small-section-header"><a href="#structfield.ext" class="anchor field"></a><code id="ext.v">ext: ExtData</code></span><div class='docblock'><p>Additional information helpful for extra analysis.</p>
+</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl' class='anchor'></a></h3><div class='impl-items'><h4 id='method.from_ast' class="method"><code id='from_ast.v'>pub fn <a href='#method.from_ast' class='fnname'>from_ast</a>(t: <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>, Error></code></h4><div class='docblock'><p>Add type information(Type and Extdata) to Miniscript based on
+<code>AstElem</code> fragment. Dependent on display and clone because of Error
+Display code of type_check.</p>
+</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-1' class='anchor'></a></h3><div class='impl-items'><h4 id='method.into_inner' class="method"><code id='into_inner.v'>pub fn <a href='#method.into_inner' class='fnname'>into_inner</a>(self) -> <a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx></code></h4><div class='docblock'><p>Extracts the <code>AstElem</code> representing the root of the miniscript</p>
+</div><h4 id='method.as_inner' class="method"><code id='as_inner.v'>pub fn <a href='#method.as_inner' class='fnname'>as_inner</a>(&self) -> &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx></code></h4></div><h3 id='impl-2' class='impl'><code class='in-band'>impl<Ctx> <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><PublicKey, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>, </span></code><a href='#impl-2' class='anchor'></a></h3><div class='impl-items'><h4 id='method.parse' class="method"><code id='parse.v'>pub fn <a href='#method.parse' class='fnname'>parse</a>(script: &Script) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><PublicKey, Ctx>, Error></code></h4><div class='docblock'><p>Attempt to parse a script into a Miniscript representation</p>
+</div></div><h3 id='impl-3' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a>, </span></code><a href='#impl-3' class='anchor'></a></h3><div class='impl-items'><h4 id='method.encode' class="method"><code id='encode.v'>pub fn <a href='#method.encode' class='fnname'>encode</a>(&self) -> Script</code></h4><div class='docblock'><p>Encode as a Bitcoin script</p>
+</div><h4 id='method.script_size' class="method"><code id='script_size.v'>pub fn <a href='#method.script_size' class='fnname'>script_size</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock'><p>Size, in bytes of the script-pubkey. If this Miniscript is used outside
+of segwit (e.g. in a bare or P2SH descriptor), this quantity should be
+multiplied by 4 to compute the weight.</p>
+<p>In general, it is not recommended to use this function directly, but
+to instead call the corresponding function on a <code>Descriptor</code>, which
+will handle the segwit/non-segwit technicalities for you.</p>
+</div><h4 id='method.max_satisfaction_witness_elements' class="method"><code id='max_satisfaction_witness_elements.v'>pub fn <a href='#method.max_satisfaction_witness_elements' class='fnname'>max_satisfaction_witness_elements</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock'><p>Maximum number of witness elements used to satisfy the Miniscript
+fragment, including the witness script itself. Used to estimate
+the weight of the <code>VarInt</code> that specifies this number in a serialized
+transaction.</p>
+<p>This function may panic on misformed <code>Miniscript</code> objects which do
+not correspond to semantically sane Scripts. (Such scripts should be
+rejected at parse time. Any exceptions are bugs.)</p>
+</div><h4 id='method.max_satisfaction_size' class="method"><code id='max_satisfaction_size.v'>pub fn <a href='#method.max_satisfaction_size' class='fnname'>max_satisfaction_size</a>(&self, one_cost: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock'><p>Maximum size, in bytes, of a satisfying witness. For Segwit outputs
+<code>one_cost</code> should be set to 2, since the number <code>1</code> requires two
+bytes to encode. For non-segwit outputs <code>one_cost</code> should be set to
+1, since <code>OP_1</code> is available in scriptSigs.</p>
+<p>In general, it is not recommended to use this function directly, but
+to instead call the corresponding function on a <code>Descriptor</code>, which
+will handle the segwit/non-segwit technicalities for you.</p>
+<p>All signatures are assumed to be 73 bytes in size, including the
+length prefix (segwit) or push opcode (pre-segwit) and sighash
+postfix.</p>
+<p>This function may panic on misformed <code>Miniscript</code> objects which do not
+correspond to semantically sane Scripts. (Such scripts should be
+rejected at parse time. Any exceptions are bugs.)</p>
+</div></div><h3 id='impl-4' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-4' class='anchor'></a></h3><div class='impl-items'><h4 id='method.translate_pk' class="method"><code id='translate_pk.v'>pub fn <a href='#method.translate_pk' class='fnname'>translate_pk</a><FPk, FPkh, Q, FuncError>(<br> &self, <br> translatefpk: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>FPk, <br> translatefpkh: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>FPkh<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Q, Ctx>, FuncError> <span class="where fmt-newline">where<br> FPk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Pk) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Q, FuncError>,<br> FPkh: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&<Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Q as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>, FuncError>,<br> Q: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><div class='docblock'><p>This will panic if translatefpk returns an uncompressed key when
+converting to a Segwit descriptor. To prevent this panic, ensure
+translatefpk returns an error in this case instead.</p>
+</div></div><h3 id='impl-5' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a>, </span></code><a href='#impl-5' class='anchor'></a></h3><div class='impl-items'><h4 id='method.satisfy' class="method"><code id='satisfy.v'>pub fn <a href='#method.satisfy' class='fnname'>satisfy</a><S>(&self, satisfier: S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>>> <span class="where fmt-newline">where<br> S: Satisfier<Pk>, </span></code></h4><div class='docblock'><p>Attempt to produce a satisfying witness for the
+witness script represented by the parse tree</p>
+</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-Clone' class='anchor'></a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx></code></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Debug' class='anchor'></a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></code></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Display' class='anchor'></a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></code></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Eq' class='anchor'></a></h3><div class='docblock'><p><code>Eq</code> of <code>Miniscript</code> must depend only on node and not the type information.
+The type information and extra_properties can be deterministically determined
+by the ast.</p>
+</div><div class='impl-items'></div><h3 id='impl-ExtractPolicy' class='impl'><code class='in-band'>impl<Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>> <a class="trait" href="../../bdk/descriptor/trait.ExtractPolicy.html" title="trait bdk::descriptor::ExtractPolicy">ExtractPolicy</a> for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><DescriptorPublicKey, Ctx></code><a href='#impl-ExtractPolicy' class='anchor'></a><a class='srclink' href='../../src/bdk/descriptor/policy.rs.html#688-779' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.extract_policy' class="method hidden"><code id='extract_policy.v'>fn <a href='../../bdk/descriptor/trait.ExtractPolicy.html#tymethod.extract_policy' class='fnname'>extract_policy</a>(<br> &self, <br> signers: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a>>, <a class="enum" href="../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a>></code><a class='srclink' href='../../src/bdk/descriptor/policy.rs.html#689-778' title='goto source code'>[src]</a></h4></div><h3 id='impl-FromStr' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a> for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>,<br> <Pk as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>,<br> <<Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>, </span></code><a href='#impl-FromStr' class='anchor'></a></h3><div class='impl-items'><h4 id='associatedtype.Err' class="type"><code id='Err.t'>type <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err' class="type">Err</a> = Error</code></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
+</div><h4 id='method.from_str' class="method hidden"><code id='from_str.v'>fn <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str' class='fnname'>from_str</a>(s: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>, Error></code></h4><div class='docblock hidden'><p>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str">Read more</a></p>
+</div></div><h3 id='impl-FromTree' class='impl'><code class='in-band'>impl<Pk, Ctx> FromTree for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>,<br> <Pk as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>,<br> <<Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>, </span></code><a href='#impl-FromTree' class='anchor'></a></h3><div class='impl-items'><h4 id='method.from_tree' class="method"><code id='from_tree.v'>fn <a href='#method.from_tree' class='fnname'>from_tree</a>(top: &Tree) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>, Error></code></h4><div class='docblock'><p>Parse an expression tree into a Miniscript. As a general rule, this
+should not be called directly; rather go through the descriptor API.</p>
+</div></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>, </span></code><a href='#impl-Hash' class='anchor'></a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code id='hash.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H) <span class="where fmt-newline">where<br> __H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
+</div><h4 id='method.hash_slice' class="method hidden"><code id='hash_slice.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#192-199' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
+</div></div><h3 id='impl-Liftable%3CPk%3E' class='impl'><code class='in-band'>impl<Pk, Ctx> Liftable<Pk> for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Liftable%3CPk%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.lift' class="method hidden"><code id='lift.v'>fn <a href='#method.lift' class='fnname'>lift</a>(&self) -> Policy<Pk></code></h4><div class='docblock hidden'><p>Convert the object into an abstract policy</p>
+</div></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Ord' class='anchor'></a></h3><div class='docblock'><p><code>Ord</code> of <code>Miniscript</code> must depend only on node and not the type information.
+The type information and extra_properties can be deterministically determined
+by the ast.</p>
+</div><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code id='cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
+</div><h4 id='method.max' class="method hidden"><code id='max.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#600-605' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
+</div><h4 id='method.min' class="method hidden"><code id='min.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#620-625' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
+</div><h4 id='method.clamp' class="method hidden"><code id='clamp.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#647-659' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
+</div></div><h3 id='impl-PartialEq%3CMiniscript%3CPk%2C%20Ctx%3E%3E' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>> for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-PartialEq%3CMiniscript%3CPk%2C%20Ctx%3E%3E' class='anchor'></a></h3><div class='docblock'><p><code>PartialEq</code> of <code>Miniscript</code> must depend only on node and not the type information.
+The type information and extra_properties can be deterministically determined
+by the ast.</p>
+</div><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
+</div><h4 id='method.ne' class="method hidden"><code id='ne.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#216-218' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
+</div></div><h3 id='impl-PartialOrd%3CMiniscript%3CPk%2C%20Ctx%3E%3E' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>> for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-PartialOrd%3CMiniscript%3CPk%2C%20Ctx%3E%3E' class='anchor'></a></h3><div class='docblock'><p><code>PartialOrd</code> of <code>Miniscript</code> must depend only on node and not the type information.
+The type information and extra_properties can be deterministically determined
+by the ast.</p>
+</div><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code id='partial_cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
+</div><h4 id='method.lt' class="method hidden"><code id='lt.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#842-844' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
+</div><h4 id='method.le' class="method hidden"><code id='le.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#861-863' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
+</div><h4 id='method.gt' class="method hidden"><code id='gt.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#879-881' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
+</div><h4 id='method.ge' class="method hidden"><code id='ge.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#898-900' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>, </span></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>,<br> <Pk as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>, </span></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2219-2229' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2221-2228' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ExtractPolicy` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, ExtractPolicy"><title>bdk::descriptor::ExtractPolicy - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait ExtractPolicy</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.extract_policy">extract_policy</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'ExtractPolicy', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/descriptor/mod.rs.html#65-70' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="trait" href=''>ExtractPolicy</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait ExtractPolicy {
+ fn <a href='#tymethod.extract_policy' class='fnname'>extract_policy</a>(<br> &self, <br> signers: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey>><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a>>, <a class="enum" href="../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a>>;
+}</pre></div><div class='docblock'><p>Trait implemented on [<code>Descriptor</code>]s to add a method to extract the spending [<code>policy</code>]</p>
+</div>
+ <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.extract_policy' class='method'><code id='extract_policy.v'>fn <a href='#tymethod.extract_policy' class='fnname'>extract_policy</a>(<br> &self, <br> signers: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a>>, <a class="enum" href="../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a>></code></h3></div><span class='loading-content'>Loading content...</span>
+ <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-ExtractPolicy' class='impl'><code class='in-band'>impl ExtractPolicy for <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><DescriptorPublicKey></code><a href='#impl-ExtractPolicy' class='anchor'></a><a class='srclink' href='../../src/bdk/descriptor/policy.rs.html#781-795' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.extract_policy' class="method hidden"><code id='extract_policy.v-1'>fn <a href='#method.extract_policy' class='fnname'>extract_policy</a>(<br> &self, <br> signers: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a>>, <a class="enum" href="../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a>></code><a class='srclink' href='../../src/bdk/descriptor/policy.rs.html#782-794' title='goto source code'>[src]</a></h4></div><h3 id='impl-ExtractPolicy-1' class='impl'><code class='in-band'>impl<Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>> ExtractPolicy for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><DescriptorPublicKey, Ctx></code><a href='#impl-ExtractPolicy-1' class='anchor'></a><a class='srclink' href='../../src/bdk/descriptor/policy.rs.html#688-779' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.extract_policy-1' class="method hidden"><code id='extract_policy.v-2'>fn <a href='#method.extract_policy-1' class='fnname'>extract_policy</a>(<br> &self, <br> signers: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a>>, <a class="enum" href="../../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a>></code><a class='srclink' href='../../src/bdk/descriptor/policy.rs.html#689-778' title='goto source code'>[src]</a></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/bdk/descriptor/trait.ExtractPolicy.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `MiniscriptKey` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, MiniscriptKey"><title>bdk::descriptor::MiniscriptKey - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait MiniscriptKey</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-types">Associated Types</a><div class="sidebar-links"><a href="#associatedtype.Hash">Hash</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.to_pubkeyhash">to_pubkeyhash</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.is_uncompressed">is_uncompressed</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-MiniscriptKey-for-DescriptorPublicKey">DescriptorPublicKey</a><a href="#impl-MiniscriptKey-for-DummyKey">DummyKey</a><a href="#impl-MiniscriptKey-for-PublicKey">PublicKey</a><a href="#impl-MiniscriptKey-for-String">String</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'MiniscriptKey', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span></span><span class='in-band'>Trait <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="trait" href=''>MiniscriptKey</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait MiniscriptKey: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <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/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a> {
+ type <a href='#associatedtype.Hash' class="type">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <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/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>;
+ fn <a href='#tymethod.to_pubkeyhash' class='fnname'>to_pubkeyhash</a>(&self) -> Self::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>;
+
+ fn <a href='#method.is_uncompressed' class='fnname'>is_uncompressed</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> { ... }
+}</pre></div><div class='docblock'><p>Public key trait which can be converted to Hash type</p>
+</div>
+ <h2 id='associated-types' class='small-section-header'>Associated Types<a href='#associated-types' class='anchor'></a></h2><div class='methods'><h3 id='associatedtype.Hash' class='method'><code id='Hash.t'>type <a href='#associatedtype.Hash' class="type">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <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/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a></code></h3><div class='docblock'><p>The associated Hash type with the publicKey</p>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.to_pubkeyhash' class='method'><code id='to_pubkeyhash.v'>fn <a href='#tymethod.to_pubkeyhash' class='fnname'>to_pubkeyhash</a>(&self) -> Self::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a></code></h3><div class='docblock'><p>Converts an object to PublicHash</p>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='provided-methods' class='small-section-header'>Provided methods<a href='#provided-methods' class='anchor'></a></h2><div class='methods'><h3 id='method.is_uncompressed' class='method'><code id='is_uncompressed.v'>fn <a href='#method.is_uncompressed' class='fnname'>is_uncompressed</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h3><div class='docblock'><p>Check if the publicKey is uncompressed. The default
+implementation returns false</p>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-MiniscriptKey-for-DummyKey' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> for DummyKey</code><a href='#impl-MiniscriptKey-for-DummyKey' class='anchor'></a></h3><div class='impl-items'><h4 id='associatedtype.Hash-1' class="type"><code id='Hash.t-1'>type <a href='#associatedtype.Hash' class="type">Hash</a> = DummyKeyHash</code></h4><h4 id='method.to_pubkeyhash' class="method hidden"><code id='to_pubkeyhash.v-1'>fn <a href='#method.to_pubkeyhash' class='fnname'>to_pubkeyhash</a>(&self) -> <DummyKey as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a></code></h4></div><h3 id='impl-MiniscriptKey-for-String' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a href='#impl-MiniscriptKey-for-String' class='anchor'></a></h3><div class='impl-items'><h4 id='associatedtype.Hash-2' class="type"><code id='Hash.t-2'>type <a href='#associatedtype.Hash' class="type">Hash</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></h4><h4 id='method.to_pubkeyhash-1' class="method hidden"><code id='to_pubkeyhash.v-2'>fn <a href='#method.to_pubkeyhash' class='fnname'>to_pubkeyhash</a>(&self) -> <<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a> as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a></code></h4></div><h3 id='impl-MiniscriptKey-for-PublicKey' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> for PublicKey</code><a href='#impl-MiniscriptKey-for-PublicKey' class='anchor'></a></h3><div class='impl-items'><h4 id='method.is_uncompressed-1' class="method"><code id='is_uncompressed.v-1'>fn <a href='#method.is_uncompressed' class='fnname'>is_uncompressed</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock'><p><code>is_uncompressed</code> returns true only for
+bitcoin::Publickey type if the underlying key is uncompressed.</p>
+</div><h4 id='associatedtype.Hash-3' class="type"><code id='Hash.t-3'>type <a href='#associatedtype.Hash' class="type">Hash</a> = Hash</code></h4><h4 id='method.to_pubkeyhash-2' class="method hidden"><code id='to_pubkeyhash.v-3'>fn <a href='#method.to_pubkeyhash' class='fnname'>to_pubkeyhash</a>(&self) -> <PublicKey as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a></code></h4></div><h3 id='impl-MiniscriptKey-for-DescriptorPublicKey' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> for DescriptorPublicKey</code><a href='#impl-MiniscriptKey-for-DescriptorPublicKey' class='anchor'></a></h3><div class='impl-items'><h4 id='associatedtype.Hash-4' class="type"><code id='Hash.t-4'>type <a href='#associatedtype.Hash' class="type">Hash</a> = Hash</code></h4><h4 id='method.to_pubkeyhash-3' class="method hidden"><code id='to_pubkeyhash.v-4'>fn <a href='#method.to_pubkeyhash' class='fnname'>to_pubkeyhash</a>(&self) -> <DescriptorPublicKey as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a></code></h4></div><span class='loading-content'>Loading content...</span>
+ <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/miniscript/trait.MiniscriptKey.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ScriptContext` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, ScriptContext"><title>bdk::descriptor::ScriptContext - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait ScriptContext</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.check_frag_non_malleable">check_frag_non_malleable</a><a href="#tymethod.check_frag_validity">check_frag_validity</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'ScriptContext', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span></span><span class='in-band'>Trait <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="trait" href=''>ScriptContext</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait ScriptContext: Sealed + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><Self> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><Self> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> {
+ fn <a href='#tymethod.check_frag_non_malleable' class='fnname'>check_frag_non_malleable</a><Pk, Ctx>(<br> _frag: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError><br> <span class="where">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a></span>;
+<div class='item-spacer'></div> fn <a href='#tymethod.check_frag_validity' class='fnname'>check_frag_validity</a><Pk, Ctx>(<br> _frag: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError><br> <span class="where">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a></span>;
+}</pre></div>
+ <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.check_frag_non_malleable' class='method'><code id='check_frag_non_malleable.v'>fn <a href='#tymethod.check_frag_non_malleable' class='fnname'>check_frag_non_malleable</a><Pk, Ctx>(<br> _frag: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h3><div class='docblock'><p>Depending on ScriptContext, fragments can be malleable. For Example,
+under Legacy context, PkH is malleable because it is possible to
+estimate the cost of satisfaction because of compressed keys
+This is currently only used in compiler code for removing malleable
+compilations.
+This does NOT recursively check if the children of the fragment are
+valid or not. Since the compilation proceeds in a leaf to root fashion,
+a recursive check is unnecessary.</p>
+</div><h3 id='tymethod.check_frag_validity' class='method'><code id='check_frag_validity.v'>fn <a href='#tymethod.check_frag_validity' class='fnname'>check_frag_validity</a><Pk, Ctx>(<br> _frag: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h3><div class='docblock'><p>Depending on script Context, some of the Terminals might not be valid.
+For example, in Segwit Context with MiniscriptKey as bitcoin::PublicKey
+uncompressed public keys are non-standard and thus invalid.
+Post Tapscript upgrade, this would have to consider other nodes.
+This does not recursively check</p>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-ScriptContext' class='impl'><code class='in-band'>impl ScriptContext for <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a></code><a href='#impl-ScriptContext' class='anchor'></a></h3><div class='impl-items'><h4 id='method.check_frag_non_malleable' class="method hidden"><code id='check_frag_non_malleable.v-1'>fn <a href='#method.check_frag_non_malleable' class='fnname'>check_frag_non_malleable</a><Pk, Ctx>(<br> frag: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><h4 id='method.check_frag_validity' class="method hidden"><code id='check_frag_validity.v-1'>fn <a href='#method.check_frag_validity' class='fnname'>check_frag_validity</a><Pk, Ctx>(<br> _frag: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4></div><h3 id='impl-ScriptContext-1' class='impl'><code class='in-band'>impl ScriptContext for <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-ScriptContext-1' class='anchor'></a></h3><div class='impl-items'><h4 id='method.check_frag_non_malleable-1' class="method hidden"><code id='check_frag_non_malleable.v-2'>fn <a href='#method.check_frag_non_malleable-1' class='fnname'>check_frag_non_malleable</a><Pk, Ctx>(<br> _frag: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><h4 id='method.check_frag_validity-1' class="method hidden"><code id='check_frag_validity.v-2'>fn <a href='#method.check_frag_validity-1' class='fnname'>check_frag_validity</a><Pk, Ctx>(<br> frag: &<a class="enum" href="../../bdk/descriptor/enum.Terminal.html" title="enum bdk::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/descriptor/trait.ScriptContext.html" title="trait bdk::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/miniscript/miniscript/context/trait.ScriptContext.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ToPublicKey` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, ToPublicKey"><title>bdk::descriptor::ToPublicKey - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait ToPublicKey</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.hash_to_hash160">hash_to_hash160</a><a href="#tymethod.to_public_key">to_public_key</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.serialized_len">serialized_len</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-ToPublicKey-for-DescriptorPublicKey">DescriptorPublicKey</a><a href="#impl-ToPublicKey-for-DummyKey">DummyKey</a><a href="#impl-ToPublicKey-for-PublicKey">PublicKey</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'ToPublicKey', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span></span><span class='in-band'>Trait <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="trait" href=''>ToPublicKey</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait ToPublicKey: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> {
+ fn <a href='#tymethod.to_public_key' class='fnname'>to_public_key</a>(&self) -> PublicKey;
+<div class='item-spacer'></div> fn <a href='#tymethod.hash_to_hash160' class='fnname'>hash_to_hash160</a>(hash: &Self::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>) -> Hash;
+
+ fn <a href='#method.serialized_len' class='fnname'>serialized_len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> { ... }
+}</pre></div><div class='docblock'><p>Trait describing public key types which can be converted to bitcoin pubkeys</p>
+</div>
+ <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.to_public_key' class='method'><code id='to_public_key.v'>fn <a href='#tymethod.to_public_key' class='fnname'>to_public_key</a>(&self) -> PublicKey</code></h3><div class='docblock'><p>Converts an object to a public key</p>
+</div><h3 id='tymethod.hash_to_hash160' class='method'><code id='hash_to_hash160.v'>fn <a href='#tymethod.hash_to_hash160' class='fnname'>hash_to_hash160</a>(hash: &Self::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>) -> Hash</code></h3><div class='docblock'><p>Converts a hashed version of the public key to a <code>hash160</code> hash.</p>
+<p>This method must be consistent with <code>to_public_key</code>, in the sense
+that calling <code>MiniscriptKey::to_pubkeyhash</code> followed by this function
+should give the same result as calling <code>to_public_key</code> and hashing
+the result directly.</p>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='provided-methods' class='small-section-header'>Provided methods<a href='#provided-methods' class='anchor'></a></h2><div class='methods'><h3 id='method.serialized_len' class='method'><code id='serialized_len.v'>fn <a href='#method.serialized_len' class='fnname'>serialized_len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h3><div class='docblock'><p>Computes the size of a public key when serialized in a script,
+including the length bytes</p>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-ToPublicKey-for-PublicKey' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a> for PublicKey</code><a href='#impl-ToPublicKey-for-PublicKey' class='anchor'></a></h3><div class='impl-items'><h4 id='method.to_public_key' class="method hidden"><code id='to_public_key.v-1'>fn <a href='#method.to_public_key' class='fnname'>to_public_key</a>(&self) -> PublicKey</code></h4><h4 id='method.hash_to_hash160' class="method hidden"><code id='hash_to_hash160.v-1'>fn <a href='#method.hash_to_hash160' class='fnname'>hash_to_hash160</a>(hash: &Hash) -> Hash</code></h4></div><h3 id='impl-ToPublicKey-for-DescriptorPublicKey' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a> for DescriptorPublicKey</code><a href='#impl-ToPublicKey-for-DescriptorPublicKey' class='anchor'></a></h3><div class='impl-items'><h4 id='method.to_public_key-1' class="method hidden"><code id='to_public_key.v-2'>fn <a href='#method.to_public_key' class='fnname'>to_public_key</a>(&self) -> PublicKey</code></h4><h4 id='method.hash_to_hash160-1' class="method hidden"><code id='hash_to_hash160.v-2'>fn <a href='#method.hash_to_hash160' class='fnname'>hash_to_hash160</a>(hash: &<DescriptorPublicKey as <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>) -> Hash</code></h4></div><h3 id='impl-ToPublicKey-for-DummyKey' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a> for DummyKey</code><a href='#impl-ToPublicKey-for-DummyKey' class='anchor'></a></h3><div class='impl-items'><h4 id='method.to_public_key-2' class="method hidden"><code id='to_public_key.v-3'>fn <a href='#method.to_public_key' class='fnname'>to_public_key</a>(&self) -> PublicKey</code></h4><h4 id='method.hash_to_hash160-2' class="method hidden"><code id='hash_to_hash160.v-3'>fn <a href='#method.hash_to_hash160' class='fnname'>hash_to_hash160</a>(&DummyKeyHash) -> Hash</code></h4></div><span class='loading-content'>Loading content...</span>
+ <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/miniscript/trait.ToPublicKey.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ExtendedDescriptor` type in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, ExtendedDescriptor"><title>bdk::descriptor::ExtendedDescriptor - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition ExtendedDescriptor</p><div class="sidebar-elems"><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'ExtendedDescriptor', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/descriptor/mod.rs.html#55' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="type" href=''>ExtendedDescriptor</a></span></h1><pre class='rust typedef'>type ExtendedDescriptor = <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><DescriptorPublicKey>;</pre><div class='docblock'><p>Alias for a [<code>Descriptor</code>] that can contain extended keys using [<code>DescriptorPublicKey</code>]</p>
+</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `HDKeyPaths` type in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, HDKeyPaths"><title>bdk::descriptor::HDKeyPaths - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition HDKeyPaths</p><div class="sidebar-elems"><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'HDKeyPaths', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/descriptor/mod.rs.html#62' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="type" href=''>HDKeyPaths</a></span></h1><pre class='rust typedef'>type HDKeyPaths = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/collections/btree/map/struct.BTreeMap.html" title="struct alloc::collections::btree::map::BTreeMap">BTreeMap</a><PublicKey, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Fingerprint, DerivationPath<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>;</pre><div class='docblock'><p>Alias for the type of maps that represent derivation paths in a <a href="bitcoin::util::psbt::Input"><code>psbt::Input</code></a> or
+<a href="bitcoin::util::psbt::Output"><code>psbt::Output</code></a></p>
+</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Error` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Error"><title>bdk::Error - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../bdk/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Error</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.AddressValidator">AddressValidator</a><a href="#variant.BIP32">BIP32</a><a href="#variant.ChecksumMismatch">ChecksumMismatch</a><a href="#variant.CompactFilters">CompactFilters</a><a href="#variant.Descriptor">Descriptor</a><a href="#variant.DifferentDescriptorStructure">DifferentDescriptorStructure</a><a href="#variant.DifferentTransactions">DifferentTransactions</a><a href="#variant.Electrum">Electrum</a><a href="#variant.Encode">Encode</a><a href="#variant.Esplora">Esplora</a><a href="#variant.FeeRateTooLow">FeeRateTooLow</a><a href="#variant.Generic">Generic</a><a href="#variant.Hex">Hex</a><a href="#variant.InsufficientFunds">InsufficientFunds</a><a href="#variant.InvalidAddressNetwork">InvalidAddressNetwork</a><a href="#variant.InvalidOutpoint">InvalidOutpoint</a><a href="#variant.InvalidPolicyPathError">InvalidPolicyPathError</a><a href="#variant.InvalidProgressValue">InvalidProgressValue</a><a href="#variant.InvalidU32Bytes">InvalidU32Bytes</a><a href="#variant.IrreplaceableTransaction">IrreplaceableTransaction</a><a href="#variant.JSON">JSON</a><a href="#variant.KeyMismatch">KeyMismatch</a><a href="#variant.Miniscript">Miniscript</a><a href="#variant.MissingCachedAddresses">MissingCachedAddresses</a><a href="#variant.MissingInputUTXO">MissingInputUTXO</a><a href="#variant.NoAddressees">NoAddressees</a><a href="#variant.OfflineClient">OfflineClient</a><a href="#variant.OutputBelowDustLimit">OutputBelowDustLimit</a><a href="#variant.PSBT">PSBT</a><a href="#variant.ProgressUpdateError">ProgressUpdateError</a><a href="#variant.ScriptDoesntHaveAddressForm">ScriptDoesntHaveAddressForm</a><a href="#variant.Secp256k1">Secp256k1</a><a href="#variant.SendAllMultipleOutputs">SendAllMultipleOutputs</a><a href="#variant.Signer">Signer</a><a href="#variant.Sled">Sled</a><a href="#variant.SpendingPolicyRequired">SpendingPolicyRequired</a><a href="#variant.TransactionConfirmed">TransactionConfirmed</a><a href="#variant.TransactionNotFound">TransactionNotFound</a><a href="#variant.Uncapable">Uncapable</a><a href="#variant.UnknownUTXO">UnknownUTXO</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Error">Error</a><a href="#impl-From%3CAddressValidatorError%3E">From<AddressValidatorError></a><a href="#impl-From%3CCompactFiltersError%3E">From<CompactFiltersError></a><a href="#impl-From%3CError%3E">From<Error></a><a href="#impl-From%3CEsploraError%3E">From<EsploraError></a><a href="#impl-From%3CPolicyError%3E">From<PolicyError></a><a href="#impl-From%3CSignerError%3E">From<SignerError></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='index.html'>bdk</a></p><script>window.sidebarCurrent = {name: 'Error', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/bdk/error.rs.html#31-86' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='index.html'>bdk</a>::<wbr><a class="enum" href=''>Error</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Error {
+ KeyMismatch(PublicKey, PublicKey),
+ MissingInputUTXO(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>),
+ InvalidU32Bytes(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>),
+ Generic(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
+ ScriptDoesntHaveAddressForm,
+ SendAllMultipleOutputs,
+ NoAddressees,
+ OutputBelowDustLimit(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>),
+ InsufficientFunds,
+ InvalidAddressNetwork(Address),
+ UnknownUTXO,
+ DifferentTransactions,
+ TransactionNotFound,
+ TransactionConfirmed,
+ IrreplaceableTransaction,
+ FeeRateTooLow {
+ required: <a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>,
+ },
+ ChecksumMismatch,
+ DifferentDescriptorStructure,
+ SpendingPolicyRequired,
+ InvalidPolicyPathError(<a class="enum" href="../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a>),
+ Signer(<a class="enum" href="../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a>),
+ Uncapable(<a class="enum" href="../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a>),
+ OfflineClient,
+ InvalidProgressValue(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>),
+ ProgressUpdateError,
+ MissingCachedAddresses,
+ InvalidOutpoint(OutPoint),
+ Descriptor(<a class="enum" href="../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a>),
+ AddressValidator(<a class="enum" href="../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>),
+ Encode(Error),
+ Miniscript(Error),
+ BIP32(Error),
+ Secp256k1(Error),
+ JSON(<a class="struct" href="https://docs.rs/serde_json/1.0.57/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>),
+ Hex(Error),
+ PSBT(Error),
+ Electrum(Error),
+ Esplora(<a class="enum" href="../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a>),
+ CompactFilters(<a class="enum" href="../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>),
+ Sled(Error),
+}</pre></div><div class='docblock'><p>Errors that can be thrown by the <a href="crate::wallet::Wallet"><code>Wallet</code></a></p>
+</div><h2 id='variants' class='variants small-section-header'>
+ Variants<a href='#variants' class='anchor'></a></h2>
+<div id="variant.KeyMismatch" class="variant small-section-header"><a href="#variant.KeyMismatch" class="anchor field"></a><code id='KeyMismatch.v'>KeyMismatch(PublicKey, PublicKey)</code></div><div id="variant.MissingInputUTXO" class="variant small-section-header"><a href="#variant.MissingInputUTXO" class="anchor field"></a><code id='MissingInputUTXO.v'>MissingInputUTXO(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></div><div id="variant.InvalidU32Bytes" class="variant small-section-header"><a href="#variant.InvalidU32Bytes" class="anchor field"></a><code id='InvalidU32Bytes.v'>InvalidU32Bytes(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>)</code></div><div id="variant.Generic" class="variant small-section-header"><a href="#variant.Generic" class="anchor field"></a><code id='Generic.v'>Generic(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></div><div id="variant.ScriptDoesntHaveAddressForm" class="variant small-section-header"><a href="#variant.ScriptDoesntHaveAddressForm" class="anchor field"></a><code id='ScriptDoesntHaveAddressForm.v'>ScriptDoesntHaveAddressForm</code></div><div id="variant.SendAllMultipleOutputs" class="variant small-section-header"><a href="#variant.SendAllMultipleOutputs" class="anchor field"></a><code id='SendAllMultipleOutputs.v'>SendAllMultipleOutputs</code></div><div id="variant.NoAddressees" class="variant small-section-header"><a href="#variant.NoAddressees" class="anchor field"></a><code id='NoAddressees.v'>NoAddressees</code></div><div id="variant.OutputBelowDustLimit" class="variant small-section-header"><a href="#variant.OutputBelowDustLimit" class="anchor field"></a><code id='OutputBelowDustLimit.v'>OutputBelowDustLimit(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></div><div id="variant.InsufficientFunds" class="variant small-section-header"><a href="#variant.InsufficientFunds" class="anchor field"></a><code id='InsufficientFunds.v'>InsufficientFunds</code></div><div id="variant.InvalidAddressNetwork" class="variant small-section-header"><a href="#variant.InvalidAddressNetwork" class="anchor field"></a><code id='InvalidAddressNetwork.v'>InvalidAddressNetwork(Address)</code></div><div id="variant.UnknownUTXO" class="variant small-section-header"><a href="#variant.UnknownUTXO" class="anchor field"></a><code id='UnknownUTXO.v'>UnknownUTXO</code></div><div id="variant.DifferentTransactions" class="variant small-section-header"><a href="#variant.DifferentTransactions" class="anchor field"></a><code id='DifferentTransactions.v'>DifferentTransactions</code></div><div id="variant.TransactionNotFound" class="variant small-section-header"><a href="#variant.TransactionNotFound" class="anchor field"></a><code id='TransactionNotFound.v'>TransactionNotFound</code></div><div id="variant.TransactionConfirmed" class="variant small-section-header"><a href="#variant.TransactionConfirmed" class="anchor field"></a><code id='TransactionConfirmed.v'>TransactionConfirmed</code></div><div id="variant.IrreplaceableTransaction" class="variant small-section-header"><a href="#variant.IrreplaceableTransaction" class="anchor field"></a><code id='IrreplaceableTransaction.v'>IrreplaceableTransaction</code></div><div id="variant.FeeRateTooLow" class="variant small-section-header"><a href="#variant.FeeRateTooLow" class="anchor field"></a><code id='FeeRateTooLow.v'>FeeRateTooLow</code></div><div class='autohide sub-variant' id='variant.FeeRateTooLow.fields'><h3>Fields of <b>FeeRateTooLow</b></h3><div><span id="variant.FeeRateTooLow.field.required" class="variant small-section-header"><a href="#variant.FeeRateTooLow.field.required" class="anchor field"></a><code id='FeeRateTooLow.v.required.v'>required: <a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a></code></span></div></div><div id="variant.ChecksumMismatch" class="variant small-section-header"><a href="#variant.ChecksumMismatch" class="anchor field"></a><code id='ChecksumMismatch.v'>ChecksumMismatch</code></div><div id="variant.DifferentDescriptorStructure" class="variant small-section-header"><a href="#variant.DifferentDescriptorStructure" class="anchor field"></a><code id='DifferentDescriptorStructure.v'>DifferentDescriptorStructure</code></div><div id="variant.SpendingPolicyRequired" class="variant small-section-header"><a href="#variant.SpendingPolicyRequired" class="anchor field"></a><code id='SpendingPolicyRequired.v'>SpendingPolicyRequired</code></div><div id="variant.InvalidPolicyPathError" class="variant small-section-header"><a href="#variant.InvalidPolicyPathError" class="anchor field"></a><code id='InvalidPolicyPathError.v'>InvalidPolicyPathError(<a class="enum" href="../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a>)</code></div><div id="variant.Signer" class="variant small-section-header"><a href="#variant.Signer" class="anchor field"></a><code id='Signer.v'>Signer(<a class="enum" href="../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a>)</code></div><div id="variant.Uncapable" class="variant small-section-header"><a href="#variant.Uncapable" class="anchor field"></a><code id='Uncapable.v'>Uncapable(<a class="enum" href="../bdk/blockchain/enum.Capability.html" title="enum bdk::blockchain::Capability">Capability</a>)</code></div><div id="variant.OfflineClient" class="variant small-section-header"><a href="#variant.OfflineClient" class="anchor field"></a><code id='OfflineClient.v'>OfflineClient</code></div><div id="variant.InvalidProgressValue" class="variant small-section-header"><a href="#variant.InvalidProgressValue" class="anchor field"></a><code id='InvalidProgressValue.v'>InvalidProgressValue(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>)</code></div><div id="variant.ProgressUpdateError" class="variant small-section-header"><a href="#variant.ProgressUpdateError" class="anchor field"></a><code id='ProgressUpdateError.v'>ProgressUpdateError</code></div><div id="variant.MissingCachedAddresses" class="variant small-section-header"><a href="#variant.MissingCachedAddresses" class="anchor field"></a><code id='MissingCachedAddresses.v'>MissingCachedAddresses</code></div><div id="variant.InvalidOutpoint" class="variant small-section-header"><a href="#variant.InvalidOutpoint" class="anchor field"></a><code id='InvalidOutpoint.v'>InvalidOutpoint(OutPoint)</code></div><div id="variant.Descriptor" class="variant small-section-header"><a href="#variant.Descriptor" class="anchor field"></a><code id='Descriptor.v'>Descriptor(<a class="enum" href="../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a>)</code></div><div id="variant.AddressValidator" class="variant small-section-header"><a href="#variant.AddressValidator" class="anchor field"></a><code id='AddressValidator.v'>AddressValidator(<a class="enum" href="../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>)</code></div><div id="variant.Encode" class="variant small-section-header"><a href="#variant.Encode" class="anchor field"></a><code id='Encode.v'>Encode(Error)</code></div><div id="variant.Miniscript" class="variant small-section-header"><a href="#variant.Miniscript" class="anchor field"></a><code id='Miniscript.v'>Miniscript(Error)</code></div><div id="variant.BIP32" class="variant small-section-header"><a href="#variant.BIP32" class="anchor field"></a><code id='BIP32.v'>BIP32(Error)</code></div><div id="variant.Secp256k1" class="variant small-section-header"><a href="#variant.Secp256k1" class="anchor field"></a><code id='Secp256k1.v'>Secp256k1(Error)</code></div><div id="variant.JSON" class="variant small-section-header"><a href="#variant.JSON" class="anchor field"></a><code id='JSON.v'>JSON(<a class="struct" href="https://docs.rs/serde_json/1.0.57/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>)</code></div><div id="variant.Hex" class="variant small-section-header"><a href="#variant.Hex" class="anchor field"></a><code id='Hex.v'>Hex(Error)</code></div><div id="variant.PSBT" class="variant small-section-header"><a href="#variant.PSBT" class="anchor field"></a><code id='PSBT.v'>PSBT(Error)</code></div><div id="variant.Electrum" class="variant small-section-header"><a href="#variant.Electrum" class="anchor field"></a><code id='Electrum.v'>Electrum(Error)</code></div><div id="variant.Esplora" class="variant small-section-header"><a href="#variant.Esplora" class="anchor field"></a><code id='Esplora.v'>Esplora(<a class="enum" href="../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a>)</code></div><div id="variant.CompactFilters" class="variant small-section-header"><a href="#variant.CompactFilters" class="anchor field"></a><code id='CompactFilters.v'>CompactFilters(<a class="enum" href="../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>)</code></div><div id="variant.Sled" class="variant small-section-header"><a href="#variant.Sled" class="anchor field"></a><code id='Sled.v'>Sled(Error)</code></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#30' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../src/bdk/error.rs.html#30' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#88-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../src/bdk/error.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Error' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-Error' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#94' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.source' class="method hidden"><code id='source.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source' class='fnname'>source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><span class='since' title='Stable since Rust version 1.30.0'>1.30.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#100-102' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
+</div><h4 id='method.backtrace' class="method hidden"><code id='backtrace.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace' class='fnname'>backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#128-130' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>backtrace</code>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
+</div><h4 id='method.description' class="method hidden"><code id='description.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description' class='fnname'>description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#140-142' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
+</div></div><div class='docblock hidden'><p><code>if let Err(e) = "xc".parse::<u32>() { // Print </code>e<code> itself, no need for description(). eprintln!("Error: {}", e); }</code> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></p>
+</div><h4 id='method.cause' class="method hidden"><code id='cause.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#150-152' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
+</div></div></div><h3 id='impl-From%3CAddressValidatorError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CAddressValidatorError%3E' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>) -> Self</code><a class='srclink' href='../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CCompactFiltersError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CCompactFiltersError%3E' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#133-140' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-14' class="method hidden"><code id='from.v-14'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(other: <a class="enum" href="../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>) -> Self</code><a class='srclink' href='../src/bdk/error.rs.html#134-139' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a>> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CError%3E' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a>) -> Self</code><a class='srclink' href='../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-1' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CError%3E-1' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-4' class="method hidden"><code id='from.v-4'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-10' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a>> for <a class="enum" href="../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-From%3CError%3E-10' class='anchor'></a><a class='srclink' href='../src/bdk/blockchain/compact_filters/mod.rs.html#523-527' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-15' class="method hidden"><code id='from.v-15'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a>) -> Self</code><a class='srclink' href='../src/bdk/blockchain/compact_filters/mod.rs.html#524-526' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-2' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CError%3E-2' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-5' class="method hidden"><code id='from.v-5'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-3' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CError%3E-3' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-6' class="method hidden"><code id='from.v-6'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-4' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CError%3E-4' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-7' class="method hidden"><code id='from.v-7'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-5' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://docs.rs/serde_json/1.0.57/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CError%3E-5' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-8' class="method hidden"><code id='from.v-8'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="struct" href="https://docs.rs/serde_json/1.0.57/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>) -> Self</code><a class='srclink' href='../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-6' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CError%3E-6' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-9' class="method hidden"><code id='from.v-9'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-7' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CError%3E-7' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-10' class="method hidden"><code id='from.v-10'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-8' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CError%3E-8' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-11' class="method hidden"><code id='from.v-11'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CError%3E-9' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CError%3E-9' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-13' class="method hidden"><code id='from.v-13'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CEsploraError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a>> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CEsploraError%3E' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-12' class="method hidden"><code id='from.v-12'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a>) -> Self</code><a class='srclink' href='../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CPolicyError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a>> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CPolicyError%3E' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code id='from.v-2'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a>) -> Self</code><a class='srclink' href='../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CSignerError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a>> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CSignerError%3E' class='anchor'></a><a class='srclink' href='../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-3' class="method hidden"><code id='from.v-3'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a>) -> Self</code><a class='srclink' href='../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-16' class="method hidden"><code id='from.v-16'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2219-2229' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2221-2228' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "bdk";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ScriptType` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, ScriptType"><title>bdk::ScriptType - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../bdk/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Enum ScriptType</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.External">External</a><a href="#variant.Internal">Internal</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.as_byte">as_byte</a><a href="#method.is_internal">is_internal</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-AsRef%3C%5Bu8%5D%3E">AsRef<[u8]></a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Eq">Eq</a><a href="#impl-Hash">Hash</a><a href="#impl-PartialEq%3CScriptType%3E">PartialEq<ScriptType></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Base32Len">Base32Len</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-CheckBase32%3CVec%3Cu5%3E%3E">CheckBase32<Vec<u5>></a><a href="#impl-DeserializeOwned">DeserializeOwned</a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToBase32">ToBase32</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='index.html'>bdk</a></p><script>window.sidebarCurrent = {name: 'ScriptType', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/bdk/types.rs.html#34-37' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='index.html'>bdk</a>::<wbr><a class="enum" href=''>ScriptType</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum ScriptType {
+ External,
+ Internal,
+}</pre></div><div class='docblock'><p>Types of script</p>
+</div><h2 id='variants' class='variants small-section-header'>
+ Variants<a href='#variants' class='anchor'></a></h2>
+<div id="variant.External" class="variant small-section-header"><a href="#variant.External" class="anchor field"></a><code id='External.v'>External</code></div><div id="variant.Internal" class="variant small-section-header"><a href="#variant.Internal" class="anchor field"></a><code id='Internal.v'>Internal</code></div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#39-50' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.as_byte' class="method"><code id='as_byte.v'>pub fn <a href='#method.as_byte' class='fnname'>as_byte</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code><a class='srclink' href='../src/bdk/types.rs.html#40-45' title='goto source code'>[src]</a></h4><h4 id='method.is_internal' class="method"><code id='is_internal.v'>pub fn <a href='#method.is_internal' class='fnname'>is_internal</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/bdk/types.rs.html#47-49' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-AsRef%3C%5Bu8%5D%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>> for <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a href='#impl-AsRef%3C%5Bu8%5D%3E' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#52-59' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.as_ref' class="method hidden"><code id='as_ref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html#tymethod.as_ref' class='fnname'>as_ref</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a></code><a class='srclink' href='../src/bdk/types.rs.html#53-58' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a class='srclink' href='../src/bdk/types.rs.html#33' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../src/bdk/types.rs.html#33' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Deserialize%3C%27de%3E' class='impl'><code class='in-band'>impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a href='#impl-Deserialize%3C%27de%3E' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deserialize' class="method hidden"><code id='deserialize.v'>fn <a href='https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html#tymethod.deserialize' class='fnname'>deserialize</a><__D>(__deserializer: __D) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, __D::<a class="type" href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> __D: <a class="trait" href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class='srclink' href='../src/bdk/types.rs.html#33' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
+</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code id='hash.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H)</code><a class='srclink' href='../src/bdk/types.rs.html#33' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
+</div><h4 id='method.hash_slice' class="method hidden"><code id='hash_slice.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#192-199' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
+</div></div><h3 id='impl-PartialEq%3CScriptType%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>> for <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a href='#impl-PartialEq%3CScriptType%3E' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/bdk/types.rs.html#33' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
+</div><h4 id='method.ne' class="method hidden"><code id='ne.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#216-218' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
+</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code id='serialize.v'>fn <a href='https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../src/bdk/types.rs.html#33' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
+</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Base32Len' class='impl'><code class='in-band'>impl<T> Base32Len for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>, </span></code><a href='#impl-Base32Len' class='anchor'></a></h3><div class='impl-items'><h4 id='method.base32_len' class="method hidden"><code id='base32_len.v'>fn <a href='#method.base32_len' class='fnname'>base32_len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Calculate the base32 serialized length</p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-CheckBase32%3CVec%3Cu5%3E%3E' class='impl'><code class='in-band'>impl<'f, T> CheckBase32<<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><u5>> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>, </span></code><a href='#impl-CheckBase32%3CVec%3Cu5%3E%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='associatedtype.Err' class="type"><code id='Err.t'>type <a href='#associatedtype.Err' class="type">Err</a> = Error</code></h4><div class='docblock'><p>Error type if conversion fails</p>
+</div><h4 id='method.check_base32' class="method hidden"><code id='check_base32.v'>fn <a href='#method.check_base32' class='fnname'>check_base32</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><u5>, <T as CheckBase32<<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><u5>>>::Err></code></h4><div class='docblock hidden'><p>Check if all values are in range and return array-like struct of <code>u5</code> values</p>
+</div></div><h3 id='impl-DeserializeOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://docs.rs/serde/1.0.116/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> for T <span class="where fmt-newline">where<br> T: for<'de> <a class="trait" href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de>, </span></code><a href='#impl-DeserializeOwned' class='anchor'></a><a class='srclink' href='https://docs.rs/serde/1.0.116/src/serde/de/mod.rs.html#604' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToBase32' class='impl'><code class='in-band'>impl<T> ToBase32 for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>, </span></code><a href='#impl-ToBase32' class='anchor'></a></h3><div class='impl-items'><h4 id='method.write_base32' class="method hidden"><code id='write_base32.v'>fn <a href='#method.write_base32' class='fnname'>write_base32</a><W>(&self, writer: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>W) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <W as WriteBase32>::Err> <span class="where fmt-newline">where<br> W: WriteBase32, </span></code></h4><div class='docblock hidden'><p>Encode as base32 and write it to the supplied writer Implementations shouldn't allocate. <a href="#tymethod.write_base32">Read more</a></p>
+</div><h4 id='method.to_base32' class="method hidden"><code id='to_base32.v'>fn <a href='#method.to_base32' class='fnname'>to_base32</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><u5></code></h4><div class='docblock hidden'><p>Convert <code>Self</code> to base32 vector</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "bdk";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="refresh" content="0;URL=../../bdk/enum.Error.html">
+</head>
+<body>
+ <p>Redirecting to <a href="../../bdk/enum.Error.html">../../bdk/enum.Error.html</a>...</p>
+ <script>location.replace("../../bdk/enum.Error.html" + location.search + location.hash);</script>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `bdk` crate."><meta name="keywords" content="rust, rustlang, rust-lang, bdk"><title>bdk - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../bdk/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Crate bdk</p><div class="sidebar-elems"><a id='all-types' href='all.html'><p>See all bdk's items</p></a><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'bdk', ty: 'mod', relpath: '../'};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/bdk/lib.rs.html#27-88' title='goto source code'>[src]</a></span><span class='in-band'>Crate <a class="mod" href=''>bdk</a></span></h1><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
+<table><tr><td><code>pub extern crate bitcoin;</code></td></tr><tr><td><code>pub extern crate miniscript;</code></td></tr><tr><td><code>pub extern crate electrum_client;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="https://docs.rs/reqwest/0.10.8/reqwest/index.html" title="mod reqwest">reqwest</a>;</code></td></tr><tr><td><code>pub extern crate sled;</code></td></tr><tr><td><code>pub use descriptor::<a class="type" href="../bdk/descriptor/type.HDKeyPaths.html" title="type bdk::descriptor::HDKeyPaths">HDKeyPaths</a>;</code></td></tr><tr><td><code>pub use wallet::<a class="mod" href="../bdk/wallet/address_validator/index.html" title="mod bdk::wallet::address_validator">address_validator</a>;</code></td></tr><tr><td><code>pub use wallet::<a class="mod" href="../bdk/wallet/signer/index.html" title="mod bdk::wallet::signer">signer</a>;</code></td></tr><tr><td><code>pub use wallet::tx_builder::<a class="struct" href="../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a>;</code></td></tr><tr><td><code>pub use wallet::<a class="type" href="../bdk/wallet/type.OfflineWallet.html" title="type bdk::wallet::OfflineWallet">OfflineWallet</a>;</code></td></tr><tr><td><code>pub use wallet::<a class="struct" href="../bdk/wallet/struct.Wallet.html" title="struct bdk::wallet::Wallet">Wallet</a>;</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
+<table><tr class='module-item'><td><a class="mod" href="blockchain/index.html" title='bdk::blockchain mod'>blockchain</a></td><td class='docblock-short'><p>Blockchain backends</p>
+</td></tr><tr class='module-item'><td><a class="mod" href="database/index.html" title='bdk::database mod'>database</a></td><td class='docblock-short'><p>Database types</p>
+</td></tr><tr class='module-item'><td><a class="mod" href="descriptor/index.html" title='bdk::descriptor mod'>descriptor</a></td><td class='docblock-short'><p>Descriptors</p>
+</td></tr><tr class='module-item'><td><a class="mod" href="wallet/index.html" title='bdk::wallet mod'>wallet</a></td><td class='docblock-short'><p>Wallet</p>
+</td></tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
+<table><tr class='module-item'><td><a class="struct" href="struct.FeeRate.html" title='bdk::FeeRate struct'>FeeRate</a></td><td class='docblock-short'><p>Fee rate</p>
+</td></tr><tr class='module-item'><td><a class="struct" href="struct.TransactionDetails.html" title='bdk::TransactionDetails struct'>TransactionDetails</a></td><td class='docblock-short'><p>A wallet transaction</p>
+</td></tr><tr class='module-item'><td><a class="struct" href="struct.UTXO.html" title='bdk::UTXO struct'>UTXO</a></td><td class='docblock-short'><p>A wallet unspent output</p>
+</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
+<table><tr class='module-item'><td><a class="enum" href="enum.Error.html" title='bdk::Error enum'>Error</a></td><td class='docblock-short'><p>Errors that can be thrown by the <a href="crate::wallet::Wallet"><code>Wallet</code></a></p>
+</td></tr><tr class='module-item'><td><a class="enum" href="enum.ScriptType.html" title='bdk::ScriptType enum'>ScriptType</a></td><td class='docblock-short'><p>Types of script</p>
+</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "bdk";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"enum":[["Error","Errors that can be thrown by the `Wallet`"],["ScriptType","Types of script"]],"mod":[["blockchain","Blockchain backends"],["database","Database types"],["descriptor","Descriptors"],["wallet","Wallet"]],"struct":[["FeeRate","Fee rate"],["TransactionDetails","A wallet transaction"],["UTXO","A wallet unspent output"]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `FeeRate` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, FeeRate"><title>bdk::FeeRate - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../bdk/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct FeeRate</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.as_sat_vb">as_sat_vb</a><a href="#method.default_min_relay_fee">default_min_relay_fee</a><a href="#method.from_btc_per_kvb">from_btc_per_kvb</a><a href="#method.from_sat_per_vb">from_sat_per_vb</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-PartialEq%3CFeeRate%3E">PartialEq<FeeRate></a><a href="#impl-PartialOrd%3CFeeRate%3E">PartialOrd<FeeRate></a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='index.html'>bdk</a></p><script>window.sidebarCurrent = {name: 'FeeRate', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/bdk/types.rs.html#64' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>bdk</a>::<wbr><a class="struct" href=''>FeeRate</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct FeeRate(_);</pre></div><div class='docblock'><p>Fee rate</p>
+</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#66-86' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from_btc_per_kvb' class="method"><code id='from_btc_per_kvb.v'>pub fn <a href='#method.from_btc_per_kvb' class='fnname'>from_btc_per_kvb</a>(btc_per_kvb: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>) -> Self</code><a class='srclink' href='../src/bdk/types.rs.html#68-70' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new instance of [<code>FeeRate</code>] given a float fee rate in btc/kvbytes</p>
+</div><h4 id='method.from_sat_per_vb' class="method"><code id='from_sat_per_vb.v'>pub fn <a href='#method.from_sat_per_vb' class='fnname'>from_sat_per_vb</a>(sat_per_vb: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>) -> Self</code><a class='srclink' href='../src/bdk/types.rs.html#73-75' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new instance of [<code>FeeRate</code>] given a float fee rate in satoshi/vbyte</p>
+</div><h4 id='method.default_min_relay_fee' class="method"><code id='default_min_relay_fee.v'>pub fn <a href='#method.default_min_relay_fee' class='fnname'>default_min_relay_fee</a>() -> Self</code><a class='srclink' href='../src/bdk/types.rs.html#78-80' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new [<code>FeeRate</code>] with the default min relay fee value</p>
+</div><h4 id='method.as_sat_vb' class="method"><code id='as_sat_vb.v'>pub fn <a href='#method.as_sat_vb' class='fnname'>as_sat_vb</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a></code><a class='srclink' href='../src/bdk/types.rs.html#83-85' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the value as satoshi/vbyte</p>
+</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#62' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a></code><a class='srclink' href='../src/bdk/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#62' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#62' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../src/bdk/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#88-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> Self</code><a class='srclink' href='../src/bdk/types.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
+</div></div><h3 id='impl-PartialEq%3CFeeRate%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>> for <a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a></code><a href='#impl-PartialEq%3CFeeRate%3E' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#62' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/bdk/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
+</div><h4 id='method.ne' class="method hidden"><code id='ne.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/bdk/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
+</div></div><h3 id='impl-PartialOrd%3CFeeRate%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>> for <a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a></code><a href='#impl-PartialOrd%3CFeeRate%3E' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#62' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code id='partial_cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../src/bdk/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
+</div><h4 id='method.lt' class="method hidden"><code id='lt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: &<a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/bdk/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
+</div><h4 id='method.le' class="method hidden"><code id='le.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: &<a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/bdk/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
+</div><h4 id='method.gt' class="method hidden"><code id='gt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: &<a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/bdk/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
+</div><h4 id='method.ge' class="method hidden"><code id='ge.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: &<a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/bdk/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
+</div></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#62' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "bdk";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `TransactionDetails` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, TransactionDetails"><title>bdk::TransactionDetails - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../bdk/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct TransactionDetails</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.fees">fees</a><a href="#structfield.height">height</a><a href="#structfield.received">received</a><a href="#structfield.sent">sent</a><a href="#structfield.timestamp">timestamp</a><a href="#structfield.transaction">transaction</a><a href="#structfield.txid">txid</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Eq">Eq</a><a href="#impl-PartialEq%3CTransactionDetails%3E">PartialEq<TransactionDetails></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-DeserializeOwned">DeserializeOwned</a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='index.html'>bdk</a></p><script>window.sidebarCurrent = {name: 'TransactionDetails', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/bdk/types.rs.html#104-112' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>bdk</a>::<wbr><a class="struct" href=''>TransactionDetails</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct TransactionDetails {
+ pub transaction: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>,
+ pub txid: Txid,
+ pub timestamp: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
+ pub received: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
+ pub sent: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
+ pub fees: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
+ pub height: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>,
+}</pre></div><div class='docblock'><p>A wallet transaction</p>
+</div><h2 id='fields' class='fields small-section-header'>
+ Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.transaction" class="structfield small-section-header"><a href="#structfield.transaction" class="anchor field"></a><code id="transaction.v">transaction: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction></code></span><span id="structfield.txid" class="structfield small-section-header"><a href="#structfield.txid" class="anchor field"></a><code id="txid.v">txid: Txid</code></span><span id="structfield.timestamp" class="structfield small-section-header"><a href="#structfield.timestamp" class="anchor field"></a><code id="timestamp.v">timestamp: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></code></span><span id="structfield.received" class="structfield small-section-header"><a href="#structfield.received" class="anchor field"></a><code id="received.v">received: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></code></span><span id="structfield.sent" class="structfield small-section-header"><a href="#structfield.sent" class="anchor field"></a><code id="sent.v">sent: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></code></span><span id="structfield.fees" class="structfield small-section-header"><a href="#structfield.fees" class="anchor field"></a><code id="fees.v">fees: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></code></span><span id="structfield.height" class="structfield small-section-header"><a href="#structfield.height" class="anchor field"></a><code id="height.v">height: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>></code></span><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a></code><a class='srclink' href='../src/bdk/types.rs.html#103' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../src/bdk/types.rs.html#103' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a></code><a class='srclink' href='../src/bdk/types.rs.html#103' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
+</div></div><h3 id='impl-Deserialize%3C%27de%3E' class='impl'><code class='in-band'>impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a></code><a href='#impl-Deserialize%3C%27de%3E' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deserialize' class="method hidden"><code id='deserialize.v'>fn <a href='https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html#tymethod.deserialize' class='fnname'>deserialize</a><__D>(__deserializer: __D) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, __D::<a class="type" href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> __D: <a class="trait" href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class='srclink' href='../src/bdk/types.rs.html#103' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
+</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-PartialEq%3CTransactionDetails%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>> for <a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a></code><a href='#impl-PartialEq%3CTransactionDetails%3E' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/bdk/types.rs.html#103' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
+</div><h4 id='method.ne' class="method hidden"><code id='ne.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/bdk/types.rs.html#103' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
+</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code id='serialize.v'>fn <a href='https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../src/bdk/types.rs.html#103' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
+</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-DeserializeOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://docs.rs/serde/1.0.116/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> for T <span class="where fmt-newline">where<br> T: for<'de> <a class="trait" href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de>, </span></code><a href='#impl-DeserializeOwned' class='anchor'></a><a class='srclink' href='https://docs.rs/serde/1.0.116/src/serde/de/mod.rs.html#604' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "bdk";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `UTXO` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, UTXO"><title>bdk::UTXO - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../bdk/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct UTXO</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.is_internal">is_internal</a><a href="#structfield.outpoint">outpoint</a><a href="#structfield.txout">txout</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Eq">Eq</a><a href="#impl-PartialEq%3CUTXO%3E">PartialEq<UTXO></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-DeserializeOwned">DeserializeOwned</a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='index.html'>bdk</a></p><script>window.sidebarCurrent = {name: 'UTXO', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/bdk/types.rs.html#96-100' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>bdk</a>::<wbr><a class="struct" href=''>UTXO</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct UTXO {
+ pub outpoint: OutPoint,
+ pub txout: TxOut,
+ pub is_internal: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
+}</pre></div><div class='docblock'><p>A wallet unspent output</p>
+</div><h2 id='fields' class='fields small-section-header'>
+ Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.outpoint" class="structfield small-section-header"><a href="#structfield.outpoint" class="anchor field"></a><code id="outpoint.v">outpoint: OutPoint</code></span><span id="structfield.txout" class="structfield small-section-header"><a href="#structfield.txout" class="anchor field"></a><code id="txout.v">txout: TxOut</code></span><span id="structfield.is_internal" class="structfield small-section-header"><a href="#structfield.is_internal" class="anchor field"></a><code id="is_internal.v">is_internal: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#95' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a></code><a class='srclink' href='../src/bdk/types.rs.html#95' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#95' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../src/bdk/types.rs.html#95' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Deserialize%3C%27de%3E' class='impl'><code class='in-band'>impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a></code><a href='#impl-Deserialize%3C%27de%3E' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#95' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deserialize' class="method hidden"><code id='deserialize.v'>fn <a href='https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html#tymethod.deserialize' class='fnname'>deserialize</a><__D>(__deserializer: __D) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, __D::<a class="type" href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> __D: <a class="trait" href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class='srclink' href='../src/bdk/types.rs.html#95' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
+</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#95' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-PartialEq%3CUTXO%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>> for <a class="struct" href="../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a></code><a href='#impl-PartialEq%3CUTXO%3E' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#95' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/bdk/types.rs.html#95' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
+</div><h4 id='method.ne' class="method hidden"><code id='ne.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="struct" href="../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/bdk/types.rs.html#95' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
+</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#95' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code id='serialize.v'>fn <a href='https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../src/bdk/types.rs.html#95' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
+</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#95' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../src/bdk/types.rs.html#95' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-DeserializeOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://docs.rs/serde/1.0.116/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> for T <span class="where fmt-newline">where<br> T: for<'de> <a class="trait" href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de>, </span></code><a href='#impl-DeserializeOwned' class='anchor'></a><a class='srclink' href='https://docs.rs/serde/1.0.116/src/serde/de/mod.rs.html#604' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "bdk";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="refresh" content="0;URL=../../bdk/enum.ScriptType.html">
+</head>
+<body>
+ <p>Redirecting to <a href="../../bdk/enum.ScriptType.html">../../bdk/enum.ScriptType.html</a>...</p>
+ <script>location.replace("../../bdk/enum.ScriptType.html" + location.search + location.hash);</script>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="refresh" content="0;URL=../../bdk/struct.FeeRate.html">
+</head>
+<body>
+ <p>Redirecting to <a href="../../bdk/struct.FeeRate.html">../../bdk/struct.FeeRate.html</a>...</p>
+ <script>location.replace("../../bdk/struct.FeeRate.html" + location.search + location.hash);</script>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="refresh" content="0;URL=../../bdk/struct.TransactionDetails.html">
+</head>
+<body>
+ <p>Redirecting to <a href="../../bdk/struct.TransactionDetails.html">../../bdk/struct.TransactionDetails.html</a>...</p>
+ <script>location.replace("../../bdk/struct.TransactionDetails.html" + location.search + location.hash);</script>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="refresh" content="0;URL=../../bdk/struct.UTXO.html">
+</head>
+<body>
+ <p>Redirecting to <a href="../../bdk/struct.UTXO.html">../../bdk/struct.UTXO.html</a>...</p>
+ <script>location.replace("../../bdk/struct.UTXO.html" + location.search + location.hash);</script>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `AddressValidatorError` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, AddressValidatorError"><title>bdk::wallet::address_validator::AddressValidatorError - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum AddressValidatorError</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.ConnectionError">ConnectionError</a><a href="#variant.InvalidScript">InvalidScript</a><a href="#variant.Message">Message</a><a href="#variant.TimeoutError">TimeoutError</a><a href="#variant.UserRejected">UserRejected</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-Error">Error</a><a href="#impl-From%3CAddressValidatorError%3E">From<AddressValidatorError></a><a href="#impl-PartialEq%3CAddressValidatorError%3E">PartialEq<AddressValidatorError></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>address_validator</a></p><script>window.sidebarCurrent = {name: 'AddressValidatorError', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/address_validator.rs.html#86-92' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>address_validator</a>::<wbr><a class="enum" href=''>AddressValidatorError</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum AddressValidatorError {
+ UserRejected,
+ ConnectionError,
+ TimeoutError,
+ InvalidScript,
+ Message(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
+}</pre></div><div class='docblock'><p>Errors that can be returned to fail the validation of an address</p>
+</div><h2 id='variants' class='variants small-section-header'>
+ Variants<a href='#variants' class='anchor'></a></h2>
+<div id="variant.UserRejected" class="variant small-section-header"><a href="#variant.UserRejected" class="anchor field"></a><code id='UserRejected.v'>UserRejected</code></div><div id="variant.ConnectionError" class="variant small-section-header"><a href="#variant.ConnectionError" class="anchor field"></a><code id='ConnectionError.v'>ConnectionError</code></div><div id="variant.TimeoutError" class="variant small-section-header"><a href="#variant.TimeoutError" class="anchor field"></a><code id='TimeoutError.v'>TimeoutError</code></div><div id="variant.InvalidScript" class="variant small-section-header"><a href="#variant.InvalidScript" class="anchor field"></a><code id='InvalidScript.v'>InvalidScript</code></div><div id="variant.Message" class="variant small-section-header"><a href="#variant.Message" class="anchor field"></a><code id='Message.v'>Message(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a class='srclink' href='../../../src/bdk/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/address_validator.rs.html#94-98' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/wallet/address_validator.rs.html#95-97' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Error' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-Error' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/address_validator.rs.html#100' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.source' class="method hidden"><code id='source.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source' class='fnname'>source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><span class='since' title='Stable since Rust version 1.30.0'>1.30.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#100-102' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
+</div><h4 id='method.backtrace' class="method hidden"><code id='backtrace.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace' class='fnname'>backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#128-130' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>backtrace</code>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
+</div><h4 id='method.description' class="method hidden"><code id='description.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description' class='fnname'>description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#140-142' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
+</div></div><div class='docblock hidden'><p><code>if let Err(e) = "xc".parse::<u32>() { // Print </code>e<code> itself, no need for description(). eprintln!("Error: {}", e); }</code> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></p>
+</div><h4 id='method.cause' class="method hidden"><code id='cause.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#150-152' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
+</div></div></div><h3 id='impl-From%3CAddressValidatorError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>> for <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CAddressValidatorError%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>) -> Self</code><a class='srclink' href='../../../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-PartialEq%3CAddressValidatorError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>> for <a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-PartialEq%3CAddressValidatorError%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
+</div><h4 id='method.ne' class="method hidden"><code id='ne.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
+</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2219-2229' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2221-2228' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `address_validator` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, address_validator"><title>bdk::wallet::address_validator - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module address_validator</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'address_validator', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/address_validator.rs.html#25-162' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a class="mod" href=''>address_validator</a></span></h1><div class='docblock'><p>Address validation callbacks</p>
+<p>The typical usage of those callbacks is for displaying the newly-generated address on a
+hardware wallet, so that the user can cross-check its correctness.</p>
+<p>More generally speaking though, these callbacks can also be used to "do something" every time
+an address is generated, without necessarily checking or validating it.</p>
+<p>An address validator can be attached to a <a href="super::Wallet"><code>Wallet</code></a> by using the
+<a href="super::Wallet::add_address_validator"><code>Wallet::add_address_validator</code></a> method, and
+whenever a new address is generated (either explicitly by the user with
+<a href="super::Wallet::get_new_address"><code>Wallet::get_new_address</code></a> or internally to create a change
+address) all the attached validators will be polled, in sequence. All of them must complete
+successfully to continue.</p>
+<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">struct</span> <span class="ident">PrintAddressAndContinue</span>;
+
+<span class="kw">impl</span> <span class="ident">AddressValidator</span> <span class="kw">for</span> <span class="ident">PrintAddressAndContinue</span> {
+ <span class="kw">fn</span> <span class="ident">validate</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
+ <span class="ident">hd_keypaths</span>: <span class="kw-2">&</span><span class="ident">HDKeyPaths</span>,
+ <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">AddressValidatorError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">address</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_script</span>(<span class="ident">script</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>)
+ .<span class="ident">as_ref</span>()
+ .<span class="ident">map</span>(<span class="ident">Address</span>::<span class="ident">to_string</span>)
+ .<span class="ident">unwrap_or</span>(<span class="ident">script</span>.<span class="ident">to_string</span>());
+ <span class="macro">println</span><span class="macro">!</span>(<span class="string">"New address of type {:?}: {}"</span>, <span class="ident">script_type</span>, <span class="ident">address</span>);
+ <span class="macro">println</span><span class="macro">!</span>(<span class="string">"HD keypaths: {:#?}"</span>, <span class="ident">hd_keypaths</span>);
+
+ <span class="prelude-val">Ok</span>(())
+ }
+}
+
+<span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="string">"wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)"</span>;
+<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(<span class="ident">descriptor</span>, <span class="prelude-val">None</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>, <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>())<span class="question-mark">?</span>;
+<span class="ident">wallet</span>.<span class="ident">add_address_validator</span>(<span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">PrintAddressAndContinue</span>)));
+
+<span class="kw">let</span> <span class="ident">address</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>()<span class="question-mark">?</span>;
+<span class="macro">println</span><span class="macro">!</span>(<span class="string">"Address: {}"</span>, <span class="ident">address</span>);</pre></div>
+</div><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
+<table><tr class='module-item'><td><a class="enum" href="enum.AddressValidatorError.html" title='bdk::wallet::address_validator::AddressValidatorError enum'>AddressValidatorError</a></td><td class='docblock-short'><p>Errors that can be returned to fail the validation of an address</p>
+</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
+<table><tr class='module-item'><td><a class="trait" href="trait.AddressValidator.html" title='bdk::wallet::address_validator::AddressValidator trait'>AddressValidator</a></td><td class='docblock-short'><p>Trait to build address validators</p>
+</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"enum":[["AddressValidatorError","Errors that can be returned to fail the validation of an address"]],"trait":[["AddressValidator","Trait to build address validators"]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `AddressValidator` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, AddressValidator"><title>bdk::wallet::address_validator::AddressValidator - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait AddressValidator</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.validate">validate</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>address_validator</a></p><script>window.sidebarCurrent = {name: 'AddressValidator', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/address_validator.rs.html#109-117' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>address_validator</a>::<wbr><a class="trait" href=''>AddressValidator</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait AddressValidator {
+ fn <a href='#tymethod.validate' class='fnname'>validate</a>(<br> &self, <br> script_type: <a class="enum" href="../../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> hd_keypaths: &<a class="type" href="../../../bdk/descriptor/type.HDKeyPaths.html" title="type bdk::descriptor::HDKeyPaths">HDKeyPaths</a>, <br> script: &Script<br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>>;
+}</pre></div><div class='docblock'><p>Trait to build address validators</p>
+<p>All the address validators attached to a wallet with <a href="super::Wallet::add_address_validator"><code>Wallet::add_address_validator</code></a> will be polled
+every time an address (external or internal) is generated by the wallet. Errors returned in the
+validator will be propagated up to the original caller that triggered the address generation.</p>
+<p>For a usage example see <a href="crate::address_validator">this module</a>'s documentation.</p>
+</div>
+ <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.validate' class='method'><code id='validate.v'>fn <a href='#tymethod.validate' class='fnname'>validate</a>(<br> &self, <br> script_type: <a class="enum" href="../../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> hd_keypaths: &<a class="type" href="../../../bdk/descriptor/type.HDKeyPaths.html" title="type bdk::descriptor::HDKeyPaths">HDKeyPaths</a>, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>></code></h3><div class='docblock'><p>Validate or inspect an address</p>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../../implementors/bdk/wallet/address_validator/trait.AddressValidator.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `coin_selection` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, coin_selection"><title>bdk::wallet::coin_selection - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module coin_selection</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'coin_selection', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/coin_selection.rs.html#25-349' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a class="mod" href=''>coin_selection</a></span></h1><div class='docblock'><p>Coin selection</p>
+<p>This module provides the trait [<code>CoinSelectionAlgorithm</code>] that can be implemented to
+define custom coin selection algorithms.</p>
+<p>The coin selection algorithm is not globally part of a <a href="super::Wallet"><code>Wallet</code></a>, instead it
+is selected whenever a <a href="super::Wallet::create_tx"><code>Wallet::create_tx</code></a> call is made, through
+the use of the <a href="super::tx_builder::TxBuilder"><code>TxBuilder</code></a> structure, specifically with
+<a href="super::tx_builder::TxBuilder::coin_selection"><code>TxBuilder::coin_selection</code></a> method.</p>
+<p>The [<code>DefaultCoinSelectionAlgorithm</code>] selects the default coin selection algorithm that
+<a href="super::tx_builder::TxBuilder"><code>TxBuilder</code></a> uses, if it's not explicitly overridden.</p>
+<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
+<span class="kw">struct</span> <span class="ident">AlwaysSpendEverything</span>;
+
+<span class="kw">impl</span> <span class="ident">CoinSelectionAlgorithm</span> <span class="kw">for</span> <span class="ident">AlwaysSpendEverything</span> {
+ <span class="kw">fn</span> <span class="ident">coin_select</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>,
+ <span class="ident">_use_all_utxos</span>: <span class="ident">bool</span>,
+ <span class="ident">fee_rate</span>: <span class="ident">FeeRate</span>,
+ <span class="ident">amount_needed</span>: <span class="ident">u64</span>,
+ <span class="ident">input_witness_weight</span>: <span class="ident">usize</span>,
+ <span class="ident">fee_amount</span>: <span class="ident">f32</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CoinSelectionResult</span>, <span class="ident">bdk</span>::<span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">selected_amount</span> <span class="op">=</span> <span class="ident">utxos</span>.<span class="ident">iter</span>().<span class="ident">fold</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">acc</span>, <span class="ident">utxo</span><span class="op">|</span> <span class="ident">acc</span> <span class="op">+</span> <span class="ident">utxo</span>.<span class="ident">txout</span>.<span class="ident">value</span>);
+ <span class="kw">let</span> <span class="ident">all_utxos_selected</span> <span class="op">=</span> <span class="ident">utxos</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">utxo</span><span class="op">|</span> {
+ (
+ <span class="ident">TxIn</span> {
+ <span class="ident">previous_output</span>: <span class="ident">utxo</span>.<span class="ident">outpoint</span>,
+ ..<span class="ident">Default</span>::<span class="ident">default</span>()
+ },
+ <span class="ident">utxo</span>.<span class="ident">txout</span>.<span class="ident">script_pubkey</span>,
+ )
+ })
+ .<span class="ident">collect</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span><span class="op">></span>();
+ <span class="kw">let</span> <span class="ident">additional_weight</span> <span class="op">=</span> <span class="ident">all_utxos_selected</span>.<span class="ident">iter</span>().<span class="ident">fold</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">acc</span>, (<span class="ident">txin</span>, <span class="kw">_</span>)<span class="op">|</span> {
+ <span class="ident">acc</span> <span class="op">+</span> <span class="ident">serialize</span>(<span class="ident">txin</span>).<span class="ident">len</span>() <span class="op">*</span> <span class="number">4</span> <span class="op">+</span> <span class="ident">input_witness_weight</span>
+ });
+ <span class="kw">let</span> <span class="ident">additional_fees</span> <span class="op">=</span> <span class="ident">additional_weight</span> <span class="kw">as</span> <span class="ident">f32</span> <span class="op">*</span> <span class="ident">fee_rate</span>.<span class="ident">as_sat_vb</span>() <span class="op">/</span> <span class="number">4.0</span>;
+
+ <span class="kw">if</span> (<span class="ident">fee_amount</span> <span class="op">+</span> <span class="ident">additional_fees</span>).<span class="ident">ceil</span>() <span class="kw">as</span> <span class="ident">u64</span> <span class="op">+</span> <span class="ident">amount_needed</span> <span class="op">></span> <span class="ident">selected_amount</span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">bdk</span>::<span class="ident">Error</span>::<span class="ident">InsufficientFunds</span>);
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">CoinSelectionResult</span> {
+ <span class="ident">txin</span>: <span class="ident">all_utxos_selected</span>,
+ <span class="ident">selected_amount</span>,
+ <span class="ident">fee_amount</span>: <span class="ident">fee_amount</span> <span class="op">+</span> <span class="ident">additional_fees</span>,
+ })
+ }
+}
+
+<span class="comment">// create wallet, sync, ...</span>
+
+<span class="kw">let</span> <span class="ident">to_address</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="string">"2N4eQYCbKUHCCTUjBJeHcJp9ok6J2GZsTDt"</span>).<span class="ident">unwrap</span>();
+<span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">to_address</span>.<span class="ident">script_pubkey</span>(), <span class="number">50_000</span>)])
+ .<span class="ident">coin_selection</span>(<span class="ident">AlwaysSpendEverything</span>),
+)<span class="question-mark">?</span>;
+
+<span class="comment">// inspect, sign, broadcast, ...</span>
+</pre></div>
+</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
+<table><tr class='module-item'><td><a class="struct" href="struct.CoinSelectionResult.html" title='bdk::wallet::coin_selection::CoinSelectionResult struct'>CoinSelectionResult</a></td><td class='docblock-short'><p>Result of a successful coin selection</p>
+</td></tr><tr class='module-item'><td><a class="struct" href="struct.DumbCoinSelection.html" title='bdk::wallet::coin_selection::DumbCoinSelection struct'>DumbCoinSelection</a></td><td class='docblock-short'><p>Simple and dumb coin selection</p>
+</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
+<table><tr class='module-item'><td><a class="trait" href="trait.CoinSelectionAlgorithm.html" title='bdk::wallet::coin_selection::CoinSelectionAlgorithm trait'>CoinSelectionAlgorithm</a></td><td class='docblock-short'><p>Trait for generalized coin selection algorithms</p>
+</td></tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
+<table><tr class='module-item'><td><a class="type" href="type.DefaultCoinSelectionAlgorithm.html" title='bdk::wallet::coin_selection::DefaultCoinSelectionAlgorithm type'>DefaultCoinSelectionAlgorithm</a></td><td class='docblock-short'><p>Default coin selection algorithm used by <a href="super::tx_builder::TxBuilder"><code>TxBuilder</code></a> if not
+overridden</p>
+</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"struct":[["CoinSelectionResult","Result of a successful coin selection"],["DumbCoinSelection","Simple and dumb coin selection"]],"trait":[["CoinSelectionAlgorithm","Trait for generalized coin selection algorithms"]],"type":[["DefaultCoinSelectionAlgorithm","Default coin selection algorithm used by `TxBuilder` if not overridden"]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `CoinSelectionResult` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, CoinSelectionResult"><title>bdk::wallet::coin_selection::CoinSelectionResult - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct CoinSelectionResult</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.fee_amount">fee_amount</a><a href="#structfield.selected_amount">selected_amount</a><a href="#structfield.txin">txin</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>coin_selection</a></p><script>window.sidebarCurrent = {name: 'CoinSelectionResult', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/coin_selection.rs.html#117-124' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>coin_selection</a>::<wbr><a class="struct" href=''>CoinSelectionResult</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct CoinSelectionResult {
+ pub txin: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>TxIn, Script<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>,
+ pub selected_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
+ pub fee_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>,
+}</pre></div><div class='docblock'><p>Result of a successful coin selection</p>
+</div><h2 id='fields' class='fields small-section-header'>
+ Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.txin" class="structfield small-section-header"><a href="#structfield.txin" class="anchor field"></a><code id="txin.v">txin: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>TxIn, Script<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></code></span><div class='docblock'><p>List of inputs to use, with the respective previous script_pubkey</p>
+</div><span id="structfield.selected_amount" class="structfield small-section-header"><a href="#structfield.selected_amount" class="anchor field"></a><code id="selected_amount.v">selected_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></code></span><div class='docblock'><p>Sum of the selected inputs' value</p>
+</div><span id="structfield.fee_amount" class="structfield small-section-header"><a href="#structfield.fee_amount" class="anchor field"></a><code id="fee_amount.v">fee_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a></code></span><div class='docblock'><p>Total fee amount in satoshi</p>
+</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct bdk::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/coin_selection.rs.html#116' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/wallet/coin_selection.rs.html#116' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct bdk::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct bdk::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct bdk::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct bdk::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct bdk::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `DumbCoinSelection` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, DumbCoinSelection"><title>bdk::wallet::coin_selection::DumbCoinSelection - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct DumbCoinSelection</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-CoinSelectionAlgorithm">CoinSelectionAlgorithm</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>coin_selection</a></p><script>window.sidebarCurrent = {name: 'DumbCoinSelection', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/coin_selection.rs.html#157' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>coin_selection</a>::<wbr><a class="struct" href=''>DumbCoinSelection</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct DumbCoinSelection;</pre></div><div class='docblock'><p>Simple and dumb coin selection</p>
+<p>This coin selection algorithm sorts the available UTXOs by value and then picks them starting
+from the largest ones until the required amount is reached.</p>
+</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-CoinSelectionAlgorithm' class='impl'><code class='in-band'>impl <a class="trait" href="../../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait bdk::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct bdk::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-CoinSelectionAlgorithm' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/coin_selection.rs.html#159-216' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.coin_select' class="method hidden"><code id='coin_select.v'>fn <a href='../../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html#tymethod.coin_select' class='fnname'>coin_select</a>(<br> &self, <br> utxos: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <br> use_all_utxos: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <br> fee_rate: <a class="struct" href="../../../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>, <br> outgoing_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>, <br> input_witness_weight: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br> fee_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../bdk/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct bdk::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/wallet/coin_selection.rs.html#160-215' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Perform the coin selection <a href="../../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html#tymethod.coin_select">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct bdk::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/coin_selection.rs.html#156' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/wallet/coin_selection.rs.html#156' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct bdk::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/coin_selection.rs.html#156' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../../bdk/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct bdk::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a class='srclink' href='../../../src/bdk/wallet/coin_selection.rs.html#156' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct bdk::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct bdk::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct bdk::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct bdk::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct bdk::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `CoinSelectionAlgorithm` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, CoinSelectionAlgorithm"><title>bdk::wallet::coin_selection::CoinSelectionAlgorithm - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait CoinSelectionAlgorithm</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.coin_select">coin_select</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>coin_selection</a></p><script>window.sidebarCurrent = {name: 'CoinSelectionAlgorithm', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/coin_selection.rs.html#132-150' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>coin_selection</a>::<wbr><a class="trait" href=''>CoinSelectionAlgorithm</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait CoinSelectionAlgorithm: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> {
+ fn <a href='#tymethod.coin_select' class='fnname'>coin_select</a>(<br> &self, <br> utxos: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <br> use_all_utxos: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <br> fee_rate: <a class="struct" href="../../../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>, <br> amount_needed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>, <br> input_witness_weight: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br> fee_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../bdk/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct bdk::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+}</pre></div><div class='docblock'><p>Trait for generalized coin selection algorithms</p>
+<p>This trait can be implemented to make the <a href="super::Wallet"><code>Wallet</code></a> use a customized coin
+selection algorithm when it creates transactions.</p>
+<p>For an example see <a href="crate::wallet::coin_selection">this module</a>'s documentation.</p>
+</div>
+ <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.coin_select' class='method'><code id='coin_select.v'>fn <a href='#tymethod.coin_select' class='fnname'>coin_select</a>(<br> &self, <br> utxos: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <br> use_all_utxos: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <br> fee_rate: <a class="struct" href="../../../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>, <br> amount_needed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>, <br> input_witness_weight: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br> fee_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../bdk/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct bdk::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code></h3><div class='docblock'><p>Perform the coin selection</p>
+<ul>
+<li><code>utxos</code>: the list of spendable UTXOs</li>
+<li><code>use_all_utxos</code>: if true all utxos should be spent unconditionally</li>
+<li><code>fee_rate</code>: fee rate to use</li>
+<li><code>amount_needed</code>: the amount in satoshi to select</li>
+<li><code>input_witness_weight</code>: the weight of an input's witness to keep into account for the fees</li>
+<li><code>fee_amount</code>: the amount of fees in satoshi already accumulated from adding outputs</li>
+</ul>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-CoinSelectionAlgorithm' class='impl'><code class='in-band'>impl CoinSelectionAlgorithm for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct bdk::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-CoinSelectionAlgorithm' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/coin_selection.rs.html#159-216' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.coin_select' class="method hidden"><code id='coin_select.v-1'>fn <a href='#method.coin_select' class='fnname'>coin_select</a>(<br> &self, <br> utxos: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <br> use_all_utxos: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <br> fee_rate: <a class="struct" href="../../../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>, <br> outgoing_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>, <br> input_witness_weight: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br> fee_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../bdk/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct bdk::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a>, <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../../src/bdk/wallet/coin_selection.rs.html#160-215' title='goto source code'>[src]</a></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../../implementors/bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `DefaultCoinSelectionAlgorithm` type in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, DefaultCoinSelectionAlgorithm"><title>bdk::wallet::coin_selection::DefaultCoinSelectionAlgorithm - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition DefaultCoinSelectionAlgorithm</p><div class="sidebar-elems"><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>coin_selection</a></p><script>window.sidebarCurrent = {name: 'DefaultCoinSelectionAlgorithm', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/coin_selection.rs.html#113' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>coin_selection</a>::<wbr><a class="type" href=''>DefaultCoinSelectionAlgorithm</a></span></h1><pre class='rust typedef'>type DefaultCoinSelectionAlgorithm = <a class="struct" href="../../../bdk/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct bdk::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a>;</pre><div class='docblock'><p>Default coin selection algorithm used by <a href="super::tx_builder::TxBuilder"><code>TxBuilder</code></a> if not
+overridden</p>
+</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `export` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, export"><title>bdk::wallet::export - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module export</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'export', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/export.rs.html#25-340' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a class="mod" href=''>export</a></span></h1><div class='docblock'><p>Wallet export</p>
+<p>This modules implements the wallet export format used by <a href="https://github.com/Fonta1n3/FullyNoded/blob/10b7808c8b929b171cca537fb50522d015168ac9/Docs/Wallets/Wallet-Export-Spec.md">FullyNoded</a>.</p>
+<h2 id="examples" class="section-header"><a href="#examples">Examples</a></h2><h3 id="import-from-json" class="section-header"><a href="#import-from-json">Import from JSON</a></h3>
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> <span class="ident">import</span> <span class="op">=</span> <span class="string">r#"{
+ "descriptor": "wpkh([c258d2e4\/84h\/1h\/0h]tpubDD3ynpHgJQW8VvWRzQ5WFDCrs4jqVFGHB3vLC3r49XHJSqP8bHKdK4AriuUKLccK68zfzowx7YhmDN8SiSkgCDENUFx9qVw65YyqM78vyVe\/0\/*)",
+ "blockheight":1782088,
+ "label":"testnet"
+}"#</span>;
+
+<span class="kw">let</span> <span class="ident">import</span> <span class="op">=</span> <span class="ident">WalletExport</span>::<span class="ident">from_str</span>(<span class="ident">import</span>)<span class="question-mark">?</span>;
+<span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(<span class="kw-2">&</span><span class="ident">import</span>.<span class="ident">descriptor</span>(), <span class="ident">import</span>.<span class="ident">change_descriptor</span>().<span class="ident">as_deref</span>(), <span class="ident">Network</span>::<span class="ident">Testnet</span>, <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>())<span class="question-mark">?</span>;</pre></div>
+<h3 id="export-a-wallet" class="section-header"><a href="#export-a-wallet">Export a <code>Wallet</code></a></h3>
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(
+ <span class="string">"wpkh([c258d2e4/84h/1h/0h]tpubDD3ynpHgJQW8VvWRzQ5WFDCrs4jqVFGHB3vLC3r49XHJSqP8bHKdK4AriuUKLccK68zfzowx7YhmDN8SiSkgCDENUFx9qVw65YyqM78vyVe/0/*)"</span>,
+ <span class="prelude-val">Some</span>(<span class="string">"wpkh([c258d2e4/84h/1h/0h]tpubDD3ynpHgJQW8VvWRzQ5WFDCrs4jqVFGHB3vLC3r49XHJSqP8bHKdK4AriuUKLccK68zfzowx7YhmDN8SiSkgCDENUFx9qVw65YyqM78vyVe/1/*)"</span>),
+ <span class="ident">Network</span>::<span class="ident">Testnet</span>,
+ <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>()
+)<span class="question-mark">?</span>;
+<span class="kw">let</span> <span class="ident">export</span> <span class="op">=</span> <span class="ident">WalletExport</span>::<span class="ident">export_wallet</span>(<span class="kw-2">&</span><span class="ident">wallet</span>, <span class="string">"exported wallet"</span>, <span class="bool-val">true</span>)
+ .<span class="ident">map_err</span>(<span class="ident">ToString</span>::<span class="ident">to_string</span>)
+ .<span class="ident">map_err</span>(<span class="ident">bdk</span>::<span class="ident">Error</span>::<span class="ident">Generic</span>)<span class="question-mark">?</span>;
+
+<span class="macro">println</span><span class="macro">!</span>(<span class="string">"Exported: {}"</span>, <span class="ident">export</span>.<span class="ident">to_string</span>());</pre></div>
+</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
+<table><tr class='module-item'><td><a class="struct" href="struct.WalletExport.html" title='bdk::wallet::export::WalletExport struct'>WalletExport</a></td><td class='docblock-short'><p>Structure that contains the export of a wallet</p>
+</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"struct":[["WalletExport","Structure that contains the export of a wallet"]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `WalletExport` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, WalletExport"><title>bdk::wallet::export::WalletExport - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct WalletExport</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.blockheight">blockheight</a><a href="#structfield.label">label</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.change_descriptor">change_descriptor</a><a href="#method.descriptor">descriptor</a><a href="#method.export_wallet">export_wallet</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-FromStr">FromStr</a><a href="#impl-Serialize">Serialize</a><a href="#impl-ToString">ToString</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-DeserializeOwned">DeserializeOwned</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>export</a></p><script>window.sidebarCurrent = {name: 'WalletExport', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/export.rs.html#84-90' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>export</a>::<wbr><a class="struct" href=''>WalletExport</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct WalletExport {
+ pub blockheight: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
+ pub label: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
+ // some fields omitted
+}</pre></div><div class='docblock'><p>Structure that contains the export of a wallet</p>
+<p>For a usage example see <a href="crate::wallet::export">this module</a>'s documentation.</p>
+</div><h2 id='fields' class='fields small-section-header'>
+ Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.blockheight" class="structfield small-section-header"><a href="#structfield.blockheight" class="anchor field"></a><code id="blockheight.v">blockheight: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code></span><div class='docblock'><p>Earliest block to rescan when looking for the wallet's transactions</p>
+</div><span id="structfield.label" class="structfield small-section-header"><a href="#structfield.label" class="anchor field"></a><code id="label.v">label: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></span><div class='docblock'><p>Arbitrary label for the wallet</p>
+</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../bdk/wallet/export/struct.WalletExport.html" title="struct bdk::wallet::export::WalletExport">WalletExport</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/export.rs.html#106-197' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.export_wallet' class="method"><code id='export_wallet.v'>pub fn <a href='#method.export_wallet' class='fnname'>export_wallet</a><B: <a class="trait" href="../../../bdk/blockchain/trait.BlockchainMarker.html" title="trait bdk::blockchain::BlockchainMarker">BlockchainMarker</a>, D: <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>>(<br> wallet: &<a class="struct" href="../../../bdk/wallet/struct.Wallet.html" title="struct bdk::wallet::Wallet">Wallet</a><B, D>, <br> label: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> include_blockheight: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>></code><a class='srclink' href='../../../src/bdk/wallet/export.rs.html#118-158' title='goto source code'>[src]</a></h4><div class='docblock'><p>Export a wallet</p>
+<p>This function returns an error if it determines that the <code>wallet</code>'s descriptor(s) are not
+supported by Bitcoin Core or don't follow the standard derivation paths defined by BIP44
+and others.</p>
+<p>If <code>include_blockheight</code> is <code>true</code>, this function will look into the <code>wallet</code>'s database
+for the oldest transaction it knows and use that as the earliest block to rescan.</p>
+<p>If the database is empty or <code>include_blockheight</code> is false, the <code>blockheight</code> field
+returned will be <code>0</code>.</p>
+</div><h4 id='method.descriptor' class="method"><code id='descriptor.v'>pub fn <a href='#method.descriptor' class='fnname'>descriptor</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='../../../src/bdk/wallet/export.rs.html#183-185' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the external descriptor</p>
+</div><h4 id='method.change_descriptor' class="method"><code id='change_descriptor.v'>pub fn <a href='#method.change_descriptor' class='fnname'>change_descriptor</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code><a class='srclink' href='../../../src/bdk/wallet/export.rs.html#188-196' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the internal descriptor, if present</p>
+</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../bdk/wallet/export/struct.WalletExport.html" title="struct bdk::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/export.rs.html#83' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/wallet/export.rs.html#83' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Deserialize%3C%27de%3E' class='impl'><code class='in-band'>impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="../../../bdk/wallet/export/struct.WalletExport.html" title="struct bdk::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-Deserialize%3C%27de%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/export.rs.html#83' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deserialize' class="method hidden"><code id='deserialize.v'>fn <a href='https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html#tymethod.deserialize' class='fnname'>deserialize</a><__D>(__deserializer: __D) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, __D::<a class="type" href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> __D: <a class="trait" href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class='srclink' href='../../../src/bdk/wallet/export.rs.html#83' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
+</div></div><h3 id='impl-FromStr' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a> for <a class="struct" href="../../../bdk/wallet/export/struct.WalletExport.html" title="struct bdk::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-FromStr' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/export.rs.html#98-104' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Err' class="type"><code id='Err.t'>type <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err' class="type">Err</a> = <a class="struct" href="https://docs.rs/serde_json/1.0.57/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a></code></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
+</div><h4 id='method.from_str' class="method hidden"><code id='from_str.v'>fn <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str' class='fnname'>from_str</a>(s: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>></code><a class='srclink' href='../../../src/bdk/wallet/export.rs.html#101-103' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str">Read more</a></p>
+</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../../../bdk/wallet/export/struct.WalletExport.html" title="struct bdk::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/export.rs.html#83' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code id='serialize.v'>fn <a href='https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../../../src/bdk/wallet/export.rs.html#83' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
+</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for <a class="struct" href="../../../bdk/wallet/export/struct.WalletExport.html" title="struct bdk::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/export.rs.html#92-96' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='../../../src/bdk/wallet/export.rs.html#93-95' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../bdk/wallet/export/struct.WalletExport.html" title="struct bdk::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../bdk/wallet/export/struct.WalletExport.html" title="struct bdk::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../bdk/wallet/export/struct.WalletExport.html" title="struct bdk::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../bdk/wallet/export/struct.WalletExport.html" title="struct bdk::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../bdk/wallet/export/struct.WalletExport.html" title="struct bdk::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-DeserializeOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://docs.rs/serde/1.0.116/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> for T <span class="where fmt-newline">where<br> T: for<'de> <a class="trait" href="https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de>, </span></code><a href='#impl-DeserializeOwned' class='anchor'></a><a class='srclink' href='https://docs.rs/serde/1.0.116/src/serde/de/mod.rs.html#604' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToString-1' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString-1' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2219-2229' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string-1' class="method hidden"><code id='to_string.v-1'>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2221-2228' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `wallet` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, wallet"><title>bdk::wallet - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module wallet</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'><a href='../index.html'>bdk</a></p><script>window.sidebarCurrent = {name: 'wallet', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#25-2439' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>bdk</a>::<wbr><a class="mod" href=''>wallet</a></span></h1><div class='docblock'><p>Wallet</p>
+<p>This module defines the [<code>Wallet</code>] structure.</p>
+</div><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
+<table><tr class='module-item'><td><a class="mod" href="address_validator/index.html" title='bdk::wallet::address_validator mod'>address_validator</a></td><td class='docblock-short'><p>Address validation callbacks</p>
+</td></tr><tr class='module-item'><td><a class="mod" href="coin_selection/index.html" title='bdk::wallet::coin_selection mod'>coin_selection</a></td><td class='docblock-short'><p>Coin selection</p>
+</td></tr><tr class='module-item'><td><a class="mod" href="export/index.html" title='bdk::wallet::export mod'>export</a></td><td class='docblock-short'><p>Wallet export</p>
+</td></tr><tr class='module-item'><td><a class="mod" href="signer/index.html" title='bdk::wallet::signer mod'>signer</a></td><td class='docblock-short'><p>Generalized signers</p>
+</td></tr><tr class='module-item'><td><a class="mod" href="time/index.html" title='bdk::wallet::time mod'>time</a></td><td class='docblock-short'><p>Cross-platform time</p>
+</td></tr><tr class='module-item'><td><a class="mod" href="tx_builder/index.html" title='bdk::wallet::tx_builder mod'>tx_builder</a></td><td class='docblock-short'><p>Transaction builder</p>
+</td></tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
+<table><tr class='module-item'><td><a class="struct" href="struct.Wallet.html" title='bdk::wallet::Wallet struct'>Wallet</a></td><td class='docblock-short'><p>A Bitcoin wallet</p>
+</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
+<table><tr class='module-item'><td><a class="trait" href="trait.IsDust.html" title='bdk::wallet::IsDust trait'>IsDust</a></td><td class='docblock-short'><p>Trait to check if a value is below the dust limit</p>
+</td></tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
+<table><tr class='module-item'><td><a class="type" href="type.OfflineWallet.html" title='bdk::wallet::OfflineWallet type'>OfflineWallet</a></td><td class='docblock-short'><p>Type alias for a [<code>Wallet</code>] that uses [<code>OfflineBlockchain</code>]</p>
+</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"mod":[["address_validator","Address validation callbacks"],["coin_selection","Coin selection"],["export","Wallet export"],["signer","Generalized signers"],["time","Cross-platform time"],["tx_builder","Transaction builder"]],"struct":[["Wallet","A Bitcoin wallet"]],"trait":[["IsDust","Trait to check if a value is below the dust limit"]],"type":[["OfflineWallet","Type alias for a [`Wallet`] that uses [`OfflineBlockchain`]"]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `SignerError` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, SignerError"><title>bdk::wallet::signer::SignerError - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum SignerError</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.InputIndexOutOfRange">InputIndexOutOfRange</a><a href="#variant.InvalidNonWitnessUtxo">InvalidNonWitnessUtxo</a><a href="#variant.MissingHDKeypath">MissingHDKeypath</a><a href="#variant.MissingKey">MissingKey</a><a href="#variant.MissingNonWitnessUtxo">MissingNonWitnessUtxo</a><a href="#variant.MissingSighash">MissingSighash</a><a href="#variant.MissingWitnessScript">MissingWitnessScript</a><a href="#variant.MissingWitnessUtxo">MissingWitnessUtxo</a><a href="#variant.UserCanceled">UserCanceled</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-Error">Error</a><a href="#impl-From%3CSignerError%3E">From<SignerError></a><a href="#impl-PartialEq%3CSignerError%3E">PartialEq<SignerError></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a></p><script>window.sidebarCurrent = {name: 'SignerError', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#132-151' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a>::<wbr><a class="enum" href=''>SignerError</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum SignerError {
+ MissingKey,
+ UserCanceled,
+ MissingSighash,
+ InputIndexOutOfRange,
+ MissingNonWitnessUtxo,
+ InvalidNonWitnessUtxo,
+ MissingWitnessUtxo,
+ MissingWitnessScript,
+ MissingHDKeypath,
+}</pre></div><div class='docblock'><p>Signing error</p>
+</div><h2 id='variants' class='variants small-section-header'>
+ Variants<a href='#variants' class='anchor'></a></h2>
+<div id="variant.MissingKey" class="variant small-section-header"><a href="#variant.MissingKey" class="anchor field"></a><code id='MissingKey.v'>MissingKey</code></div><div class='docblock'><p>The private key is missing for the required public key</p>
+</div><div id="variant.UserCanceled" class="variant small-section-header"><a href="#variant.UserCanceled" class="anchor field"></a><code id='UserCanceled.v'>UserCanceled</code></div><div class='docblock'><p>The user canceled the operation</p>
+</div><div id="variant.MissingSighash" class="variant small-section-header"><a href="#variant.MissingSighash" class="anchor field"></a><code id='MissingSighash.v'>MissingSighash</code></div><div class='docblock'><p>The sighash is missing in the PSBT input</p>
+</div><div id="variant.InputIndexOutOfRange" class="variant small-section-header"><a href="#variant.InputIndexOutOfRange" class="anchor field"></a><code id='InputIndexOutOfRange.v'>InputIndexOutOfRange</code></div><div class='docblock'><p>Input index is out of range</p>
+</div><div id="variant.MissingNonWitnessUtxo" class="variant small-section-header"><a href="#variant.MissingNonWitnessUtxo" class="anchor field"></a><code id='MissingNonWitnessUtxo.v'>MissingNonWitnessUtxo</code></div><div class='docblock'><p>The <code>non_witness_utxo</code> field of the transaction is required to sign this input</p>
+</div><div id="variant.InvalidNonWitnessUtxo" class="variant small-section-header"><a href="#variant.InvalidNonWitnessUtxo" class="anchor field"></a><code id='InvalidNonWitnessUtxo.v'>InvalidNonWitnessUtxo</code></div><div class='docblock'><p>The <code>non_witness_utxo</code> specified is invalid</p>
+</div><div id="variant.MissingWitnessUtxo" class="variant small-section-header"><a href="#variant.MissingWitnessUtxo" class="anchor field"></a><code id='MissingWitnessUtxo.v'>MissingWitnessUtxo</code></div><div class='docblock'><p>The <code>witness_utxo</code> field of the transaction is required to sign this input</p>
+</div><div id="variant.MissingWitnessScript" class="variant small-section-header"><a href="#variant.MissingWitnessScript" class="anchor field"></a><code id='MissingWitnessScript.v'>MissingWitnessScript</code></div><div class='docblock'><p>The <code>witness_script</code> field of the transaction is requied to sign this input</p>
+</div><div id="variant.MissingHDKeypath" class="variant small-section-header"><a href="#variant.MissingHDKeypath" class="anchor field"></a><code id='MissingHDKeypath.v'>MissingHDKeypath</code></div><div class='docblock'><p>The fingerprint and derivation path are missing from the psbt input</p>
+</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#153-157' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#154-156' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Error' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a></code><a href='#impl-Error' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#159' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.source' class="method hidden"><code id='source.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source' class='fnname'>source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><span class='since' title='Stable since Rust version 1.30.0'>1.30.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#100-102' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
+</div><h4 id='method.backtrace' class="method hidden"><code id='backtrace.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace' class='fnname'>backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#128-130' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>backtrace</code>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
+</div><h4 id='method.description' class="method hidden"><code id='description.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description' class='fnname'>description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#140-142' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
+</div></div><div class='docblock hidden'><p><code>if let Err(e) = "xc".parse::<u32>() { // Print </code>e<code> itself, no need for description(). eprintln!("Error: {}", e); }</code> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></p>
+</div><h4 id='method.cause' class="method hidden"><code id='cause.v'>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#150-152' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
+</div></div></div><h3 id='impl-From%3CSignerError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a>> for <a class="enum" href="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href='#impl-From%3CSignerError%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a>) -> Self</code><a class='srclink' href='../../../src/bdk/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-PartialEq%3CSignerError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a>> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a></code><a href='#impl-PartialEq%3CSignerError%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
+</div><h4 id='method.ne' class="method hidden"><code id='ne.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#216-218' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
+</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2219-2229' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2221-2228' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `SignerId` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, SignerId"><title>bdk::wallet::signer::SignerId - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum SignerId</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Fingerprint">Fingerprint</a><a href="#variant.PkHash">PkHash</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Eq">Eq</a><a href="#impl-From%3CFingerprint%3E">From<Fingerprint></a><a href="#impl-From%3CHash%3E">From<Hash></a><a href="#impl-Hash">Hash</a><a href="#impl-PartialEq%3CSignerId%3CPk%3E%3E">PartialEq<SignerId<Pk>></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a></p><script>window.sidebarCurrent = {name: 'SignerId', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#113-116' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a>::<wbr><a class="enum" href=''>SignerId</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum SignerId<Pk: <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>> {
+ PkHash(<Pk as <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>),
+ Fingerprint(Fingerprint),
+}</pre></div><div class='docblock'><p>Identifier of a signer in the <code>SignersContainers</code>. Used as a key to find the right signer among
+multiple of them</p>
+</div><h2 id='variants' class='variants small-section-header'>
+ Variants<a href='#variants' class='anchor'></a></h2>
+<div id="variant.PkHash" class="variant small-section-header"><a href="#variant.PkHash" class="anchor field"></a><code id='PkHash.v'>PkHash(<Pk as <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>)</code></div><div id="variant.Fingerprint" class="variant small-section-header"><a href="#variant.Fingerprint" class="anchor field"></a><code id='Fingerprint.v'>Fingerprint(Fingerprint)</code></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-From%3CFingerprint%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Fingerprint> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><DescriptorPublicKey></code><a href='#impl-From%3CFingerprint%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#124-128' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(fing: Fingerprint) -> <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><DescriptorPublicKey></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#125-127' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-From%3CHash%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Hash> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><DescriptorPublicKey></code><a href='#impl-From%3CHash%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#118-122' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(hash: Hash) -> <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><DescriptorPublicKey></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#119-121' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code id='hash.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H)</code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
+</div><h4 id='method.hash_slice' class="method hidden"><code id='hash_slice.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#192-199' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
+</div></div><h3 id='impl-PartialEq%3CSignerId%3CPk%3E%3E' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> + <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk>> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk></code><a href='#impl-PartialEq%3CSignerId%3CPk%3E%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
+</div><h4 id='method.ne' class="method hidden"><code id='ne.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
+</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk> <span class="where fmt-newline">where<br> <Pk as <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>, </span></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk> <span class="where fmt-newline">where<br> <Pk as <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>, </span></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk> <span class="where fmt-newline">where<br> <Pk as <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk> <span class="where fmt-newline">where<br> <Pk as <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk> <span class="where fmt-newline">where<br> <Pk as <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>, </span></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code id='from.v-2'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `signer` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, signer"><title>bdk::wallet::signer - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module signer</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'signer', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#25-513' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a class="mod" href=''>signer</a></span></h1><div class='docblock'><p>Generalized signers</p>
+<p>This module provides the ability to add customized signers to a <a href="super::Wallet"><code>Wallet</code></a>
+through the <a href="super::Wallet::add_signer"><code>Wallet::add_signer</code></a> function.</p>
+
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
+<span class="kw">struct</span> <span class="ident">CustomSigner</span> {
+ <span class="ident">device</span>: <span class="ident">CustomHSM</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">CustomSigner</span> {
+ <span class="kw">fn</span> <span class="ident">connect</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">CustomSigner</span> { <span class="ident">device</span>: <span class="ident">CustomHSM</span>::<span class="ident">connect</span>() }
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">Signer</span> <span class="kw">for</span> <span class="ident">CustomSigner</span> {
+ <span class="kw">fn</span> <span class="ident">sign</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">psbt</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span>,
+ <span class="ident">input_index</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">SignerError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">input_index</span> <span class="op">=</span> <span class="ident">input_index</span>.<span class="ident">ok_or</span>(<span class="ident">SignerError</span>::<span class="ident">InputIndexOutOfRange</span>)<span class="question-mark">?</span>;
+ <span class="self">self</span>.<span class="ident">device</span>.<span class="ident">sign_input</span>(<span class="ident">psbt</span>, <span class="ident">input_index</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">fn</span> <span class="ident">sign_whole_tx</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="bool-val">false</span>
+ }
+}
+
+<span class="kw">let</span> <span class="ident">custom_signer</span> <span class="op">=</span> <span class="ident">CustomSigner</span>::<span class="ident">connect</span>();
+
+<span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="string">"wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)"</span>;
+<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(<span class="ident">descriptor</span>, <span class="prelude-val">None</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>, <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>())<span class="question-mark">?</span>;
+<span class="ident">wallet</span>.<span class="ident">add_signer</span>(
+ <span class="ident">ScriptType</span>::<span class="ident">External</span>,
+ <span class="ident">Fingerprint</span>::<span class="ident">from_str</span>(<span class="string">"e30f11b8"</span>).<span class="ident">unwrap</span>().<span class="ident">into</span>(),
+ <span class="ident">SignerOrdering</span>(<span class="number">200</span>),
+ <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">custom_signer</span>))
+);
+</pre></div>
+</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
+<table><tr class='module-item'><td><a class="struct" href="struct.SignerOrdering.html" title='bdk::wallet::signer::SignerOrdering struct'>SignerOrdering</a></td><td class='docblock-short'><p>Defines the order in which signers are called</p>
+</td></tr><tr class='module-item'><td><a class="struct" href="struct.SignersContainer.html" title='bdk::wallet::signer::SignersContainer struct'>SignersContainer</a></td><td class='docblock-short'><p>Container for multiple signers</p>
+</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
+<table><tr class='module-item'><td><a class="enum" href="enum.SignerError.html" title='bdk::wallet::signer::SignerError enum'>SignerError</a></td><td class='docblock-short'><p>Signing error</p>
+</td></tr><tr class='module-item'><td><a class="enum" href="enum.SignerId.html" title='bdk::wallet::signer::SignerId enum'>SignerId</a></td><td class='docblock-short'><p>Identifier of a signer in the <code>SignersContainers</code>. Used as a key to find the right signer among
+multiple of them</p>
+</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
+<table><tr class='module-item'><td><a class="trait" href="trait.Signer.html" title='bdk::wallet::signer::Signer trait'>Signer</a></td><td class='docblock-short'><p>Trait for signers</p>
+</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"enum":[["SignerError","Signing error"],["SignerId","Identifier of a signer in the `SignersContainers`. Used as a key to find the right signer among multiple of them"]],"struct":[["SignerOrdering","Defines the order in which signers are called"],["SignersContainer","Container for multiple signers"]],"trait":[["Signer","Trait for signers"]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `SignerOrdering` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, SignerOrdering"><title>bdk::wallet::signer::SignerOrdering - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct SignerOrdering</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Eq">Eq</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CSignerOrdering%3E">PartialEq<SignerOrdering></a><a href="#impl-PartialOrd%3CSignerOrdering%3E">PartialOrd<SignerOrdering></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a></p><script>window.sidebarCurrent = {name: 'SignerOrdering', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#285' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a>::<wbr><a class="struct" href=''>SignerOrdering</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct SignerOrdering(pub <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>);</pre></div><div class='docblock'><p>Defines the order in which signers are called</p>
+<p>The default value is <code>100</code>. Signers with an ordering above that will be called later,
+and they will thus see the partial signatures added to the transaction once they get to sign
+themselves.</p>
+</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#287-291' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> Self</code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#288-290' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
+</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-Ord' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code id='cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
+</div><h4 id='method.max' class="method hidden"><code id='max.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#600-605' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
+</div><h4 id='method.min' class="method hidden"><code id='min.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#620-625' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
+</div><h4 id='method.clamp' class="method hidden"><code id='clamp.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#647-659' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
+</div></div><h3 id='impl-PartialEq%3CSignerOrdering%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a>> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-PartialEq%3CSignerOrdering%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
+</div><h4 id='method.ne' class="method hidden"><code id='ne.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
+</div></div><h3 id='impl-PartialOrd%3CSignerOrdering%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a>> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-PartialOrd%3CSignerOrdering%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code id='partial_cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
+</div><h4 id='method.lt' class="method hidden"><code id='lt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: &<a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
+</div><h4 id='method.le' class="method hidden"><code id='le.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: &<a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
+</div><h4 id='method.gt' class="method hidden"><code id='gt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: &<a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
+</div><h4 id='method.ge' class="method hidden"><code id='ge.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: &<a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
+</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `SignersContainer` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, SignersContainer"><title>bdk::wallet::signer::SignersContainer - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct SignersContainer</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.add_external">add_external</a><a href="#method.as_key_map">as_key_map</a><a href="#method.find">find</a><a href="#method.ids">ids</a><a href="#method.new">new</a><a href="#method.remove">remove</a><a href="#method.signers">signers</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-From%3CHashMap%3CDescriptorPublicKey%2C%20DescriptorSecretKey%2C%20RandomState%3E%3E">From<HashMap<DescriptorPublicKey, DescriptorSecretKey, RandomState>></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a></p><script>window.sidebarCurrent = {name: 'SignersContainer', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#310-312' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a>::<wbr><a class="struct" href=''>SignersContainer</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct SignersContainer<Pk: <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>(_);</pre></div><div class='docblock'><p>Container for multiple signers</p>
+</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#314-322' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.as_key_map' class="method"><code id='as_key_map.v'>pub fn <a href='#method.as_key_map' class='fnname'>as_key_map</a>(&self) -> KeyMap</code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#315-321' title='goto source code'>[src]</a></h4></div><h3 id='impl-1' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="struct" href="../../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#351-400' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>() -> Self</code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#353-355' title='goto source code'>[src]</a></h4><div class='docblock'><p>Default constructor</p>
+</div><h4 id='method.add_external' class="method"><code id='add_external.v'>pub fn <a href='#method.add_external' class='fnname'>add_external</a>(<br> &mut self, <br> id: <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk>, <br> ordering: <a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a>, <br> signer: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../../bdk/wallet/signer/trait.Signer.html" title="trait bdk::wallet::signer::Signer">Signer</a>>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../../bdk/wallet/signer/trait.Signer.html" title="trait bdk::wallet::signer::Signer">Signer</a>>>></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#359-366' title='goto source code'>[src]</a></h4><div class='docblock'><p>Adds an external signer to the container for the specified id. Optionally returns the
+signer that was previosuly in the container, if any</p>
+</div><h4 id='method.remove' class="method"><code id='remove.v'>pub fn <a href='#method.remove' class='fnname'>remove</a>(<br> &mut self, <br> id: <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk>, <br> ordering: <a class="struct" href="../../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../../bdk/wallet/signer/trait.Signer.html" title="trait bdk::wallet::signer::Signer">Signer</a>>>></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#369-375' title='goto source code'>[src]</a></h4><div class='docblock'><p>Removes a signer from the container and returns it</p>
+</div><h4 id='method.ids' class="method"><code id='ids.v'>pub fn <a href='#method.ids' class='fnname'>ids</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><&<a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk>></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#378-383' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the list of identifiers of all the signers in the container</p>
+</div><h4 id='method.signers' class="method"><code id='signers.v'>pub fn <a href='#method.signers' class='fnname'>signers</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../../bdk/wallet/signer/trait.Signer.html" title="trait bdk::wallet::signer::Signer">Signer</a>>>></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#386-388' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the list of signers in the container, sorted by lowest to highest <code>ordering</code></p>
+</div><h4 id='method.find' class="method"><code id='find.v'>pub fn <a href='#method.find' class='fnname'>find</a>(&self, id: <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><Pk>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../../bdk/wallet/signer/trait.Signer.html" title="trait bdk::wallet::signer::Signer">Signer</a>>>></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#391-399' title='goto source code'>[src]</a></h4><div class='docblock'><p>Finds the signer with lowest ordering for a given id in the container.</p>
+</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#309' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#309' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#309' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#309' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#309' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#309' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
+</div></div><h3 id='impl-From%3CHashMap%3CDescriptorPublicKey%2C%20DescriptorSecretKey%2C%20RandomState%3E%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><DescriptorPublicKey, DescriptorSecretKey, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.RandomState.html" title="struct std::collections::hash::map::RandomState">RandomState</a>>> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey></code><a href='#impl-From%3CHashMap%3CDescriptorPublicKey%2C%20DescriptorSecretKey%2C%20RandomState%3E%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#324-349' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(keymap: KeyMap) -> <a class="struct" href="../../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#325-348' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<Pk> !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl<Pk> !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<Pk> !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><Pk> <span class="where fmt-newline">where<br> <Pk as <a class="trait" href="../../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type bdk::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl<Pk> !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Signer` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Signer"><title>bdk::wallet::signer::Signer - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait Signer</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.sign">sign</a><a href="#tymethod.sign_whole_tx">sign_whole_tx</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.descriptor_secret_key">descriptor_secret_key</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-Signer-for-DescriptorXKey%3CExtendedPrivKey%3E">DescriptorXKey<ExtendedPrivKey></a><a href="#impl-Signer-for-PrivateKey">PrivateKey</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a></p><script>window.sidebarCurrent = {name: 'Signer', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#165-189' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a>::<wbr><a class="trait" href=''>Signer</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait Signer: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> {
+ fn <a href='#tymethod.sign' class='fnname'>sign</a>(<br> &self, <br> psbt: &mut PartiallySignedTransaction, <br> input_index: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a>>;
+<div class='item-spacer'></div> fn <a href='#tymethod.sign_whole_tx' class='fnname'>sign_whole_tx</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>;
+
+ fn <a href='#method.descriptor_secret_key' class='fnname'>descriptor_secret_key</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><DescriptorSecretKey> { ... }
+}</pre></div><div class='docblock'><p>Trait for signers</p>
+<p>This trait can be implemented to provide customized signers to the wallet. For an example see
+<a href="crate::wallet::signer"><code>this module</code></a>'s documentation.</p>
+</div>
+ <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.sign' class='method'><code id='sign.v'>fn <a href='#tymethod.sign' class='fnname'>sign</a>(<br> &self, <br> psbt: &mut PartiallySignedTransaction, <br> input_index: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a>></code></h3><div class='docblock'><p>Sign a PSBT</p>
+<p>The <code>input_index</code> argument is only provided if the wallet doesn't declare to sign the whole
+transaction in one go (see [<code>Signer::sign_whole_tx</code>]). Otherwise its value is <code>None</code> and
+can be ignored.</p>
+</div><h3 id='tymethod.sign_whole_tx' class='method'><code id='sign_whole_tx.v'>fn <a href='#tymethod.sign_whole_tx' class='fnname'>sign_whole_tx</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h3><div class='docblock'><p>Return whether or not the signer signs the whole transaction in one go instead of every
+input individually</p>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='provided-methods' class='small-section-header'>Provided methods<a href='#provided-methods' class='anchor'></a></h2><div class='methods'><h3 id='method.descriptor_secret_key' class='method'><code id='descriptor_secret_key.v'>fn <a href='#method.descriptor_secret_key' class='fnname'>descriptor_secret_key</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><DescriptorSecretKey></code></h3><div class='docblock'><p>Return the secret key for the signer</p>
+<p>This is used internally to reconstruct the original descriptor that may contain secrets.
+External signers that are meant to keep key isolated should just return <code>None</code> here (which
+is the default for this method, if not overridden).</p>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-Signer-for-DescriptorXKey%3CExtendedPrivKey%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../../../bdk/wallet/signer/trait.Signer.html" title="trait bdk::wallet::signer::Signer">Signer</a> for DescriptorXKey<ExtendedPrivKey></code><a href='#impl-Signer-for-DescriptorXKey%3CExtendedPrivKey%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#191-225' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.sign' class="method hidden"><code id='sign.v-1'>fn <a href='#method.sign' class='fnname'>sign</a>(<br> &self, <br> psbt: &mut PartiallySignedTransaction, <br> input_index: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a>></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#192-216' title='goto source code'>[src]</a></h4><h4 id='method.sign_whole_tx' class="method hidden"><code id='sign_whole_tx.v-1'>fn <a href='#method.sign_whole_tx' class='fnname'>sign_whole_tx</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#218-220' title='goto source code'>[src]</a></h4><h4 id='method.descriptor_secret_key-1' class="method hidden"><code id='descriptor_secret_key.v-1'>fn <a href='#method.descriptor_secret_key' class='fnname'>descriptor_secret_key</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><DescriptorSecretKey></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#222-224' title='goto source code'>[src]</a></h4></div><h3 id='impl-Signer-for-PrivateKey' class='impl'><code class='in-band'>impl <a class="trait" href="../../../bdk/wallet/signer/trait.Signer.html" title="trait bdk::wallet::signer::Signer">Signer</a> for PrivateKey</code><a href='#impl-Signer-for-PrivateKey' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#227-277' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.sign-1' class="method hidden"><code id='sign.v-2'>fn <a href='#method.sign' class='fnname'>sign</a>(<br> &self, <br> psbt: &mut PartiallySignedTransaction, <br> input_index: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a>></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#228-268' title='goto source code'>[src]</a></h4><h4 id='method.sign_whole_tx-1' class="method hidden"><code id='sign_whole_tx.v-2'>fn <a href='#method.sign_whole_tx' class='fnname'>sign_whole_tx</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#270-272' title='goto source code'>[src]</a></h4><h4 id='method.descriptor_secret_key-2' class="method hidden"><code id='descriptor_secret_key.v-2'>fn <a href='#method.descriptor_secret_key' class='fnname'>descriptor_secret_key</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><DescriptorSecretKey></code><a class='srclink' href='../../../src/bdk/wallet/signer.rs.html#274-276' title='goto source code'>[src]</a></h4></div><span class='loading-content'>Loading content...</span>
+ <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../../implementors/bdk/wallet/signer/trait.Signer.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Wallet` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, Wallet"><title>bdk::wallet::Wallet - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Wallet</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.add_address_validator">add_address_validator</a><a href="#method.add_signer">add_signer</a><a href="#method.broadcast">broadcast</a><a href="#method.bump_fee">bump_fee</a><a href="#method.client">client</a><a href="#method.create_tx">create_tx</a><a href="#method.finalize_psbt">finalize_psbt</a><a href="#method.get_balance">get_balance</a><a href="#method.get_new_address">get_new_address</a><a href="#method.is_mine">is_mine</a><a href="#method.list_transactions">list_transactions</a><a href="#method.list_unspent">list_unspent</a><a href="#method.new">new</a><a href="#method.new_offline">new_offline</a><a href="#method.policies">policies</a><a href="#method.public_descriptor">public_descriptor</a><a href="#method.sign">sign</a><a href="#method.sync">sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'Wallet', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#85-100' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>wallet</a>::<wbr><a class="struct" href=''>Wallet</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Wallet<B: <a class="trait" href="../../bdk/blockchain/trait.BlockchainMarker.html" title="trait bdk::blockchain::BlockchainMarker">BlockchainMarker</a>, D: <a class="trait" href="../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>> { /* fields omitted */ }</pre></div><div class='docblock'><p>A Bitcoin wallet</p>
+<p>A wallet takes descriptors, a <a href="crate::database"><code>database</code></a> and a
+<a href="crate::blockchain"><code>blockchain</code></a> and implements the basic functions that a Bitcoin wallets
+needs to operate, like <a href="Wallet::get_new_address">generating addresses</a>, <a href="Wallet::get_balance">returning the balance</a>,
+<a href="Wallet::create_tx">creating transactions</a>, etc.</p>
+<p>A wallet can be either "online" if the <a href="crate::blockchain"><code>blockchain</code></a> type provided
+implements [<code>Blockchain</code>], or "offline" [<code>OfflineBlockchain</code>] is used. Offline wallets only expose
+methods that don't need any interaction with the blockchain to work.</p>
+</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<B, D> <a class="struct" href="../../bdk/wallet/struct.Wallet.html" title="struct bdk::wallet::Wallet">Wallet</a><B, D> <span class="where fmt-newline">where<br> B: <a class="trait" href="../../bdk/blockchain/trait.BlockchainMarker.html" title="trait bdk::blockchain::BlockchainMarker">BlockchainMarker</a>,<br> D: <a class="trait" href="../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>, </span></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#103-1075' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new_offline' class="method"><code id='new_offline.v'>pub fn <a href='#method.new_offline' class='fnname'>new_offline</a>(<br> descriptor: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> change_descriptor: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>, <br> network: Network, <br> database: D<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#109-153' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new "offline" wallet</p>
+</div><h4 id='method.get_new_address' class="method"><code id='get_new_address.v'>pub fn <a href='#method.get_new_address' class='fnname'>get_new_address</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Address, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#156-163' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return a newly generated address using the external descriptor</p>
+</div><h4 id='method.is_mine' class="method"><code id='is_mine.v'>pub fn <a href='#method.is_mine' class='fnname'>is_mine</a>(&self, script: &Script) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#166-168' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return whether or not a <code>script</code> is part of this wallet (either internal or external)</p>
+</div><h4 id='method.list_unspent' class="method"><code id='list_unspent.v'>pub fn <a href='#method.list_unspent' class='fnname'>list_unspent</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../bdk/struct.UTXO.html" title="struct bdk::UTXO">UTXO</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#174-176' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the list of unspent outputs of this wallet</p>
+<p>Note that this methods only operate on the internal database, which first needs to be
+[<code>Wallet::sync</code>] manually.</p>
+</div><h4 id='method.list_transactions' class="method"><code id='list_transactions.v'>pub fn <a href='#method.list_transactions' class='fnname'>list_transactions</a>(<br> &self, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#185-187' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the list of transactions made and received by the wallet</p>
+<p>Optionally fill the [<code>TransactionDetails::transaction</code>] field with the raw transaction if
+<code>include_raw</code> is <code>true</code>.</p>
+<p>Note that this methods only operate on the internal database, which first needs to be
+[<code>Wallet::sync</code>] manually.</p>
+</div><h4 id='method.get_balance' class="method"><code id='get_balance.v'>pub fn <a href='#method.get_balance' class='fnname'>get_balance</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#193-198' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the balance, meaning the sum of this wallet's unspent outputs' values</p>
+<p>Note that this methods only operate on the internal database, which first needs to be
+[<code>Wallet::sync</code>] manually.</p>
+</div><h4 id='method.add_signer' class="method"><code id='add_signer.v'>pub fn <a href='#method.add_signer' class='fnname'>add_signer</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>, <br> id: <a class="enum" href="../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a><DescriptorPublicKey>, <br> ordering: <a class="struct" href="../../bdk/wallet/signer/struct.SignerOrdering.html" title="struct bdk::wallet::signer::SignerOrdering">SignerOrdering</a>, <br> signer: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../bdk/wallet/signer/trait.Signer.html" title="trait bdk::wallet::signer::Signer">Signer</a>>><br>)</code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#203-216' title='goto source code'>[src]</a></h4><div class='docblock'><p>Add an external signer</p>
+<p>See <a href="signer">the <code>signer</code> module</a> for an example.</p>
+</div><h4 id='method.add_address_validator' class="method"><code id='add_address_validator.v'>pub fn <a href='#method.add_address_validator' class='fnname'>add_address_validator</a>(<br> &mut self, <br> validator: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../bdk/wallet/address_validator/trait.AddressValidator.html" title="trait bdk::wallet::address_validator::AddressValidator">AddressValidator</a>>><br>)</code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock'><p>Add an address validator</p>
+<p>See <a href="address_validator">the <code>address_validator</code> module</a> for an example.</p>
+</div><h4 id='method.create_tx' class="method"><code id='create_tx.v'>pub fn <a href='#method.create_tx' class='fnname'>create_tx</a><Cs: <a class="trait" href="../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait bdk::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a>>(<br> &self, <br> builder: <a class="struct" href="../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>PSBT, <a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#243-441' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new transaction following the options specified in the <code>builder</code></p>
+<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">to_address</span>.<span class="ident">script_pubkey</span>(), <span class="number">50_000</span>)])
+)<span class="question-mark">?</span>;
+<span class="comment">// sign and broadcast ...</span></pre></div>
+</div><h4 id='method.bump_fee' class="method"><code id='bump_fee.v'>pub fn <a href='#method.bump_fee' class='fnname'>bump_fee</a><Cs: <a class="trait" href="../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait bdk::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a>>(<br> &self, <br> txid: &Txid, <br> builder: <a class="struct" href="../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>PSBT, <a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#471-684' title='goto source code'>[src]</a></h4><div class='docblock'><p>Bump the fee of a transaction following the options specified in the <code>builder</code></p>
+<p>Return an error if the transaction is already confirmed or doesn't explicitly signal RBF.</p>
+<p><strong>NOTE</strong>: if the original transaction was made with [<code>TxBuilder::send_all</code>], the same
+option must be enabled when bumping its fees to correctly reduce the only output's value to
+increase the fees.</p>
+<h2 id="example-1" class="section-header"><a href="#example-1">Example</a></h2>
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">Txid</span>::<span class="ident">from_str</span>(<span class="string">"faff0a466b70f5d5f92bd757a92c1371d4838bdd5bc53a06764e2488e51ce8f8"</span>).<span class="ident">unwrap</span>();
+<span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">bump_fee</span>(
+ <span class="kw-2">&</span><span class="ident">txid</span>,
+ <span class="ident">TxBuilder</span>::<span class="ident">new</span>().<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">5.0</span>)),
+)<span class="question-mark">?</span>;
+<span class="comment">// sign and broadcast ...</span></pre></div>
+</div><h4 id='method.sign' class="method"><code id='sign.v'>pub fn <a href='#method.sign' class='fnname'>sign</a>(<br> &self, <br> psbt: PSBT, <br> assume_height: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>PSBT, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#701-722' title='goto source code'>[src]</a></h4><div class='docblock'><p>Sign a transaction with all the wallet's signers, in the order specified by every signer's
+[<code>SignerOrdering</code>]</p>
+<h2 id="example-2" class="section-header"><a href="#example-2">Example</a></h2>
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> (<span class="ident">signed_psbt</span>, <span class="ident">finalized</span>) <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">sign</span>(<span class="ident">psbt</span>, <span class="prelude-val">None</span>)<span class="question-mark">?</span>;</pre></div>
+</div><h4 id='method.policies' class="method"><code id='policies.v'>pub fn <a href='#method.policies' class='fnname'>policies</a>(&self, script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#725-735' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the spending policies for the wallet's descriptor</p>
+</div><h4 id='method.public_descriptor' class="method"><code id='public_descriptor.v'>pub fn <a href='#method.public_descriptor' class='fnname'>public_descriptor</a>(<br> &self, <br> script_type: <a class="enum" href="../../bdk/enum.ScriptType.html" title="enum bdk::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="type" href="../../bdk/descriptor/type.ExtendedDescriptor.html" title="type bdk::descriptor::ExtendedDescriptor">ExtendedDescriptor</a>>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#741-750' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the "public" version of the wallet's descriptor, meaning a new descriptor that has
+the same structure but with every secret key removed</p>
+<p>This can be used to build a watch-only version of a wallet</p>
+</div><h4 id='method.finalize_psbt' class="method"><code id='finalize_psbt.v'>pub fn <a href='#method.finalize_psbt' class='fnname'>finalize_psbt</a>(<br> &self, <br> psbt: PSBT, <br> assume_height: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>PSBT, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#753-827' title='goto source code'>[src]</a></h4><div class='docblock'><p>Try to finalize a PSBT</p>
+</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl<B, D> <a class="struct" href="../../bdk/wallet/struct.Wallet.html" title="struct bdk::wallet::Wallet">Wallet</a><B, D> <span class="where fmt-newline">where<br> B: <a class="trait" href="../../bdk/blockchain/trait.Blockchain.html" title="trait bdk::blockchain::Blockchain">Blockchain</a>,<br> D: <a class="trait" href="../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>, </span></code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#1077-1177' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>(<br> descriptor: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> change_descriptor: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>, <br> network: Network, <br> database: D, <br> client: B<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#1084-1097' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new "online" wallet</p>
+</div><h4 id='method.sync' class="method"><code id='sync.v'>pub fn <a href='#method.sync' class='fnname'>sync</a><P: 'static + <a class="trait" href="../../bdk/blockchain/trait.Progress.html" title="trait bdk::blockchain::Progress">Progress</a>>(<br> &self, <br> progress_update: P, <br> max_address_param: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#1101-1159' title='goto source code'>[src]</a></h4><div class='docblock'><p>Sync the internal database with the blockchain</p>
+</div><h4 id='method.client' class="method"><code id='client.v'>pub fn <a href='#method.client' class='fnname'>client</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>B></code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#1162-1164' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return a reference to the internal blockchain client</p>
+</div><h4 id='method.broadcast' class="method"><code id='broadcast.v'>pub fn <a href='#method.broadcast' class='fnname'>broadcast</a>(&self, tx: Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Txid, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#1168-1176' title='goto source code'>[src]</a></h4><div class='docblock'><p>Broadcast a transaction to the network</p>
+</div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<B, D> !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../bdk/wallet/struct.Wallet.html" title="struct bdk::wallet::Wallet">Wallet</a><B, D></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl<B, D> !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../bdk/wallet/struct.Wallet.html" title="struct bdk::wallet::Wallet">Wallet</a><B, D></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<B, D> !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../bdk/wallet/struct.Wallet.html" title="struct bdk::wallet::Wallet">Wallet</a><B, D></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl<B, D> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../bdk/wallet/struct.Wallet.html" title="struct bdk::wallet::Wallet">Wallet</a><B, D> <span class="where fmt-newline">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br> D: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl<B, D> !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../bdk/wallet/struct.Wallet.html" title="struct bdk::wallet::Wallet">Wallet</a><B, D></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `get_timestamp` fn in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, get_timestamp"><title>bdk::wallet::time::get_timestamp - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>time</a></p><script>window.sidebarCurrent = {name: 'get_timestamp', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/time.rs.html#42-47' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>time</a>::<wbr><a class="fn" href=''>get_timestamp</a></span></h1><pre class='rust fn'>pub fn get_timestamp() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></pre><div class='docblock'><p>Return the current timestamp in seconds</p>
+</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `time` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, time"><title>bdk::wallet::time - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module time</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'time', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/time.rs.html#25-86' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a class="mod" href=''>time</a></span></h1><div class='docblock'><p>Cross-platform time</p>
+<p>This module provides a function to get the current timestamp that works on all the platforms
+supported by the library.</p>
+<p>It can be useful to compare it with the timestamps found in
+<a href="crate::types::TransactionDetails"><code>TransactionDetails</code></a>.</p>
+</div><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
+<table><tr class='module-item'><td><a class="fn" href="fn.get_timestamp.html" title='bdk::wallet::time::get_timestamp fn'>get_timestamp</a></td><td class='docblock-short'><p>Return the current timestamp in seconds</p>
+</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"fn":[["get_timestamp","Return the current timestamp in seconds"]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `IsDust` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, IsDust"><title>bdk::wallet::IsDust - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait IsDust</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.is_dust">is_dust</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-IsDust-for-u64">u64</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'IsDust', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/wallet/utils.rs.html#34-37' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>wallet</a>::<wbr><a class="trait" href=''>IsDust</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait IsDust {
+ fn <a href='#tymethod.is_dust' class='fnname'>is_dust</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>;
+}</pre></div><div class='docblock'><p>Trait to check if a value is below the dust limit</p>
+</div>
+ <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.is_dust' class='method'><code id='is_dust.v'>fn <a href='#tymethod.is_dust' class='fnname'>is_dust</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h3><div class='docblock'><p>Check whether or not a value is below dust limit</p>
+</div></div><span class='loading-content'>Loading content...</span>
+ <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-IsDust-for-u64' class='impl'><code class='in-band'>impl <a class="trait" href="../../bdk/wallet/trait.IsDust.html" title="trait bdk::wallet::IsDust">IsDust</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></code><a href='#impl-IsDust-for-u64' class='anchor'></a><a class='srclink' href='../../src/bdk/wallet/utils.rs.html#39-43' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.is_dust' class="method hidden"><code id='is_dust.v-1'>fn <a href='#method.is_dust' class='fnname'>is_dust</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/bdk/wallet/utils.rs.html#40-42' title='goto source code'>[src]</a></h4></div><span class='loading-content'>Loading content...</span>
+ <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/bdk/wallet/trait.IsDust.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ChangeSpendPolicy` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, ChangeSpendPolicy"><title>bdk::wallet::tx_builder::ChangeSpendPolicy - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum ChangeSpendPolicy</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.ChangeAllowed">ChangeAllowed</a><a href="#variant.ChangeForbidden">ChangeForbidden</a><a href="#variant.OnlyChange">OnlyChange</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Eq">Eq</a><a href="#impl-Hash">Hash</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CChangeSpendPolicy%3E">PartialEq<ChangeSpendPolicy></a><a href="#impl-PartialOrd%3CChangeSpendPolicy%3E">PartialOrd<ChangeSpendPolicy></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>tx_builder</a></p><script>window.sidebarCurrent = {name: 'ChangeSpendPolicy', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#329-336' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>tx_builder</a>::<wbr><a class="enum" href=''>ChangeSpendPolicy</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum ChangeSpendPolicy {
+ ChangeAllowed,
+ OnlyChange,
+ ChangeForbidden,
+}</pre></div><div class='docblock'><p>Policy regarding the use of change outputs when creating a transaction</p>
+</div><h2 id='variants' class='variants small-section-header'>
+ Variants<a href='#variants' class='anchor'></a></h2>
+<div id="variant.ChangeAllowed" class="variant small-section-header"><a href="#variant.ChangeAllowed" class="anchor field"></a><code id='ChangeAllowed.v'>ChangeAllowed</code></div><div class='docblock'><p>Use both change and non-change outputs (default)</p>
+</div><div id="variant.OnlyChange" class="variant small-section-header"><a href="#variant.OnlyChange" class="anchor field"></a><code id='OnlyChange.v'>OnlyChange</code></div><div class='docblock'><p>Only use change outputs (see [<code>TxBuilder::only_spend_change</code>])</p>
+</div><div id="variant.ChangeForbidden" class="variant small-section-header"><a href="#variant.ChangeForbidden" class="anchor field"></a><code id='ChangeForbidden.v'>ChangeForbidden</code></div><div class='docblock'><p>Only use non-change outputs (see [<code>TxBuilder::do_not_spend_change</code>])</p>
+</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#338-342' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#339-341' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
+</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code id='hash.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H)</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
+</div><h4 id='method.hash_slice' class="method hidden"><code id='hash_slice.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#192-199' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
+</div></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Ord' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code id='cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
+</div><h4 id='method.max' class="method hidden"><code id='max.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#600-605' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
+</div><h4 id='method.min' class="method hidden"><code id='min.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#620-625' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
+</div><h4 id='method.clamp' class="method hidden"><code id='clamp.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#647-659' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
+</div></div><h3 id='impl-PartialEq%3CChangeSpendPolicy%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a>> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-PartialEq%3CChangeSpendPolicy%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
+</div><h4 id='method.ne' class="method hidden"><code id='ne.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#216-218' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
+</div></div><h3 id='impl-PartialOrd%3CChangeSpendPolicy%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a>> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-PartialOrd%3CChangeSpendPolicy%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code id='partial_cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
+</div><h4 id='method.lt' class="method hidden"><code id='lt.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#842-844' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
+</div><h4 id='method.le' class="method hidden"><code id='le.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#861-863' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
+</div><h4 id='method.gt' class="method hidden"><code id='gt.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#879-881' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
+</div><h4 id='method.ge' class="method hidden"><code id='ge.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#898-900' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
+</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `TxOrdering` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, TxOrdering"><title>bdk::wallet::tx_builder::TxOrdering - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum TxOrdering</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.BIP69Lexicographic">BIP69Lexicographic</a><a href="#variant.Shuffle">Shuffle</a><a href="#variant.Untouched">Untouched</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.sort_tx">sort_tx</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Eq">Eq</a><a href="#impl-Hash">Hash</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CTxOrdering%3E">PartialEq<TxOrdering></a><a href="#impl-PartialOrd%3CTxOrdering%3E">PartialOrd<TxOrdering></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>tx_builder</a></p><script>window.sidebarCurrent = {name: 'TxOrdering', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#273-280' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>tx_builder</a>::<wbr><a class="enum" href=''>TxOrdering</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum TxOrdering {
+ Shuffle,
+ Untouched,
+ BIP69Lexicographic,
+}</pre></div><div class='docblock'><p>Ordering of the transaction's inputs and outputs</p>
+</div><h2 id='variants' class='variants small-section-header'>
+ Variants<a href='#variants' class='anchor'></a></h2>
+<div id="variant.Shuffle" class="variant small-section-header"><a href="#variant.Shuffle" class="anchor field"></a><code id='Shuffle.v'>Shuffle</code></div><div class='docblock'><p>Randomized (default)</p>
+</div><div id="variant.Untouched" class="variant small-section-header"><a href="#variant.Untouched" class="anchor field"></a><code id='Untouched.v'>Untouched</code></div><div class='docblock'><p>Unchanged</p>
+</div><div id="variant.BIP69Lexicographic" class="variant small-section-header"><a href="#variant.BIP69Lexicographic" class="anchor field"></a><code id='BIP69Lexicographic.v'>BIP69Lexicographic</code></div><div class='docblock'><p>BIP69 / Lexicographic</p>
+</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#288-313' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.sort_tx' class="method"><code id='sort_tx.v'>pub fn <a href='#method.sort_tx' class='fnname'>sort_tx</a>(&self, tx: &mut Transaction)</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#289-312' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
+</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
+</div></div><h3 id='impl-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#282-286' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#283-285' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
+</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code id='hash.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H)</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
+</div><h4 id='method.hash_slice' class="method hidden"><code id='hash_slice.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#192-199' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
+</div></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Ord' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code id='cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
+</div><h4 id='method.max' class="method hidden"><code id='max.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#600-605' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
+</div><h4 id='method.min' class="method hidden"><code id='min.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#620-625' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
+</div><h4 id='method.clamp' class="method hidden"><code id='clamp.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#647-659' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
+</div></div><h3 id='impl-PartialEq%3CTxOrdering%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a>> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-PartialEq%3CTxOrdering%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
+</div><h4 id='method.ne' class="method hidden"><code id='ne.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#216-218' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
+</div></div><h3 id='impl-PartialOrd%3CTxOrdering%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a>> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-PartialOrd%3CTxOrdering%3E' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code id='partial_cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
+</div><h4 id='method.lt' class="method hidden"><code id='lt.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#842-844' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
+</div><h4 id='method.le' class="method hidden"><code id='le.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#861-863' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
+</div><h4 id='method.gt' class="method hidden"><code id='gt.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#879-881' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
+</div><h4 id='method.ge' class="method hidden"><code id='ge.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#898-900' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
+</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
+</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
+</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
+</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `tx_builder` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, tx_builder"><title>bdk::wallet::tx_builder - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module tx_builder</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'tx_builder', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#25-488' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a class="mod" href=''>tx_builder</a></span></h1><div class='docblock'><p>Transaction builder</p>
+<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="comment">// Create a transaction with one output to `to_address` of 50_000 satoshi, with a custom fee rate</span>
+<span class="comment">// of 5.0 satoshi/vbyte, only spending non-change outputs and with RBF signaling</span>
+<span class="comment">// enabled</span>
+<span class="kw">let</span> <span class="ident">builder</span> <span class="op">=</span> <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">to_address</span>.<span class="ident">script_pubkey</span>(), <span class="number">50_000</span>)])
+ .<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">5.0</span>))
+ .<span class="ident">do_not_spend_change</span>()
+ .<span class="ident">enable_rbf</span>();</pre></div>
+</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
+<table><tr class='module-item'><td><a class="struct" href="struct.TxBuilder.html" title='bdk::wallet::tx_builder::TxBuilder struct'>TxBuilder</a></td><td class='docblock-short'><p>A transaction builder</p>
+</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
+<table><tr class='module-item'><td><a class="enum" href="enum.ChangeSpendPolicy.html" title='bdk::wallet::tx_builder::ChangeSpendPolicy enum'>ChangeSpendPolicy</a></td><td class='docblock-short'><p>Policy regarding the use of change outputs when creating a transaction</p>
+</td></tr><tr class='module-item'><td><a class="enum" href="enum.TxOrdering.html" title='bdk::wallet::tx_builder::TxOrdering enum'>TxOrdering</a></td><td class='docblock-short'><p>Ordering of the transaction's inputs and outputs</p>
+</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+initSidebarItems({"enum":[["ChangeSpendPolicy","Policy regarding the use of change outputs when creating a transaction"],["TxOrdering","Ordering of the transaction's inputs and outputs"]],"struct":[["TxBuilder","A transaction builder"]]});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `TxBuilder` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, TxBuilder"><title>bdk::wallet::tx_builder::TxBuilder - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct TxBuilder</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.add_recipient">add_recipient</a><a href="#method.add_unspendable">add_unspendable</a><a href="#method.add_utxo">add_utxo</a><a href="#method.change_policy">change_policy</a><a href="#method.coin_selection">coin_selection</a><a href="#method.do_not_spend_change">do_not_spend_change</a><a href="#method.enable_rbf">enable_rbf</a><a href="#method.enable_rbf_with_sequence">enable_rbf_with_sequence</a><a href="#method.fee_rate">fee_rate</a><a href="#method.force_non_witness_utxo">force_non_witness_utxo</a><a href="#method.new">new</a><a href="#method.nlocktime">nlocktime</a><a href="#method.only_spend_change">only_spend_change</a><a href="#method.ordering">ordering</a><a href="#method.policy_path">policy_path</a><a href="#method.send_all">send_all</a><a href="#method.set_recipients">set_recipients</a><a href="#method.sighash">sighash</a><a href="#method.unspendable">unspendable</a><a href="#method.utxos">utxos</a><a href="#method.version">version</a><a href="#method.with_recipients">with_recipients</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>tx_builder</a></p><script>window.sidebarCurrent = {name: 'TxBuilder', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#57-72' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>bdk</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>tx_builder</a>::<wbr><a class="struct" href=''>TxBuilder</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct TxBuilder<Cs: <a class="trait" href="../../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait bdk::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a>> { /* fields omitted */ }</pre></div><div class='docblock'><p>A transaction builder</p>
+<p>This structure contains the configuration that the wallet must follow to build a transaction.</p>
+<p>For an example see <a href="super::tx_builder">this module</a>'s documentation;</p>
+</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><<a class="type" href="../../../bdk/wallet/coin_selection/type.DefaultCoinSelectionAlgorithm.html" title="type bdk::wallet::coin_selection::DefaultCoinSelectionAlgorithm">DefaultCoinSelectionAlgorithm</a>></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#74-84' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>() -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#76-78' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create an empty builder</p>
+</div><h4 id='method.with_recipients' class="method"><code id='with_recipients.v'>pub fn <a href='#method.with_recipients' class='fnname'>with_recipients</a>(recipients: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Script, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#81-83' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a builder starting from a list of recipients</p>
+</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl<Cs: <a class="trait" href="../../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait bdk::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a>> <a class="struct" href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs></code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#86-269' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.set_recipients' class="method"><code id='set_recipients.v'>pub fn <a href='#method.set_recipients' class='fnname'>set_recipients</a>(self, recipients: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Script, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#88-91' title='goto source code'>[src]</a></h4><div class='docblock'><p>Replace the recipients already added with a new list</p>
+</div><h4 id='method.add_recipient' class="method"><code id='add_recipient.v'>pub fn <a href='#method.add_recipient' class='fnname'>add_recipient</a>(self, script_pubkey: Script, amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#94-97' title='goto source code'>[src]</a></h4><div class='docblock'><p>Add a recipient to the internal list</p>
+</div><h4 id='method.send_all' class="method"><code id='send_all.v'>pub fn <a href='#method.send_all' class='fnname'>send_all</a>(self) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#104-107' title='goto source code'>[src]</a></h4><div class='docblock'><p>Send all the selected utxos to a single output</p>
+<p>Adding more than one recipients with this option enabled will result in an error.</p>
+<p>The value associated with the only recipient is irrelevant and will be replaced by the wallet.</p>
+</div><h4 id='method.fee_rate' class="method"><code id='fee_rate.v'>pub fn <a href='#method.fee_rate' class='fnname'>fee_rate</a>(self, fee_rate: <a class="struct" href="../../../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#110-113' title='goto source code'>[src]</a></h4><div class='docblock'><p>Set a custom fee rate</p>
+</div><h4 id='method.policy_path' class="method"><code id='policy_path.v'>pub fn <a href='#method.policy_path' class='fnname'>policy_path</a>(self, policy_path: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/collections/btree/map/struct.BTreeMap.html" title="struct alloc::collections::btree::map::BTreeMap">BTreeMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>>) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#121-124' title='goto source code'>[src]</a></h4><div class='docblock'><p>Set the policy path to use while creating the transaction</p>
+<p>This method accepts a map where the key is the policy node id (see
+<a href="crate::descriptor::Policy::id"><code>Policy::id</code></a>) and the value is the list of the indexes of
+the items that are intended to be satisfied from the policy node (see
+<a href="crate::descriptor::policy::SatisfiableItem::Thresh::items"><code>SatisfiableItem::Thresh::items</code></a>).</p>
+</div><h4 id='method.utxos' class="method"><code id='utxos.v'>pub fn <a href='#method.utxos' class='fnname'>utxos</a>(self, utxos: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><OutPoint>) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#130-133' title='goto source code'>[src]</a></h4><div class='docblock'><p>Replace the internal list of utxos that <strong>must</strong> be spent with a new list</p>
+<p>These have priority over the "unspendable" utxos, meaning that if a utxo is present both in
+the "utxos" and the "unspendable" list, it will be spent.</p>
+</div><h4 id='method.add_utxo' class="method"><code id='add_utxo.v'>pub fn <a href='#method.add_utxo' class='fnname'>add_utxo</a>(self, utxo: OutPoint) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#139-142' title='goto source code'>[src]</a></h4><div class='docblock'><p>Add a utxo to the internal list of utxos that <strong>must</strong> be spent</p>
+<p>These have priority over the "unspendable" utxos, meaning that if a utxo is present both in
+the "utxos" and the "unspendable" list, it will be spent.</p>
+</div><h4 id='method.unspendable' class="method"><code id='unspendable.v'>pub fn <a href='#method.unspendable' class='fnname'>unspendable</a>(self, unspendable: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><OutPoint>) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#149-152' title='goto source code'>[src]</a></h4><div class='docblock'><p>Replace the internal list of unspendable utxos with a new list</p>
+<p>It's important to note that the "must-be-spent" utxos added with [<code>TxBuilder::utxos</code>] and
+[<code>TxBuilder::add_utxo</code>] have priority over these. See the docs of the two linked methods
+for more details.</p>
+</div><h4 id='method.add_unspendable' class="method"><code id='add_unspendable.v'>pub fn <a href='#method.add_unspendable' class='fnname'>add_unspendable</a>(self, unspendable: OutPoint) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#159-162' title='goto source code'>[src]</a></h4><div class='docblock'><p>Add a utxo to the internal list of unspendable utxos</p>
+<p>It's important to note that the "must-be-spent" utxos added with [<code>TxBuilder::utxos</code>] and
+[<code>TxBuilder::add_utxo</code>] have priority over this. See the docs of the two linked methods
+for more details.</p>
+</div><h4 id='method.sighash' class="method"><code id='sighash.v'>pub fn <a href='#method.sighash' class='fnname'>sighash</a>(self, sighash: SigHashType) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#167-170' title='goto source code'>[src]</a></h4><div class='docblock'><p>Sign with a specific sig hash</p>
+<p><strong>Use this option very carefully</strong></p>
+</div><h4 id='method.ordering' class="method"><code id='ordering.v'>pub fn <a href='#method.ordering' class='fnname'>ordering</a>(self, ordering: <a class="enum" href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="enum bdk::wallet::tx_builder::TxOrdering">TxOrdering</a>) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#173-176' title='goto source code'>[src]</a></h4><div class='docblock'><p>Choose the ordering for inputs and outputs of the transaction</p>
+</div><h4 id='method.nlocktime' class="method"><code id='nlocktime.v'>pub fn <a href='#method.nlocktime' class='fnname'>nlocktime</a>(self, locktime: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#181-184' title='goto source code'>[src]</a></h4><div class='docblock'><p>Use a specific nLockTime while creating the transaction</p>
+<p>This can cause conflicts if the wallet's descriptors contain an "after" (OP_CLTV) operator.</p>
+</div><h4 id='method.enable_rbf' class="method"><code id='enable_rbf.v'>pub fn <a href='#method.enable_rbf' class='fnname'>enable_rbf</a>(self) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#189-191' title='goto source code'>[src]</a></h4><div class='docblock'><p>Enable signaling RBF</p>
+<p>This will use the default nSequence value of <code>0xFFFFFFFD</code>.</p>
+</div><h4 id='method.enable_rbf_with_sequence' class="method"><code id='enable_rbf_with_sequence.v'>pub fn <a href='#method.enable_rbf_with_sequence' class='fnname'>enable_rbf_with_sequence</a>(self, nsequence: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#200-203' title='goto source code'>[src]</a></h4><div class='docblock'><p>Enable signaling RBF with a specific nSequence value</p>
+<p>This can cause conflicts if the wallet's descriptors contain an "older" (OP_CSV) operator
+and the given <code>nsequence</code> is lower than the CSV value.</p>
+<p>If the <code>nsequence</code> is higher than <code>0xFFFFFFFD</code> an error will be thrown, since it would not
+be a valid nSequence to signal RBF.</p>
+</div><h4 id='method.version' class="method"><code id='version.v'>pub fn <a href='#method.version' class='fnname'>version</a>(self, version: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#209-212' title='goto source code'>[src]</a></h4><div class='docblock'><p>Build a transaction with a specific version</p>
+<p>The <code>version</code> should always be greater than <code>0</code> and greater than <code>1</code> if the wallet's
+descriptors contain an "older" (OP_CSV) operator.</p>
+</div><h4 id='method.do_not_spend_change' class="method"><code id='do_not_spend_change.v'>pub fn <a href='#method.do_not_spend_change' class='fnname'>do_not_spend_change</a>(self) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#218-221' title='goto source code'>[src]</a></h4><div class='docblock'><p>Do not spend change outputs</p>
+<p>This effectively adds all the change outputs to the "unspendable" list. See
+[<code>TxBuilder::unspendable</code>].</p>
+</div><h4 id='method.only_spend_change' class="method"><code id='only_spend_change.v'>pub fn <a href='#method.only_spend_change' class='fnname'>only_spend_change</a>(self) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#227-230' title='goto source code'>[src]</a></h4><div class='docblock'><p>Only spend change outputs</p>
+<p>This effectively adds all the non-change outputs to the "unspendable" list. See
+[<code>TxBuilder::unspendable</code>].</p>
+</div><h4 id='method.change_policy' class="method"><code id='change_policy.v'>pub fn <a href='#method.change_policy' class='fnname'>change_policy</a>(self, change_policy: <a class="enum" href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum bdk::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a>) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#234-237' title='goto source code'>[src]</a></h4><div class='docblock'><p>Set a specific [<code>ChangeSpendPolicy</code>]. See [<code>TxBuilder::do_not_spend_change</code>] and
+[<code>TxBuilder::only_spend_change</code>] for some shortcuts.</p>
+</div><h4 id='method.force_non_witness_utxo' class="method"><code id='force_non_witness_utxo.v'>pub fn <a href='#method.force_non_witness_utxo' class='fnname'>force_non_witness_utxo</a>(self) -> Self</code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#243-246' title='goto source code'>[src]</a></h4><div class='docblock'><p>Fill-in the <a href="bitcoin::util::psbt::Input::non_witness_utxo"><code>psbt::Input::non_witness_utxo</code></a> field even if the wallet only has SegWit
+descriptors.</p>
+<p>This is useful for signers which always require it, like Trezor hardware wallets.</p>
+</div><h4 id='method.coin_selection' class="method"><code id='coin_selection.v'>pub fn <a href='#method.coin_selection' class='fnname'>coin_selection</a><P: <a class="trait" href="../../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait bdk::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a>>(<br> self, <br> coin_selection: P<br>) -> <a class="struct" href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><P></code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#251-268' title='goto source code'>[src]</a></h4><div class='docblock'><p>Choose the coin selection algorithm</p>
+<p>Overrides the <a href="super::coin_selection::DefaultCoinSelectionAlgorithm"><code>DefaultCoinSelectionAlgorithm</code></a>.</p>
+</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<Cs: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <a class="trait" href="../../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait bdk::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#56' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#56' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
+</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl<Cs: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="../../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait bdk::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#56' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs></code><a class='srclink' href='../../../src/bdk/wallet/tx_builder.rs.html#56' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
+</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<Cs> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs> <span class="where fmt-newline">where<br> Cs: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>, </span></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl<Cs> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs> <span class="where fmt-newline">where<br> Cs: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>, </span></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<Cs> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs> <span class="where fmt-newline">where<br> Cs: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl<Cs> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs> <span class="where fmt-newline">where<br> Cs: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl<Cs> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs> <span class="where fmt-newline">where<br> Cs: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>, </span></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
+</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
+</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
+</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
+</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code id='vzip.v'>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `OfflineWallet` type in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, OfflineWallet"><title>bdk::wallet::OfflineWallet - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition OfflineWallet</p><div class="sidebar-elems"><p class='location'><a href='../index.html'>bdk</a>::<wbr><a href='index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'OfflineWallet', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/bdk/wallet/mod.rs.html#73' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='../index.html'>bdk</a>::<wbr><a href='index.html'>wallet</a>::<wbr><a class="type" href=''>OfflineWallet</a></span></h1><pre class='rust typedef'>type OfflineWallet<D> = <a class="struct" href="../../bdk/wallet/struct.Wallet.html" title="struct bdk::wallet::Wallet">Wallet</a><<a class="struct" href="../../bdk/blockchain/struct.OfflineBlockchain.html" title="struct bdk::blockchain::OfflineBlockchain">OfflineBlockchain</a>, D>;</pre><div class='docblock'><p>Type alias for a [<code>Wallet</code>] that uses [<code>OfflineBlockchain</code>]</p>
+</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="refresh" content="0;URL=../../../bdk/wallet/trait.IsDust.html">
+</head>
+<body>
+ <p>Redirecting to <a href="../../../bdk/wallet/trait.IsDust.html">../../../bdk/wallet/trait.IsDust.html</a>...</p>
+ <script>location.replace("../../../bdk/wallet/trait.IsDust.html" + location.search + location.hash);</script>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" width="1792" height="1792" viewBox="0 0 1792 1792"><path d="M1615 0q70 0 122.5 46.5t52.5 116.5q0 63-45 151-332 629-465 752-97 91-218 91-126 0-216.5-92.5t-90.5-219.5q0-128 92-212l638-579q59-54 130-54zm-909 1034q39 76 106.5 130t150.5 76l1 71q4 213-129.5 347t-348.5 134q-123 0-218-46.5t-152.5-127.5-86.5-183-29-220q7 5 41 30t62 44.5 59 36.5 46 17q41 0 55-37 25-66 57.5-112.5t69.5-76 88-47.5 103-25.5 125-10.5z"/></svg>
\ No newline at end of file
--- /dev/null
+body{background-color:#353535;color:#ddd;}h1,h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){color:#ddd;}h1.fqn{border-bottom-color:#d2d2d2;}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){border-bottom-color:#d2d2d2;}.in-band{background-color:#353535;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#2A2A2A;}pre{background-color:#2A2A2A;}.sidebar{background-color:#505050;}*{scrollbar-color:rgb(64,65,67) #717171;}.sidebar{scrollbar-color:rgba(32,34,37,.6) transparent;}::-webkit-scrollbar-track{background-color:#717171;}::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar::-webkit-scrollbar-track{background-color:#717171;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar .current{background-color:#333;}.source .sidebar{background-color:#353535;}.sidebar .location{border-color:#fff;background:#575757;color:#DDD;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#444;}.line-numbers span{color:#3B91E2;}.line-numbers .line-highlighted{background-color:#0a042f !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom-color:#DDD;}.docblock table,.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#ddd;}.content .highlighted{color:#eee !important;background-color:#616161;}.content .highlighted a,.content .highlighted span{color:#eee !important;}.content .highlighted.trait{background-color:#013191;}.content .highlighted.traitalias{background-color:#013191;}.content .highlighted.mod,.content .highlighted.externcrate{background-color:#afc6e4;}.content .highlighted.mod{background-color:#803a1b;}.content .highlighted.externcrate{background-color:#396bac;}.content .highlighted.enum{background-color:#5b4e68;}.content .highlighted.struct{background-color:#194e9f;}.content .highlighted.union{background-color:#b7bd49;}.content .highlighted.fn,.content .highlighted.method,.content .highlighted.tymethod{background-color:#4950ed;}.content .highlighted.type{background-color:#38902c;}.content .highlighted.foreigntype{background-color:#b200d6;}.content .highlighted.attr,.content .highlighted.derive,.content .highlighted.macro{background-color:#217d1c;}.content .highlighted.constant,.content .highlighted.static{background-color:#0063cc;}.content .highlighted.primitive{background-color:#00708a;}.content .highlighted.keyword{background-color:#884719;}.content .stability::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#82b089;}.content span.struct,.content a.struct,.block a.current.struct{color:#2dbfb8;}.content span.type,.content a.type,.block a.current.type{color:#ff7f00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#dd7de8;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#09bd00;}.content span.union,.content a.union,.block a.current.union{color:#a6ae37;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#82a5c9;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#43aec7;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#bda000;}.content span.trait,.content a.trait,.block a.current.trait{color:#b78cf2;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#b397da;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#2BAB63;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}pre.rust .comment{color:#8d8d8b;}pre.rust .doccomment{color:#8ca375;}nav:not(.sidebar){border-bottom-color:#4e4e4e;}nav.main .current{border-top-color:#eee;border-bottom-color:#eee;}nav.main .separator{border-color:#eee;}a{color:#ddd;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.stability a{color:#D2991D;}.stab.internal a{color:#304FFE;}a.test-arrow{color:#dedede;}.collapse-toggle{color:#999;}#crate-search{color:#111;background-color:#f0f0f0;border-color:#000;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input{color:#111;background-color:#f0f0f0;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input:focus{border-color:#008dfd;}.search-focus:disabled{background-color:#c5c4c4;}#crate-search+.search-input:focus{box-shadow:0 0 8px 4px #078dd8;}.module-item .stab{color:#ddd;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;color:#2f2f2f;}.stab.internal{background:#FFB9B3;border-color:#B71C1C;color:#2f2f2f;}.stab.deprecated{background:#F3DFFF;border-color:#7F0087;color:#2f2f2f;}.stab.portability{background:#C4ECFF;border-color:#7BA5DB;color:#2f2f2f;}.stab.portability>code{color:#ddd;}#help>div{background:#4d4d4d;border-color:#bfbfbf;}#help dt{border-color:#bfbfbf;background:rgba(0,0,0,0);color:black;}.since{color:grey;}tr.result span.primitive::after,tr.result span.keyword::after{color:#ddd;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#ab8ac1;}pre.rust .kw-2,pre.rust .prelude-ty{color:#769acb;}pre.rust .number,pre.rust .string{color:#83a300;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#ee6868;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#d97f26;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#4a4949;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label{color:#999;}:target>code,:target>.in-band{background-color:#494a3d;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.8);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.8);}.information>.compile_fail:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip .tooltiptext{background-color:#000;color:#fff;border-color:#000;}.tooltip .tooltiptext::after{border-color:transparent black transparent transparent;}#titles>div:not(.selected){background-color:#252525;border-top-color:#252525;}#titles>div:hover,#titles>div.selected{border-top-color:#0089ff;}#titles>div>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#505050;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#505050;border-right-color:#000;}#sidebar-filler{background-color:#505050;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu{border-color:#e0e0e0;background:#f0f0f0;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus{border-color:#ffb900;}#theme-choices{border-color:#e0e0e0;background-color:#353535;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#4e4e4e;}@media (max-width:700px){#theme-picker{background:#f0f0f0;}}#all-types{background-color:#505050;}#all-types:hover{background-color:#606060;}.search-results td span.alias{color:#fff;}.search-results td span.grey{color:#ccc;}#sidebar-toggle{background-color:#565656;}#sidebar-toggle:hover{background-color:#676767;}#source-sidebar{background-color:#565656;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#444;}div.files>.selected{background-color:#333;}.setting-line>.title{border-bottom-color:#ddd;}
\ No newline at end of file
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Layer_1" width="128" height="128" enable-background="new 0 0 128 128" version="1.1" viewBox="-30 -20 176 176" xml:space="preserve"><g><line x1="111" x2="64" y1="40.5" y2="87.499" fill="none" stroke="#2F3435" stroke-linecap="square" stroke-miterlimit="10" stroke-width="12"/><line x1="64" x2="17" y1="87.499" y2="40.5" fill="none" stroke="#2F3435" stroke-linecap="square" stroke-miterlimit="10" stroke-width="12"/></g></svg>
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html\" title=\"trait alloc::string::ToString\">ToString</a> for <a class=\"struct\" href=\"bdk/wallet/export/struct.WalletExport.html\" title=\"struct bdk::wallet::export::WalletExport\">WalletExport</a>","synthetic":false,"types":["bdk::wallet::export::WalletExport"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"bdk/blockchain/enum.Capability.html\" title=\"enum bdk::blockchain::Capability\">Capability</a>","synthetic":false,"types":["bdk::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"bdk/blockchain/struct.NoopProgress.html\" title=\"struct bdk::blockchain::NoopProgress\">NoopProgress</a>","synthetic":false,"types":["bdk::blockchain::NoopProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"bdk/blockchain/struct.LogProgress.html\" title=\"struct bdk::blockchain::LogProgress\">LogProgress</a>","synthetic":false,"types":["bdk::blockchain::LogProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.PKOrF.html\" title=\"struct bdk::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":false,"types":["bdk::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum bdk::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":false,"types":["bdk::descriptor::policy::SatisfiableItem"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.Satisfaction.html\" title=\"enum bdk::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":false,"types":["bdk::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Policy.html\" title=\"struct bdk::descriptor::policy::Policy\">Policy</a>","synthetic":false,"types":["bdk::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>","synthetic":false,"types":["bdk::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"bdk/struct.FeeRate.html\" title=\"struct bdk::FeeRate\">FeeRate</a>","synthetic":false,"types":["bdk::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"bdk/struct.UTXO.html\" title=\"struct bdk::UTXO\">UTXO</a>","synthetic":false,"types":["bdk::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"bdk/struct.TransactionDetails.html\" title=\"struct bdk::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["bdk::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"bdk/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum bdk::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":false,"types":["bdk::wallet::address_validator::AddressValidatorError"]},{"text":"impl<Pk: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> + <a class=\"trait\" href=\"bdk/descriptor/trait.MiniscriptKey.html\" title=\"trait bdk::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerId.html\" title=\"enum bdk::wallet::signer::SignerId\">SignerId</a><Pk>","synthetic":false,"types":["bdk::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerError.html\" title=\"enum bdk::wallet::signer::SignerError\">SignerError</a>","synthetic":false,"types":["bdk::wallet::signer::SignerError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignerOrdering.html\" title=\"struct bdk::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["bdk::wallet::signer::SignerOrdering"]},{"text":"impl<Pk: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> + <a class=\"trait\" href=\"bdk/descriptor/trait.MiniscriptKey.html\" title=\"trait bdk::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignersContainer.html\" title=\"struct bdk::wallet::signer::SignersContainer\">SignersContainer</a><Pk>","synthetic":false,"types":["bdk::wallet::signer::SignersContainer"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["bdk::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["bdk::wallet::tx_builder::ChangeSpendPolicy"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"enum\" href=\"bdk/blockchain/enum.Capability.html\" title=\"enum bdk::blockchain::Capability\">Capability</a>","synthetic":false,"types":["bdk::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>","synthetic":false,"types":["bdk::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"struct\" href=\"bdk/struct.UTXO.html\" title=\"struct bdk::UTXO\">UTXO</a>","synthetic":false,"types":["bdk::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"struct\" href=\"bdk/struct.TransactionDetails.html\" title=\"struct bdk::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["bdk::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"enum\" href=\"bdk/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum bdk::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":false,"types":["bdk::wallet::address_validator::AddressValidatorError"]},{"text":"impl<Pk: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> + <a class=\"trait\" href=\"bdk/descriptor/trait.MiniscriptKey.html\" title=\"trait bdk::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerId.html\" title=\"enum bdk::wallet::signer::SignerId\">SignerId</a><Pk>","synthetic":false,"types":["bdk::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerError.html\" title=\"enum bdk::wallet::signer::SignerError\">SignerError</a>","synthetic":false,"types":["bdk::wallet::signer::SignerError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignerOrdering.html\" title=\"struct bdk::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["bdk::wallet::signer::SignerOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["bdk::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["bdk::wallet::tx_builder::ChangeSpendPolicy"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html\" title=\"trait core::cmp::Ord\">Ord</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html\" title=\"trait core::cmp::Ord\">Ord</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignerOrdering.html\" title=\"struct bdk::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["bdk::wallet::signer::SignerOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html\" title=\"trait core::cmp::Ord\">Ord</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["bdk::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html\" title=\"trait core::cmp::Ord\">Ord</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["bdk::wallet::tx_builder::ChangeSpendPolicy"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"enum\" href=\"bdk/blockchain/enum.Capability.html\" title=\"enum bdk::blockchain::Capability\">Capability</a>> for <a class=\"enum\" href=\"bdk/blockchain/enum.Capability.html\" title=\"enum bdk::blockchain::Capability\">Capability</a>","synthetic":false,"types":["bdk::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>> for <a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>","synthetic":false,"types":["bdk::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"struct\" href=\"bdk/struct.FeeRate.html\" title=\"struct bdk::FeeRate\">FeeRate</a>> for <a class=\"struct\" href=\"bdk/struct.FeeRate.html\" title=\"struct bdk::FeeRate\">FeeRate</a>","synthetic":false,"types":["bdk::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"struct\" href=\"bdk/struct.UTXO.html\" title=\"struct bdk::UTXO\">UTXO</a>> for <a class=\"struct\" href=\"bdk/struct.UTXO.html\" title=\"struct bdk::UTXO\">UTXO</a>","synthetic":false,"types":["bdk::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"struct\" href=\"bdk/struct.TransactionDetails.html\" title=\"struct bdk::TransactionDetails\">TransactionDetails</a>> for <a class=\"struct\" href=\"bdk/struct.TransactionDetails.html\" title=\"struct bdk::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["bdk::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"enum\" href=\"bdk/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum bdk::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>> for <a class=\"enum\" href=\"bdk/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum bdk::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":false,"types":["bdk::wallet::address_validator::AddressValidatorError"]},{"text":"impl<Pk: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a> + <a class=\"trait\" href=\"bdk/descriptor/trait.MiniscriptKey.html\" title=\"trait bdk::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerId.html\" title=\"enum bdk::wallet::signer::SignerId\">SignerId</a><Pk>> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerId.html\" title=\"enum bdk::wallet::signer::SignerId\">SignerId</a><Pk>","synthetic":false,"types":["bdk::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerError.html\" title=\"enum bdk::wallet::signer::SignerError\">SignerError</a>> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerError.html\" title=\"enum bdk::wallet::signer::SignerError\">SignerError</a>","synthetic":false,"types":["bdk::wallet::signer::SignerError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"struct\" href=\"bdk/wallet/signer/struct.SignerOrdering.html\" title=\"struct bdk::wallet::signer::SignerOrdering\">SignerOrdering</a>> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignerOrdering.html\" title=\"struct bdk::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["bdk::wallet::signer::SignerOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["bdk::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["bdk::wallet::tx_builder::ChangeSpendPolicy"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html\" title=\"trait core::cmp::PartialOrd\">PartialOrd</a><<a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html\" title=\"trait core::cmp::PartialOrd\">PartialOrd</a><<a class=\"struct\" href=\"bdk/struct.FeeRate.html\" title=\"struct bdk::FeeRate\">FeeRate</a>> for <a class=\"struct\" href=\"bdk/struct.FeeRate.html\" title=\"struct bdk::FeeRate\">FeeRate</a>","synthetic":false,"types":["bdk::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html\" title=\"trait core::cmp::PartialOrd\">PartialOrd</a><<a class=\"struct\" href=\"bdk/wallet/signer/struct.SignerOrdering.html\" title=\"struct bdk::wallet::signer::SignerOrdering\">SignerOrdering</a>> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignerOrdering.html\" title=\"struct bdk::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["bdk::wallet::signer::SignerOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html\" title=\"trait core::cmp::PartialOrd\">PartialOrd</a><<a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["bdk::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html\" title=\"trait core::cmp::PartialOrd\">PartialOrd</a><<a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["bdk::wallet::tx_builder::ChangeSpendPolicy"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html\" title=\"trait core::convert::AsRef\">AsRef</a><<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.slice.html\">[</a><a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a><a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.slice.html\">]</a>> for <a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>","synthetic":false,"types":["bdk::types::ScriptType"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"bdk/descriptor/error/enum.Error.html\" title=\"enum bdk::descriptor::error::Error\">Error</a>> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"bdk/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum bdk::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"bdk/descriptor/policy/enum.PolicyError.html\" title=\"enum bdk::descriptor::policy::PolicyError\">PolicyError</a>> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerError.html\" title=\"enum bdk::wallet::signer::SignerError\">SignerError</a>> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"struct\" href=\"https://docs.rs/serde_json/1.0.57/serde_json/error/struct.Error.html\" title=\"struct serde_json::error::Error\">Error</a>> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"bdk/blockchain/esplora/enum.EsploraError.html\" title=\"enum bdk::blockchain::esplora::EsploraError\">EsploraError</a>> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"bdk/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum bdk::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Client> for <a class=\"struct\" href=\"bdk/blockchain/electrum/struct.ElectrumBlockchain.html\" title=\"struct bdk::blockchain::electrum::ElectrumBlockchain\">ElectrumBlockchain</a>","synthetic":false,"types":["bdk::blockchain::electrum::ElectrumBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"struct\" href=\"https://docs.rs/reqwest/0.10.8/reqwest/error/struct.Error.html\" title=\"struct reqwest::error::Error\">Error</a>> for <a class=\"enum\" href=\"bdk/blockchain/esplora/enum.EsploraError.html\" title=\"enum bdk::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":false,"types":["bdk::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/num/struct.ParseIntError.html\" title=\"struct core::num::ParseIntError\">ParseIntError</a>> for <a class=\"enum\" href=\"bdk/blockchain/esplora/enum.EsploraError.html\" title=\"enum bdk::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":false,"types":["bdk::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"bdk/blockchain/esplora/enum.EsploraError.html\" title=\"enum bdk::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":false,"types":["bdk::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"bdk/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum bdk::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":false,"types":["bdk::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html\" title=\"struct std::io::error::Error\">Error</a>> for <a class=\"enum\" href=\"bdk/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum bdk::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":false,"types":["bdk::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"bdk/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum bdk::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":false,"types":["bdk::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/std/time/struct.SystemTimeError.html\" title=\"struct std::time::SystemTimeError\">SystemTimeError</a>> for <a class=\"enum\" href=\"bdk/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum bdk::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":false,"types":["bdk::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>> for <a class=\"enum\" href=\"bdk/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum bdk::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":false,"types":["bdk::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"bdk/descriptor/error/enum.Error.html\" title=\"enum bdk::descriptor::error::Error\">Error</a>","synthetic":false,"types":["bdk::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"bdk/descriptor/error/enum.Error.html\" title=\"enum bdk::descriptor::error::Error\">Error</a>","synthetic":false,"types":["bdk::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"bdk/descriptor/error/enum.Error.html\" title=\"enum bdk::descriptor::error::Error\">Error</a>","synthetic":false,"types":["bdk::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"bdk/descriptor/error/enum.Error.html\" title=\"enum bdk::descriptor::error::Error\">Error</a>","synthetic":false,"types":["bdk::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"bdk/descriptor/error/enum.Error.html\" title=\"enum bdk::descriptor::error::Error\">Error</a>","synthetic":false,"types":["bdk::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"bdk/descriptor/policy/enum.PolicyError.html\" title=\"enum bdk::descriptor::policy::PolicyError\">PolicyError</a>> for <a class=\"enum\" href=\"bdk/descriptor/error/enum.Error.html\" title=\"enum bdk::descriptor::error::Error\">Error</a>","synthetic":false,"types":["bdk::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.bool.html\">bool</a>> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.Satisfaction.html\" title=\"enum bdk::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":false,"types":["bdk::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"bdk/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum bdk::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Policy.html\" title=\"struct bdk::descriptor::policy::Policy\">Policy</a>","synthetic":false,"types":["bdk::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Hash> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerId.html\" title=\"enum bdk::wallet::signer::SignerId\">SignerId</a><DescriptorPublicKey>","synthetic":false,"types":["bdk::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Fingerprint> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerId.html\" title=\"enum bdk::wallet::signer::SignerId\">SignerId</a><DescriptorPublicKey>","synthetic":false,"types":["bdk::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html\" title=\"struct std::collections::hash::map::HashMap\">HashMap</a><DescriptorPublicKey, DescriptorSecretKey, <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.RandomState.html\" title=\"struct std::collections::hash::map::RandomState\">RandomState</a>>> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignersContainer.html\" title=\"struct bdk::wallet::signer::SignersContainer\">SignersContainer</a><DescriptorPublicKey>","synthetic":false,"types":["bdk::wallet::signer::SignersContainer"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.Mempool.html\" title=\"struct bdk::blockchain::compact_filters::Mempool\">Mempool</a>","synthetic":false,"types":["bdk::blockchain::compact_filters::peer::Mempool"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"bdk/database/memory/struct.MemoryDatabase.html\" title=\"struct bdk::database::memory::MemoryDatabase\">MemoryDatabase</a>","synthetic":false,"types":["bdk::database::memory::MemoryDatabase"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.PKOrF.html\" title=\"struct bdk::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":false,"types":["bdk::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"bdk/struct.FeeRate.html\" title=\"struct bdk::FeeRate\">FeeRate</a>","synthetic":false,"types":["bdk::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"bdk/struct.TransactionDetails.html\" title=\"struct bdk::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["bdk::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"bdk/wallet/coin_selection/struct.DumbCoinSelection.html\" title=\"struct bdk::wallet::coin_selection::DumbCoinSelection\">DumbCoinSelection</a>","synthetic":false,"types":["bdk::wallet::coin_selection::DumbCoinSelection"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignerOrdering.html\" title=\"struct bdk::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["bdk::wallet::signer::SignerOrdering"]},{"text":"impl<Pk: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> + <a class=\"trait\" href=\"bdk/descriptor/trait.MiniscriptKey.html\" title=\"trait bdk::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignersContainer.html\" title=\"struct bdk::wallet::signer::SignersContainer\">SignersContainer</a><Pk>","synthetic":false,"types":["bdk::wallet::signer::SignersContainer"]},{"text":"impl<Cs: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> + <a class=\"trait\" href=\"bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html\" title=\"trait bdk::wallet::coin_selection::CoinSelectionAlgorithm\">CoinSelectionAlgorithm</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"bdk/wallet/tx_builder/struct.TxBuilder.html\" title=\"struct bdk::wallet::tx_builder::TxBuilder\">TxBuilder</a><Cs>","synthetic":false,"types":["bdk::wallet::tx_builder::TxBuilder"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["bdk::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["bdk::wallet::tx_builder::ChangeSpendPolicy"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"bdk/blockchain/esplora/struct.EsploraBlockchain.html\" title=\"struct bdk::blockchain::esplora::EsploraBlockchain\">EsploraBlockchain</a>","synthetic":false,"types":["bdk::blockchain::esplora::EsploraBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"bdk/blockchain/esplora/enum.EsploraError.html\" title=\"enum bdk::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":false,"types":["bdk::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.Mempool.html\" title=\"struct bdk::blockchain::compact_filters::Mempool\">Mempool</a>","synthetic":false,"types":["bdk::blockchain::compact_filters::peer::Mempool"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.Peer.html\" title=\"struct bdk::blockchain::compact_filters::Peer\">Peer</a>","synthetic":false,"types":["bdk::blockchain::compact_filters::peer::Peer"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html\" title=\"struct bdk::blockchain::compact_filters::CompactFiltersBlockchain\">CompactFiltersBlockchain</a>","synthetic":false,"types":["bdk::blockchain::compact_filters::CompactFiltersBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"bdk/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum bdk::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":false,"types":["bdk::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"bdk/blockchain/enum.Capability.html\" title=\"enum bdk::blockchain::Capability\">Capability</a>","synthetic":false,"types":["bdk::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"bdk/database/memory/struct.MemoryDatabase.html\" title=\"struct bdk::database::memory::MemoryDatabase\">MemoryDatabase</a>","synthetic":false,"types":["bdk::database::memory::MemoryDatabase"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"bdk/descriptor/error/enum.Error.html\" title=\"enum bdk::descriptor::error::Error\">Error</a>","synthetic":false,"types":["bdk::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.PKOrF.html\" title=\"struct bdk::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":false,"types":["bdk::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum bdk::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":false,"types":["bdk::descriptor::policy::SatisfiableItem"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.Satisfaction.html\" title=\"enum bdk::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":false,"types":["bdk::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Policy.html\" title=\"struct bdk::descriptor::policy::Policy\">Policy</a>","synthetic":false,"types":["bdk::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.PolicyError.html\" title=\"enum bdk::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":false,"types":["bdk::descriptor::policy::PolicyError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>","synthetic":false,"types":["bdk::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"bdk/struct.FeeRate.html\" title=\"struct bdk::FeeRate\">FeeRate</a>","synthetic":false,"types":["bdk::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"bdk/struct.UTXO.html\" title=\"struct bdk::UTXO\">UTXO</a>","synthetic":false,"types":["bdk::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"bdk/struct.TransactionDetails.html\" title=\"struct bdk::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["bdk::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"bdk/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum bdk::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":false,"types":["bdk::wallet::address_validator::AddressValidatorError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"bdk/wallet/coin_selection/struct.CoinSelectionResult.html\" title=\"struct bdk::wallet::coin_selection::CoinSelectionResult\">CoinSelectionResult</a>","synthetic":false,"types":["bdk::wallet::coin_selection::CoinSelectionResult"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"bdk/wallet/coin_selection/struct.DumbCoinSelection.html\" title=\"struct bdk::wallet::coin_selection::DumbCoinSelection\">DumbCoinSelection</a>","synthetic":false,"types":["bdk::wallet::coin_selection::DumbCoinSelection"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"bdk/wallet/export/struct.WalletExport.html\" title=\"struct bdk::wallet::export::WalletExport\">WalletExport</a>","synthetic":false,"types":["bdk::wallet::export::WalletExport"]},{"text":"impl<Pk: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> + <a class=\"trait\" href=\"bdk/descriptor/trait.MiniscriptKey.html\" title=\"trait bdk::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerId.html\" title=\"enum bdk::wallet::signer::SignerId\">SignerId</a><Pk>","synthetic":false,"types":["bdk::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerError.html\" title=\"enum bdk::wallet::signer::SignerError\">SignerError</a>","synthetic":false,"types":["bdk::wallet::signer::SignerError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignerOrdering.html\" title=\"struct bdk::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["bdk::wallet::signer::SignerOrdering"]},{"text":"impl<Pk: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> + <a class=\"trait\" href=\"bdk/descriptor/trait.MiniscriptKey.html\" title=\"trait bdk::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignersContainer.html\" title=\"struct bdk::wallet::signer::SignersContainer\">SignersContainer</a><Pk>","synthetic":false,"types":["bdk::wallet::signer::SignersContainer"]},{"text":"impl<Cs: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> + <a class=\"trait\" href=\"bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html\" title=\"trait bdk::wallet::coin_selection::CoinSelectionAlgorithm\">CoinSelectionAlgorithm</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"bdk/wallet/tx_builder/struct.TxBuilder.html\" title=\"struct bdk::wallet::tx_builder::TxBuilder\">TxBuilder</a><Cs>","synthetic":false,"types":["bdk::wallet::tx_builder::TxBuilder"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["bdk::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["bdk::wallet::tx_builder::ChangeSpendPolicy"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"bdk/blockchain/esplora/enum.EsploraError.html\" title=\"enum bdk::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":false,"types":["bdk::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"bdk/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum bdk::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":false,"types":["bdk::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"bdk/descriptor/error/enum.Error.html\" title=\"enum bdk::descriptor::error::Error\">Error</a>","synthetic":false,"types":["bdk::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.PolicyError.html\" title=\"enum bdk::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":false,"types":["bdk::descriptor::policy::PolicyError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"bdk/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum bdk::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":false,"types":["bdk::wallet::address_validator::AddressValidatorError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerError.html\" title=\"enum bdk::wallet::signer::SignerError\">SignerError</a>","synthetic":false,"types":["bdk::wallet::signer::SignerError"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a> for <a class=\"enum\" href=\"bdk/blockchain/enum.Capability.html\" title=\"enum bdk::blockchain::Capability\">Capability</a>","synthetic":false,"types":["bdk::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a> for <a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>","synthetic":false,"types":["bdk::types::ScriptType"]},{"text":"impl<Pk: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a> + <a class=\"trait\" href=\"bdk/descriptor/trait.MiniscriptKey.html\" title=\"trait bdk::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerId.html\" title=\"enum bdk::wallet::signer::SignerId\">SignerId</a><Pk>","synthetic":false,"types":["bdk::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["bdk::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["bdk::wallet::tx_builder::ChangeSpendPolicy"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"bdk/blockchain/enum.Capability.html\" title=\"enum bdk::blockchain::Capability\">Capability</a>","synthetic":false,"types":["bdk::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>","synthetic":false,"types":["bdk::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"struct\" href=\"bdk/struct.FeeRate.html\" title=\"struct bdk::FeeRate\">FeeRate</a>","synthetic":false,"types":["bdk::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["bdk::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["bdk::wallet::tx_builder::ChangeSpendPolicy"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl Freeze for <a class=\"struct\" href=\"bdk/struct.FeeRate.html\" title=\"struct bdk::FeeRate\">FeeRate</a>","synthetic":true,"types":["bdk::types::FeeRate"]},{"text":"impl Freeze for <a class=\"struct\" href=\"bdk/struct.UTXO.html\" title=\"struct bdk::UTXO\">UTXO</a>","synthetic":true,"types":["bdk::types::UTXO"]},{"text":"impl Freeze for <a class=\"struct\" href=\"bdk/struct.TransactionDetails.html\" title=\"struct bdk::TransactionDetails\">TransactionDetails</a>","synthetic":true,"types":["bdk::types::TransactionDetails"]},{"text":"impl Freeze for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":true,"types":["bdk::error::Error"]},{"text":"impl Freeze for <a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>","synthetic":true,"types":["bdk::types::ScriptType"]},{"text":"impl Freeze for <a class=\"struct\" href=\"bdk/blockchain/struct.OfflineBlockchain.html\" title=\"struct bdk::blockchain::OfflineBlockchain\">OfflineBlockchain</a>","synthetic":true,"types":["bdk::blockchain::OfflineBlockchain"]},{"text":"impl Freeze for <a class=\"struct\" href=\"bdk/blockchain/struct.NoopProgress.html\" title=\"struct bdk::blockchain::NoopProgress\">NoopProgress</a>","synthetic":true,"types":["bdk::blockchain::NoopProgress"]},{"text":"impl Freeze for <a class=\"struct\" href=\"bdk/blockchain/struct.LogProgress.html\" title=\"struct bdk::blockchain::LogProgress\">LogProgress</a>","synthetic":true,"types":["bdk::blockchain::LogProgress"]},{"text":"impl Freeze for <a class=\"enum\" href=\"bdk/blockchain/enum.Capability.html\" title=\"enum bdk::blockchain::Capability\">Capability</a>","synthetic":true,"types":["bdk::blockchain::Capability"]},{"text":"impl !Freeze for <a class=\"struct\" href=\"bdk/blockchain/electrum/struct.ElectrumBlockchain.html\" title=\"struct bdk::blockchain::electrum::ElectrumBlockchain\">ElectrumBlockchain</a>","synthetic":true,"types":["bdk::blockchain::electrum::ElectrumBlockchain"]},{"text":"impl Freeze for <a class=\"struct\" href=\"bdk/blockchain/esplora/struct.EsploraBlockchain.html\" title=\"struct bdk::blockchain::esplora::EsploraBlockchain\">EsploraBlockchain</a>","synthetic":true,"types":["bdk::blockchain::esplora::EsploraBlockchain"]},{"text":"impl Freeze for <a class=\"enum\" href=\"bdk/blockchain/esplora/enum.EsploraError.html\" title=\"enum bdk::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":true,"types":["bdk::blockchain::esplora::EsploraError"]},{"text":"impl !Freeze for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.Mempool.html\" title=\"struct bdk::blockchain::compact_filters::Mempool\">Mempool</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::peer::Mempool"]},{"text":"impl Freeze for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.Peer.html\" title=\"struct bdk::blockchain::compact_filters::Peer\">Peer</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::peer::Peer"]},{"text":"impl Freeze for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html\" title=\"struct bdk::blockchain::compact_filters::CompactFiltersBlockchain\">CompactFiltersBlockchain</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::CompactFiltersBlockchain"]},{"text":"impl Freeze for <a class=\"enum\" href=\"bdk/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum bdk::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl Freeze for <a class=\"struct\" href=\"bdk/database/memory/struct.MemoryDatabase.html\" title=\"struct bdk::database::memory::MemoryDatabase\">MemoryDatabase</a>","synthetic":true,"types":["bdk::database::memory::MemoryDatabase"]},{"text":"impl Freeze for <a class=\"enum\" href=\"bdk/descriptor/error/enum.Error.html\" title=\"enum bdk::descriptor::error::Error\">Error</a>","synthetic":true,"types":["bdk::descriptor::error::Error"]},{"text":"impl Freeze for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.PKOrF.html\" title=\"struct bdk::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":true,"types":["bdk::descriptor::policy::PKOrF"]},{"text":"impl Freeze for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Policy.html\" title=\"struct bdk::descriptor::policy::Policy\">Policy</a>","synthetic":true,"types":["bdk::descriptor::policy::Policy"]},{"text":"impl Freeze for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":true,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl Freeze for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum bdk::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":true,"types":["bdk::descriptor::policy::SatisfiableItem"]},{"text":"impl Freeze for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.Satisfaction.html\" title=\"enum bdk::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":true,"types":["bdk::descriptor::policy::Satisfaction"]},{"text":"impl Freeze for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.PolicyError.html\" title=\"enum bdk::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":true,"types":["bdk::descriptor::policy::PolicyError"]},{"text":"impl<B, D> !Freeze for <a class=\"struct\" href=\"bdk/wallet/struct.Wallet.html\" title=\"struct bdk::wallet::Wallet\">Wallet</a><B, D>","synthetic":true,"types":["bdk::wallet::Wallet"]},{"text":"impl Freeze for <a class=\"enum\" href=\"bdk/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum bdk::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":true,"types":["bdk::wallet::address_validator::AddressValidatorError"]},{"text":"impl Freeze for <a class=\"struct\" href=\"bdk/wallet/coin_selection/struct.CoinSelectionResult.html\" title=\"struct bdk::wallet::coin_selection::CoinSelectionResult\">CoinSelectionResult</a>","synthetic":true,"types":["bdk::wallet::coin_selection::CoinSelectionResult"]},{"text":"impl Freeze for <a class=\"struct\" href=\"bdk/wallet/coin_selection/struct.DumbCoinSelection.html\" title=\"struct bdk::wallet::coin_selection::DumbCoinSelection\">DumbCoinSelection</a>","synthetic":true,"types":["bdk::wallet::coin_selection::DumbCoinSelection"]},{"text":"impl Freeze for <a class=\"struct\" href=\"bdk/wallet/export/struct.WalletExport.html\" title=\"struct bdk::wallet::export::WalletExport\">WalletExport</a>","synthetic":true,"types":["bdk::wallet::export::WalletExport"]},{"text":"impl Freeze for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignerOrdering.html\" title=\"struct bdk::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":true,"types":["bdk::wallet::signer::SignerOrdering"]},{"text":"impl<Pk> Freeze for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignersContainer.html\" title=\"struct bdk::wallet::signer::SignersContainer\">SignersContainer</a><Pk>","synthetic":true,"types":["bdk::wallet::signer::SignersContainer"]},{"text":"impl<Pk> Freeze for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerId.html\" title=\"enum bdk::wallet::signer::SignerId\">SignerId</a><Pk> <span class=\"where fmt-newline\">where<br> <Pk as <a class=\"trait\" href=\"bdk/descriptor/trait.MiniscriptKey.html\" title=\"trait bdk::descriptor::MiniscriptKey\">MiniscriptKey</a>>::<a class=\"type\" href=\"bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash\" title=\"type bdk::descriptor::MiniscriptKey::Hash\">Hash</a>: Freeze, </span>","synthetic":true,"types":["bdk::wallet::signer::SignerId"]},{"text":"impl Freeze for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerError.html\" title=\"enum bdk::wallet::signer::SignerError\">SignerError</a>","synthetic":true,"types":["bdk::wallet::signer::SignerError"]},{"text":"impl<Cs> Freeze for <a class=\"struct\" href=\"bdk/wallet/tx_builder/struct.TxBuilder.html\" title=\"struct bdk::wallet::tx_builder::TxBuilder\">TxBuilder</a><Cs> <span class=\"where fmt-newline\">where<br> Cs: Freeze, </span>","synthetic":true,"types":["bdk::wallet::tx_builder::TxBuilder"]},{"text":"impl Freeze for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":true,"types":["bdk::wallet::tx_builder::TxOrdering"]},{"text":"impl Freeze for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":true,"types":["bdk::wallet::tx_builder::ChangeSpendPolicy"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/struct.FeeRate.html\" title=\"struct bdk::FeeRate\">FeeRate</a>","synthetic":true,"types":["bdk::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/struct.UTXO.html\" title=\"struct bdk::UTXO\">UTXO</a>","synthetic":true,"types":["bdk::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/struct.TransactionDetails.html\" title=\"struct bdk::TransactionDetails\">TransactionDetails</a>","synthetic":true,"types":["bdk::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":true,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>","synthetic":true,"types":["bdk::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/blockchain/struct.OfflineBlockchain.html\" title=\"struct bdk::blockchain::OfflineBlockchain\">OfflineBlockchain</a>","synthetic":true,"types":["bdk::blockchain::OfflineBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/blockchain/struct.NoopProgress.html\" title=\"struct bdk::blockchain::NoopProgress\">NoopProgress</a>","synthetic":true,"types":["bdk::blockchain::NoopProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/blockchain/struct.LogProgress.html\" title=\"struct bdk::blockchain::LogProgress\">LogProgress</a>","synthetic":true,"types":["bdk::blockchain::LogProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"bdk/blockchain/enum.Capability.html\" title=\"enum bdk::blockchain::Capability\">Capability</a>","synthetic":true,"types":["bdk::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/blockchain/electrum/struct.ElectrumBlockchain.html\" title=\"struct bdk::blockchain::electrum::ElectrumBlockchain\">ElectrumBlockchain</a>","synthetic":true,"types":["bdk::blockchain::electrum::ElectrumBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/blockchain/esplora/struct.EsploraBlockchain.html\" title=\"struct bdk::blockchain::esplora::EsploraBlockchain\">EsploraBlockchain</a>","synthetic":true,"types":["bdk::blockchain::esplora::EsploraBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"bdk/blockchain/esplora/enum.EsploraError.html\" title=\"enum bdk::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":true,"types":["bdk::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.Mempool.html\" title=\"struct bdk::blockchain::compact_filters::Mempool\">Mempool</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::peer::Mempool"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.Peer.html\" title=\"struct bdk::blockchain::compact_filters::Peer\">Peer</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::peer::Peer"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html\" title=\"struct bdk::blockchain::compact_filters::CompactFiltersBlockchain\">CompactFiltersBlockchain</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::CompactFiltersBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"bdk/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum bdk::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/database/memory/struct.MemoryDatabase.html\" title=\"struct bdk::database::memory::MemoryDatabase\">MemoryDatabase</a>","synthetic":true,"types":["bdk::database::memory::MemoryDatabase"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"bdk/descriptor/error/enum.Error.html\" title=\"enum bdk::descriptor::error::Error\">Error</a>","synthetic":true,"types":["bdk::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.PKOrF.html\" title=\"struct bdk::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":true,"types":["bdk::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Policy.html\" title=\"struct bdk::descriptor::policy::Policy\">Policy</a>","synthetic":true,"types":["bdk::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":true,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum bdk::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":true,"types":["bdk::descriptor::policy::SatisfiableItem"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.Satisfaction.html\" title=\"enum bdk::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":true,"types":["bdk::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.PolicyError.html\" title=\"enum bdk::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":true,"types":["bdk::descriptor::policy::PolicyError"]},{"text":"impl<B, D> !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/wallet/struct.Wallet.html\" title=\"struct bdk::wallet::Wallet\">Wallet</a><B, D>","synthetic":true,"types":["bdk::wallet::Wallet"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"bdk/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum bdk::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":true,"types":["bdk::wallet::address_validator::AddressValidatorError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/wallet/coin_selection/struct.CoinSelectionResult.html\" title=\"struct bdk::wallet::coin_selection::CoinSelectionResult\">CoinSelectionResult</a>","synthetic":true,"types":["bdk::wallet::coin_selection::CoinSelectionResult"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/wallet/coin_selection/struct.DumbCoinSelection.html\" title=\"struct bdk::wallet::coin_selection::DumbCoinSelection\">DumbCoinSelection</a>","synthetic":true,"types":["bdk::wallet::coin_selection::DumbCoinSelection"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/wallet/export/struct.WalletExport.html\" title=\"struct bdk::wallet::export::WalletExport\">WalletExport</a>","synthetic":true,"types":["bdk::wallet::export::WalletExport"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignerOrdering.html\" title=\"struct bdk::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":true,"types":["bdk::wallet::signer::SignerOrdering"]},{"text":"impl<Pk> !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignersContainer.html\" title=\"struct bdk::wallet::signer::SignersContainer\">SignersContainer</a><Pk>","synthetic":true,"types":["bdk::wallet::signer::SignersContainer"]},{"text":"impl<Pk> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerId.html\" title=\"enum bdk::wallet::signer::SignerId\">SignerId</a><Pk> <span class=\"where fmt-newline\">where<br> <Pk as <a class=\"trait\" href=\"bdk/descriptor/trait.MiniscriptKey.html\" title=\"trait bdk::descriptor::MiniscriptKey\">MiniscriptKey</a>>::<a class=\"type\" href=\"bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash\" title=\"type bdk::descriptor::MiniscriptKey::Hash\">Hash</a>: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a>, </span>","synthetic":true,"types":["bdk::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerError.html\" title=\"enum bdk::wallet::signer::SignerError\">SignerError</a>","synthetic":true,"types":["bdk::wallet::signer::SignerError"]},{"text":"impl<Cs> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"bdk/wallet/tx_builder/struct.TxBuilder.html\" title=\"struct bdk::wallet::tx_builder::TxBuilder\">TxBuilder</a><Cs> <span class=\"where fmt-newline\">where<br> Cs: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a>, </span>","synthetic":true,"types":["bdk::wallet::tx_builder::TxBuilder"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":true,"types":["bdk::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":true,"types":["bdk::wallet::tx_builder::ChangeSpendPolicy"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"enum\" href=\"bdk/blockchain/enum.Capability.html\" title=\"enum bdk::blockchain::Capability\">Capability</a>","synthetic":false,"types":["bdk::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>","synthetic":false,"types":["bdk::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"struct\" href=\"bdk/struct.UTXO.html\" title=\"struct bdk::UTXO\">UTXO</a>","synthetic":false,"types":["bdk::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"struct\" href=\"bdk/struct.TransactionDetails.html\" title=\"struct bdk::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["bdk::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"enum\" href=\"bdk/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum bdk::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":false,"types":["bdk::wallet::address_validator::AddressValidatorError"]},{"text":"impl<Pk: <a class=\"trait\" href=\"bdk/descriptor/trait.MiniscriptKey.html\" title=\"trait bdk::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerId.html\" title=\"enum bdk::wallet::signer::SignerId\">SignerId</a><Pk>","synthetic":false,"types":["bdk::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerError.html\" title=\"enum bdk::wallet::signer::SignerError\">SignerError</a>","synthetic":false,"types":["bdk::wallet::signer::SignerError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignerOrdering.html\" title=\"struct bdk::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["bdk::wallet::signer::SignerOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["bdk::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["bdk::wallet::tx_builder::ChangeSpendPolicy"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"enum\" href=\"bdk/blockchain/enum.Capability.html\" title=\"enum bdk::blockchain::Capability\">Capability</a>","synthetic":false,"types":["bdk::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>","synthetic":false,"types":["bdk::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"struct\" href=\"bdk/struct.FeeRate.html\" title=\"struct bdk::FeeRate\">FeeRate</a>","synthetic":false,"types":["bdk::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"struct\" href=\"bdk/struct.UTXO.html\" title=\"struct bdk::UTXO\">UTXO</a>","synthetic":false,"types":["bdk::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"struct\" href=\"bdk/struct.TransactionDetails.html\" title=\"struct bdk::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["bdk::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"enum\" href=\"bdk/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum bdk::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":false,"types":["bdk::wallet::address_validator::AddressValidatorError"]},{"text":"impl<Pk: <a class=\"trait\" href=\"bdk/descriptor/trait.MiniscriptKey.html\" title=\"trait bdk::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerId.html\" title=\"enum bdk::wallet::signer::SignerId\">SignerId</a><Pk>","synthetic":false,"types":["bdk::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerError.html\" title=\"enum bdk::wallet::signer::SignerError\">SignerError</a>","synthetic":false,"types":["bdk::wallet::signer::SignerError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignerOrdering.html\" title=\"struct bdk::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["bdk::wallet::signer::SignerOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["bdk::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["bdk::wallet::tx_builder::ChangeSpendPolicy"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/struct.FeeRate.html\" title=\"struct bdk::FeeRate\">FeeRate</a>","synthetic":true,"types":["bdk::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/struct.UTXO.html\" title=\"struct bdk::UTXO\">UTXO</a>","synthetic":true,"types":["bdk::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/struct.TransactionDetails.html\" title=\"struct bdk::TransactionDetails\">TransactionDetails</a>","synthetic":true,"types":["bdk::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":true,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>","synthetic":true,"types":["bdk::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/blockchain/struct.OfflineBlockchain.html\" title=\"struct bdk::blockchain::OfflineBlockchain\">OfflineBlockchain</a>","synthetic":true,"types":["bdk::blockchain::OfflineBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/blockchain/struct.NoopProgress.html\" title=\"struct bdk::blockchain::NoopProgress\">NoopProgress</a>","synthetic":true,"types":["bdk::blockchain::NoopProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/blockchain/struct.LogProgress.html\" title=\"struct bdk::blockchain::LogProgress\">LogProgress</a>","synthetic":true,"types":["bdk::blockchain::LogProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"bdk/blockchain/enum.Capability.html\" title=\"enum bdk::blockchain::Capability\">Capability</a>","synthetic":true,"types":["bdk::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/blockchain/electrum/struct.ElectrumBlockchain.html\" title=\"struct bdk::blockchain::electrum::ElectrumBlockchain\">ElectrumBlockchain</a>","synthetic":true,"types":["bdk::blockchain::electrum::ElectrumBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/blockchain/esplora/struct.EsploraBlockchain.html\" title=\"struct bdk::blockchain::esplora::EsploraBlockchain\">EsploraBlockchain</a>","synthetic":true,"types":["bdk::blockchain::esplora::EsploraBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"bdk/blockchain/esplora/enum.EsploraError.html\" title=\"enum bdk::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":true,"types":["bdk::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.Mempool.html\" title=\"struct bdk::blockchain::compact_filters::Mempool\">Mempool</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::peer::Mempool"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.Peer.html\" title=\"struct bdk::blockchain::compact_filters::Peer\">Peer</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::peer::Peer"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html\" title=\"struct bdk::blockchain::compact_filters::CompactFiltersBlockchain\">CompactFiltersBlockchain</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::CompactFiltersBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"bdk/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum bdk::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/database/memory/struct.MemoryDatabase.html\" title=\"struct bdk::database::memory::MemoryDatabase\">MemoryDatabase</a>","synthetic":true,"types":["bdk::database::memory::MemoryDatabase"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"bdk/descriptor/error/enum.Error.html\" title=\"enum bdk::descriptor::error::Error\">Error</a>","synthetic":true,"types":["bdk::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.PKOrF.html\" title=\"struct bdk::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":true,"types":["bdk::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Policy.html\" title=\"struct bdk::descriptor::policy::Policy\">Policy</a>","synthetic":true,"types":["bdk::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":true,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum bdk::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":true,"types":["bdk::descriptor::policy::SatisfiableItem"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.Satisfaction.html\" title=\"enum bdk::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":true,"types":["bdk::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.PolicyError.html\" title=\"enum bdk::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":true,"types":["bdk::descriptor::policy::PolicyError"]},{"text":"impl<B, D> !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/wallet/struct.Wallet.html\" title=\"struct bdk::wallet::Wallet\">Wallet</a><B, D>","synthetic":true,"types":["bdk::wallet::Wallet"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"bdk/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum bdk::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":true,"types":["bdk::wallet::address_validator::AddressValidatorError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/wallet/coin_selection/struct.CoinSelectionResult.html\" title=\"struct bdk::wallet::coin_selection::CoinSelectionResult\">CoinSelectionResult</a>","synthetic":true,"types":["bdk::wallet::coin_selection::CoinSelectionResult"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/wallet/coin_selection/struct.DumbCoinSelection.html\" title=\"struct bdk::wallet::coin_selection::DumbCoinSelection\">DumbCoinSelection</a>","synthetic":true,"types":["bdk::wallet::coin_selection::DumbCoinSelection"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/wallet/export/struct.WalletExport.html\" title=\"struct bdk::wallet::export::WalletExport\">WalletExport</a>","synthetic":true,"types":["bdk::wallet::export::WalletExport"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignerOrdering.html\" title=\"struct bdk::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":true,"types":["bdk::wallet::signer::SignerOrdering"]},{"text":"impl<Pk> !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignersContainer.html\" title=\"struct bdk::wallet::signer::SignersContainer\">SignersContainer</a><Pk>","synthetic":true,"types":["bdk::wallet::signer::SignersContainer"]},{"text":"impl<Pk> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerId.html\" title=\"enum bdk::wallet::signer::SignerId\">SignerId</a><Pk> <span class=\"where fmt-newline\">where<br> <Pk as <a class=\"trait\" href=\"bdk/descriptor/trait.MiniscriptKey.html\" title=\"trait bdk::descriptor::MiniscriptKey\">MiniscriptKey</a>>::<a class=\"type\" href=\"bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash\" title=\"type bdk::descriptor::MiniscriptKey::Hash\">Hash</a>: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a>, </span>","synthetic":true,"types":["bdk::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerError.html\" title=\"enum bdk::wallet::signer::SignerError\">SignerError</a>","synthetic":true,"types":["bdk::wallet::signer::SignerError"]},{"text":"impl<Cs> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"bdk/wallet/tx_builder/struct.TxBuilder.html\" title=\"struct bdk::wallet::tx_builder::TxBuilder\">TxBuilder</a><Cs> <span class=\"where fmt-newline\">where<br> Cs: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a>, </span>","synthetic":true,"types":["bdk::wallet::tx_builder::TxBuilder"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":true,"types":["bdk::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":true,"types":["bdk::wallet::tx_builder::ChangeSpendPolicy"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/struct.FeeRate.html\" title=\"struct bdk::FeeRate\">FeeRate</a>","synthetic":true,"types":["bdk::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/struct.UTXO.html\" title=\"struct bdk::UTXO\">UTXO</a>","synthetic":true,"types":["bdk::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/struct.TransactionDetails.html\" title=\"struct bdk::TransactionDetails\">TransactionDetails</a>","synthetic":true,"types":["bdk::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":true,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>","synthetic":true,"types":["bdk::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/blockchain/struct.OfflineBlockchain.html\" title=\"struct bdk::blockchain::OfflineBlockchain\">OfflineBlockchain</a>","synthetic":true,"types":["bdk::blockchain::OfflineBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/blockchain/struct.NoopProgress.html\" title=\"struct bdk::blockchain::NoopProgress\">NoopProgress</a>","synthetic":true,"types":["bdk::blockchain::NoopProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/blockchain/struct.LogProgress.html\" title=\"struct bdk::blockchain::LogProgress\">LogProgress</a>","synthetic":true,"types":["bdk::blockchain::LogProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"bdk/blockchain/enum.Capability.html\" title=\"enum bdk::blockchain::Capability\">Capability</a>","synthetic":true,"types":["bdk::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/blockchain/electrum/struct.ElectrumBlockchain.html\" title=\"struct bdk::blockchain::electrum::ElectrumBlockchain\">ElectrumBlockchain</a>","synthetic":true,"types":["bdk::blockchain::electrum::ElectrumBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/blockchain/esplora/struct.EsploraBlockchain.html\" title=\"struct bdk::blockchain::esplora::EsploraBlockchain\">EsploraBlockchain</a>","synthetic":true,"types":["bdk::blockchain::esplora::EsploraBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"bdk/blockchain/esplora/enum.EsploraError.html\" title=\"enum bdk::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":true,"types":["bdk::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.Mempool.html\" title=\"struct bdk::blockchain::compact_filters::Mempool\">Mempool</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::peer::Mempool"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.Peer.html\" title=\"struct bdk::blockchain::compact_filters::Peer\">Peer</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::peer::Peer"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html\" title=\"struct bdk::blockchain::compact_filters::CompactFiltersBlockchain\">CompactFiltersBlockchain</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::CompactFiltersBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"bdk/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum bdk::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/database/memory/struct.MemoryDatabase.html\" title=\"struct bdk::database::memory::MemoryDatabase\">MemoryDatabase</a>","synthetic":true,"types":["bdk::database::memory::MemoryDatabase"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"bdk/descriptor/error/enum.Error.html\" title=\"enum bdk::descriptor::error::Error\">Error</a>","synthetic":true,"types":["bdk::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.PKOrF.html\" title=\"struct bdk::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":true,"types":["bdk::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Policy.html\" title=\"struct bdk::descriptor::policy::Policy\">Policy</a>","synthetic":true,"types":["bdk::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":true,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum bdk::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":true,"types":["bdk::descriptor::policy::SatisfiableItem"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.Satisfaction.html\" title=\"enum bdk::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":true,"types":["bdk::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.PolicyError.html\" title=\"enum bdk::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":true,"types":["bdk::descriptor::policy::PolicyError"]},{"text":"impl<B, D> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/wallet/struct.Wallet.html\" title=\"struct bdk::wallet::Wallet\">Wallet</a><B, D> <span class=\"where fmt-newline\">where<br> B: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a>,<br> D: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a>, </span>","synthetic":true,"types":["bdk::wallet::Wallet"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"bdk/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum bdk::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":true,"types":["bdk::wallet::address_validator::AddressValidatorError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/wallet/coin_selection/struct.CoinSelectionResult.html\" title=\"struct bdk::wallet::coin_selection::CoinSelectionResult\">CoinSelectionResult</a>","synthetic":true,"types":["bdk::wallet::coin_selection::CoinSelectionResult"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/wallet/coin_selection/struct.DumbCoinSelection.html\" title=\"struct bdk::wallet::coin_selection::DumbCoinSelection\">DumbCoinSelection</a>","synthetic":true,"types":["bdk::wallet::coin_selection::DumbCoinSelection"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/wallet/export/struct.WalletExport.html\" title=\"struct bdk::wallet::export::WalletExport\">WalletExport</a>","synthetic":true,"types":["bdk::wallet::export::WalletExport"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignerOrdering.html\" title=\"struct bdk::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":true,"types":["bdk::wallet::signer::SignerOrdering"]},{"text":"impl<Pk> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignersContainer.html\" title=\"struct bdk::wallet::signer::SignersContainer\">SignersContainer</a><Pk> <span class=\"where fmt-newline\">where<br> <Pk as <a class=\"trait\" href=\"bdk/descriptor/trait.MiniscriptKey.html\" title=\"trait bdk::descriptor::MiniscriptKey\">MiniscriptKey</a>>::<a class=\"type\" href=\"bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash\" title=\"type bdk::descriptor::MiniscriptKey::Hash\">Hash</a>: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a>, </span>","synthetic":true,"types":["bdk::wallet::signer::SignersContainer"]},{"text":"impl<Pk> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerId.html\" title=\"enum bdk::wallet::signer::SignerId\">SignerId</a><Pk> <span class=\"where fmt-newline\">where<br> <Pk as <a class=\"trait\" href=\"bdk/descriptor/trait.MiniscriptKey.html\" title=\"trait bdk::descriptor::MiniscriptKey\">MiniscriptKey</a>>::<a class=\"type\" href=\"bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash\" title=\"type bdk::descriptor::MiniscriptKey::Hash\">Hash</a>: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a>, </span>","synthetic":true,"types":["bdk::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerError.html\" title=\"enum bdk::wallet::signer::SignerError\">SignerError</a>","synthetic":true,"types":["bdk::wallet::signer::SignerError"]},{"text":"impl<Cs> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"bdk/wallet/tx_builder/struct.TxBuilder.html\" title=\"struct bdk::wallet::tx_builder::TxBuilder\">TxBuilder</a><Cs> <span class=\"where fmt-newline\">where<br> Cs: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a>, </span>","synthetic":true,"types":["bdk::wallet::tx_builder::TxBuilder"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":true,"types":["bdk::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":true,"types":["bdk::wallet::tx_builder::ChangeSpendPolicy"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html\" title=\"trait core::str::FromStr\">FromStr</a> for <a class=\"struct\" href=\"bdk/wallet/export/struct.WalletExport.html\" title=\"struct bdk::wallet::export::WalletExport\">WalletExport</a>","synthetic":false,"types":["bdk::wallet::export::WalletExport"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl<'de> <a class=\"trait\" href=\"https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html\" title=\"trait serde::de::Deserialize\">Deserialize</a><'de> for <a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>","synthetic":false,"types":["bdk::types::ScriptType"]},{"text":"impl<'de> <a class=\"trait\" href=\"https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html\" title=\"trait serde::de::Deserialize\">Deserialize</a><'de> for <a class=\"struct\" href=\"bdk/struct.UTXO.html\" title=\"struct bdk::UTXO\">UTXO</a>","synthetic":false,"types":["bdk::types::UTXO"]},{"text":"impl<'de> <a class=\"trait\" href=\"https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html\" title=\"trait serde::de::Deserialize\">Deserialize</a><'de> for <a class=\"struct\" href=\"bdk/struct.TransactionDetails.html\" title=\"struct bdk::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["bdk::types::TransactionDetails"]},{"text":"impl<'de> <a class=\"trait\" href=\"https://docs.rs/serde/1.0.116/serde/de/trait.Deserialize.html\" title=\"trait serde::de::Deserialize\">Deserialize</a><'de> for <a class=\"struct\" href=\"bdk/wallet/export/struct.WalletExport.html\" title=\"struct bdk::wallet::export::WalletExport\">WalletExport</a>","synthetic":false,"types":["bdk::wallet::export::WalletExport"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.PKOrF.html\" title=\"struct bdk::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":false,"types":["bdk::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum bdk::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":false,"types":["bdk::descriptor::policy::SatisfiableItem"]},{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.Satisfaction.html\" title=\"enum bdk::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":false,"types":["bdk::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Policy.html\" title=\"struct bdk::descriptor::policy::Policy\">Policy</a>","synthetic":false,"types":["bdk::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>","synthetic":false,"types":["bdk::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"struct\" href=\"bdk/struct.UTXO.html\" title=\"struct bdk::UTXO\">UTXO</a>","synthetic":false,"types":["bdk::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"struct\" href=\"bdk/struct.TransactionDetails.html\" title=\"struct bdk::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["bdk::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.116/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"struct\" href=\"bdk/wallet/export/struct.WalletExport.html\" title=\"struct bdk::wallet::export::WalletExport\">WalletExport</a>","synthetic":false,"types":["bdk::wallet::export::WalletExport"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/error/trait.Error.html\" title=\"trait std::error::Error\">Error</a> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":false,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/error/trait.Error.html\" title=\"trait std::error::Error\">Error</a> for <a class=\"enum\" href=\"bdk/blockchain/esplora/enum.EsploraError.html\" title=\"enum bdk::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":false,"types":["bdk::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/error/trait.Error.html\" title=\"trait std::error::Error\">Error</a> for <a class=\"enum\" href=\"bdk/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum bdk::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":false,"types":["bdk::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/error/trait.Error.html\" title=\"trait std::error::Error\">Error</a> for <a class=\"enum\" href=\"bdk/descriptor/error/enum.Error.html\" title=\"enum bdk::descriptor::error::Error\">Error</a>","synthetic":false,"types":["bdk::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/error/trait.Error.html\" title=\"trait std::error::Error\">Error</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.PolicyError.html\" title=\"enum bdk::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":false,"types":["bdk::descriptor::policy::PolicyError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/error/trait.Error.html\" title=\"trait std::error::Error\">Error</a> for <a class=\"enum\" href=\"bdk/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum bdk::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":false,"types":["bdk::wallet::address_validator::AddressValidatorError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/error/trait.Error.html\" title=\"trait std::error::Error\">Error</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerError.html\" title=\"enum bdk::wallet::signer::SignerError\">SignerError</a>","synthetic":false,"types":["bdk::wallet::signer::SignerError"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/struct.FeeRate.html\" title=\"struct bdk::FeeRate\">FeeRate</a>","synthetic":true,"types":["bdk::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/struct.UTXO.html\" title=\"struct bdk::UTXO\">UTXO</a>","synthetic":true,"types":["bdk::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/struct.TransactionDetails.html\" title=\"struct bdk::TransactionDetails\">TransactionDetails</a>","synthetic":true,"types":["bdk::types::TransactionDetails"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":true,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>","synthetic":true,"types":["bdk::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/blockchain/struct.OfflineBlockchain.html\" title=\"struct bdk::blockchain::OfflineBlockchain\">OfflineBlockchain</a>","synthetic":true,"types":["bdk::blockchain::OfflineBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/blockchain/struct.NoopProgress.html\" title=\"struct bdk::blockchain::NoopProgress\">NoopProgress</a>","synthetic":true,"types":["bdk::blockchain::NoopProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/blockchain/struct.LogProgress.html\" title=\"struct bdk::blockchain::LogProgress\">LogProgress</a>","synthetic":true,"types":["bdk::blockchain::LogProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"bdk/blockchain/enum.Capability.html\" title=\"enum bdk::blockchain::Capability\">Capability</a>","synthetic":true,"types":["bdk::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/blockchain/electrum/struct.ElectrumBlockchain.html\" title=\"struct bdk::blockchain::electrum::ElectrumBlockchain\">ElectrumBlockchain</a>","synthetic":true,"types":["bdk::blockchain::electrum::ElectrumBlockchain"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/blockchain/esplora/struct.EsploraBlockchain.html\" title=\"struct bdk::blockchain::esplora::EsploraBlockchain\">EsploraBlockchain</a>","synthetic":true,"types":["bdk::blockchain::esplora::EsploraBlockchain"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"bdk/blockchain/esplora/enum.EsploraError.html\" title=\"enum bdk::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":true,"types":["bdk::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.Mempool.html\" title=\"struct bdk::blockchain::compact_filters::Mempool\">Mempool</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::peer::Mempool"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.Peer.html\" title=\"struct bdk::blockchain::compact_filters::Peer\">Peer</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::peer::Peer"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html\" title=\"struct bdk::blockchain::compact_filters::CompactFiltersBlockchain\">CompactFiltersBlockchain</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::CompactFiltersBlockchain"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"bdk/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum bdk::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/database/memory/struct.MemoryDatabase.html\" title=\"struct bdk::database::memory::MemoryDatabase\">MemoryDatabase</a>","synthetic":true,"types":["bdk::database::memory::MemoryDatabase"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"bdk/descriptor/error/enum.Error.html\" title=\"enum bdk::descriptor::error::Error\">Error</a>","synthetic":true,"types":["bdk::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.PKOrF.html\" title=\"struct bdk::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":true,"types":["bdk::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Policy.html\" title=\"struct bdk::descriptor::policy::Policy\">Policy</a>","synthetic":true,"types":["bdk::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":true,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum bdk::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":true,"types":["bdk::descriptor::policy::SatisfiableItem"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.Satisfaction.html\" title=\"enum bdk::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":true,"types":["bdk::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.PolicyError.html\" title=\"enum bdk::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":true,"types":["bdk::descriptor::policy::PolicyError"]},{"text":"impl<B, D> !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/wallet/struct.Wallet.html\" title=\"struct bdk::wallet::Wallet\">Wallet</a><B, D>","synthetic":true,"types":["bdk::wallet::Wallet"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"bdk/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum bdk::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":true,"types":["bdk::wallet::address_validator::AddressValidatorError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/wallet/coin_selection/struct.CoinSelectionResult.html\" title=\"struct bdk::wallet::coin_selection::CoinSelectionResult\">CoinSelectionResult</a>","synthetic":true,"types":["bdk::wallet::coin_selection::CoinSelectionResult"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/wallet/coin_selection/struct.DumbCoinSelection.html\" title=\"struct bdk::wallet::coin_selection::DumbCoinSelection\">DumbCoinSelection</a>","synthetic":true,"types":["bdk::wallet::coin_selection::DumbCoinSelection"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/wallet/export/struct.WalletExport.html\" title=\"struct bdk::wallet::export::WalletExport\">WalletExport</a>","synthetic":true,"types":["bdk::wallet::export::WalletExport"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignerOrdering.html\" title=\"struct bdk::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":true,"types":["bdk::wallet::signer::SignerOrdering"]},{"text":"impl<Pk> !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignersContainer.html\" title=\"struct bdk::wallet::signer::SignersContainer\">SignersContainer</a><Pk>","synthetic":true,"types":["bdk::wallet::signer::SignersContainer"]},{"text":"impl<Pk> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerId.html\" title=\"enum bdk::wallet::signer::SignerId\">SignerId</a><Pk> <span class=\"where fmt-newline\">where<br> <Pk as <a class=\"trait\" href=\"bdk/descriptor/trait.MiniscriptKey.html\" title=\"trait bdk::descriptor::MiniscriptKey\">MiniscriptKey</a>>::<a class=\"type\" href=\"bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash\" title=\"type bdk::descriptor::MiniscriptKey::Hash\">Hash</a>: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a>, </span>","synthetic":true,"types":["bdk::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerError.html\" title=\"enum bdk::wallet::signer::SignerError\">SignerError</a>","synthetic":true,"types":["bdk::wallet::signer::SignerError"]},{"text":"impl<Cs> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"bdk/wallet/tx_builder/struct.TxBuilder.html\" title=\"struct bdk::wallet::tx_builder::TxBuilder\">TxBuilder</a><Cs> <span class=\"where fmt-newline\">where<br> Cs: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a>, </span>","synthetic":true,"types":["bdk::wallet::tx_builder::TxBuilder"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":true,"types":["bdk::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":true,"types":["bdk::wallet::tx_builder::ChangeSpendPolicy"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/struct.FeeRate.html\" title=\"struct bdk::FeeRate\">FeeRate</a>","synthetic":true,"types":["bdk::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/struct.UTXO.html\" title=\"struct bdk::UTXO\">UTXO</a>","synthetic":true,"types":["bdk::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/struct.TransactionDetails.html\" title=\"struct bdk::TransactionDetails\">TransactionDetails</a>","synthetic":true,"types":["bdk::types::TransactionDetails"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"bdk/enum.Error.html\" title=\"enum bdk::Error\">Error</a>","synthetic":true,"types":["bdk::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"bdk/enum.ScriptType.html\" title=\"enum bdk::ScriptType\">ScriptType</a>","synthetic":true,"types":["bdk::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/blockchain/struct.OfflineBlockchain.html\" title=\"struct bdk::blockchain::OfflineBlockchain\">OfflineBlockchain</a>","synthetic":true,"types":["bdk::blockchain::OfflineBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/blockchain/struct.NoopProgress.html\" title=\"struct bdk::blockchain::NoopProgress\">NoopProgress</a>","synthetic":true,"types":["bdk::blockchain::NoopProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/blockchain/struct.LogProgress.html\" title=\"struct bdk::blockchain::LogProgress\">LogProgress</a>","synthetic":true,"types":["bdk::blockchain::LogProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"bdk/blockchain/enum.Capability.html\" title=\"enum bdk::blockchain::Capability\">Capability</a>","synthetic":true,"types":["bdk::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/blockchain/electrum/struct.ElectrumBlockchain.html\" title=\"struct bdk::blockchain::electrum::ElectrumBlockchain\">ElectrumBlockchain</a>","synthetic":true,"types":["bdk::blockchain::electrum::ElectrumBlockchain"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/blockchain/esplora/struct.EsploraBlockchain.html\" title=\"struct bdk::blockchain::esplora::EsploraBlockchain\">EsploraBlockchain</a>","synthetic":true,"types":["bdk::blockchain::esplora::EsploraBlockchain"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"bdk/blockchain/esplora/enum.EsploraError.html\" title=\"enum bdk::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":true,"types":["bdk::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.Mempool.html\" title=\"struct bdk::blockchain::compact_filters::Mempool\">Mempool</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::peer::Mempool"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.Peer.html\" title=\"struct bdk::blockchain::compact_filters::Peer\">Peer</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::peer::Peer"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html\" title=\"struct bdk::blockchain::compact_filters::CompactFiltersBlockchain\">CompactFiltersBlockchain</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::CompactFiltersBlockchain"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"bdk/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum bdk::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":true,"types":["bdk::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/database/memory/struct.MemoryDatabase.html\" title=\"struct bdk::database::memory::MemoryDatabase\">MemoryDatabase</a>","synthetic":true,"types":["bdk::database::memory::MemoryDatabase"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"bdk/descriptor/error/enum.Error.html\" title=\"enum bdk::descriptor::error::Error\">Error</a>","synthetic":true,"types":["bdk::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.PKOrF.html\" title=\"struct bdk::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":true,"types":["bdk::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Policy.html\" title=\"struct bdk::descriptor::policy::Policy\">Policy</a>","synthetic":true,"types":["bdk::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/descriptor/policy/struct.Condition.html\" title=\"struct bdk::descriptor::policy::Condition\">Condition</a>","synthetic":true,"types":["bdk::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum bdk::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":true,"types":["bdk::descriptor::policy::SatisfiableItem"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.Satisfaction.html\" title=\"enum bdk::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":true,"types":["bdk::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"bdk/descriptor/policy/enum.PolicyError.html\" title=\"enum bdk::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":true,"types":["bdk::descriptor::policy::PolicyError"]},{"text":"impl<B, D> !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/wallet/struct.Wallet.html\" title=\"struct bdk::wallet::Wallet\">Wallet</a><B, D>","synthetic":true,"types":["bdk::wallet::Wallet"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"bdk/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum bdk::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":true,"types":["bdk::wallet::address_validator::AddressValidatorError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/wallet/coin_selection/struct.CoinSelectionResult.html\" title=\"struct bdk::wallet::coin_selection::CoinSelectionResult\">CoinSelectionResult</a>","synthetic":true,"types":["bdk::wallet::coin_selection::CoinSelectionResult"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/wallet/coin_selection/struct.DumbCoinSelection.html\" title=\"struct bdk::wallet::coin_selection::DumbCoinSelection\">DumbCoinSelection</a>","synthetic":true,"types":["bdk::wallet::coin_selection::DumbCoinSelection"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/wallet/export/struct.WalletExport.html\" title=\"struct bdk::wallet::export::WalletExport\">WalletExport</a>","synthetic":true,"types":["bdk::wallet::export::WalletExport"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignerOrdering.html\" title=\"struct bdk::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":true,"types":["bdk::wallet::signer::SignerOrdering"]},{"text":"impl<Pk> !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/wallet/signer/struct.SignersContainer.html\" title=\"struct bdk::wallet::signer::SignersContainer\">SignersContainer</a><Pk>","synthetic":true,"types":["bdk::wallet::signer::SignersContainer"]},{"text":"impl<Pk> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerId.html\" title=\"enum bdk::wallet::signer::SignerId\">SignerId</a><Pk> <span class=\"where fmt-newline\">where<br> <Pk as <a class=\"trait\" href=\"bdk/descriptor/trait.MiniscriptKey.html\" title=\"trait bdk::descriptor::MiniscriptKey\">MiniscriptKey</a>>::<a class=\"type\" href=\"bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash\" title=\"type bdk::descriptor::MiniscriptKey::Hash\">Hash</a>: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a>, </span>","synthetic":true,"types":["bdk::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"bdk/wallet/signer/enum.SignerError.html\" title=\"enum bdk::wallet::signer::SignerError\">SignerError</a>","synthetic":true,"types":["bdk::wallet::signer::SignerError"]},{"text":"impl<Cs> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"bdk/wallet/tx_builder/struct.TxBuilder.html\" title=\"struct bdk::wallet::tx_builder::TxBuilder\">TxBuilder</a><Cs> <span class=\"where fmt-newline\">where<br> Cs: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a>, </span>","synthetic":true,"types":["bdk::wallet::tx_builder::TxBuilder"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum bdk::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":true,"types":["bdk::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum bdk::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":true,"types":["bdk::wallet::tx_builder::ChangeSpendPolicy"]}];
+if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
--- /dev/null
+ body{background-color:white;color:black;}h1,h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){color:black;}h1.fqn{border-bottom-color:#D5D5D5;}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){border-bottom-color:#DDDDDD;}.in-band{background-color:white;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#F5F5F5;}pre{background-color:#F5F5F5;}.sidebar{background-color:#F1F1F1;}*{scrollbar-color:rgba(36,37,39,0.6) #e6e6e6;}.sidebar{scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;}::-webkit-scrollbar-track{background-color:#ecebeb;}::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar::-webkit-scrollbar-track{background-color:#dcdcdc;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar .current{background-color:#fff;}.source .sidebar{background-color:#fff;}.sidebar .location{border-color:#000;background-color:#fff;color:#333;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#F5F5F5;}.line-numbers span{color:#c67e2d;}.line-numbers .line-highlighted{background-color:#f6fdb0 !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom-color:#ddd;}.docblock table,.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#4E4C4C;}.content .highlighted{color:#000 !important;background-color:#ccc;}.content .highlighted a,.content .highlighted span{color:#000 !important;}.content .highlighted.trait{background-color:#c7b6ff;}.content .highlighted.traitalias{background-color:#c7b6ff;}.content .highlighted.mod,.content .highlighted.externcrate{background-color:#afc6e4;}.content .highlighted.enum{background-color:#b4d1b9;}.content .highlighted.struct{background-color:#e7b1a0;}.content .highlighted.union{background-color:#b7bd49;}.content .highlighted.fn,.content .highlighted.method,.content .highlighted.tymethod{background-color:#c6afb3;}.content .highlighted.type{background-color:#ffc891;}.content .highlighted.foreigntype{background-color:#f5c4ff;}.content .highlighted.attr,.content .highlighted.derive,.content .highlighted.macro{background-color:#8ce488;}.content .highlighted.constant,.content .highlighted.static{background-color:#c3e0ff;}.content .highlighted.primitive{background-color:#9aecff;}.content .highlighted.keyword{background-color:#f99650;}.content .stability::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#508157;}.content span.struct,.content a.struct,.block a.current.struct{color:#ad448e;}.content span.type,.content a.type,.block a.current.type{color:#ba5d00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#cd00e2;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#068000;}.content span.union,.content a.union,.block a.current.union{color:#767b27;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#546e8a;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#2c8093;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#4d76ae;}.content span.trait,.content a.trait,.block a.current.trait{color:#7c5af3;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#6841f1;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#9a6e31;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}pre.rust .comment{color:#8E908C;}pre.rust .doccomment{color:#4D4D4C;}nav:not(.sidebar){border-bottom-color:#e0e0e0;}nav.main .current{border-top-color:#000;border-bottom-color:#000;}nav.main .separator{border:1px solid #000;}a{color:#000;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.stability a{color:#3873AD;}.stab.internal a{color:#304FFE;}a.test-arrow{color:#f5f5f5;}.collapse-toggle{color:#999;}#crate-search{color:#555;background-color:white;border-color:#e0e0e0;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input{color:#555;background-color:white;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input:focus{border-color:#66afe9;}.search-focus:disabled{background-color:#e6e6e6;}#crate-search+.search-input:focus{box-shadow:0 0 8px #078dd8;}.module-item .stab{color:#000;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;}.stab.internal{background:#FFB9B3;border-color:#B71C1C;}.stab.deprecated{background:#F3DFFF;border-color:#7F0087;}.stab.portability{background:#C4ECFF;border-color:#7BA5DB;}.stab.portability>code{color:#000;}#help>div{background:#e9e9e9;border-color:#bfbfbf;}.since{color:grey;}tr.result span.primitive::after,tr.result span.keyword::after{color:black;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#8959A8;}pre.rust .kw-2,pre.rust .prelude-ty{color:#4271AE;}pre.rust .number,pre.rust .string{color:#718C00;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#C82829;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#B76514;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#c7c7c7;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label{color:#999;}:target>code,:target>.in-band{background:#FDFFD3;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.5);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip .tooltiptext{background-color:#000;color:#fff;}.tooltip .tooltiptext::after{border-color:transparent black transparent transparent;}#titles>div:not(.selected){background-color:#e6e6e6;border-top-color:#e6e6e6;}#titles>div:hover,#titles>div.selected{border-top-color:#0089ff;}#titles>div>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#F1F1F1;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#F1F1F1;border-right-color:#000;}#sidebar-filler{background-color:#F1F1F1;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu{border-color:#e0e0e0;background-color:#fff;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus{border-color:#717171;}#theme-choices{border-color:#ccc;background-color:#fff;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#eee;}@media (max-width:700px){#theme-picker{background:#fff;}}#all-types{background-color:#fff;}#all-types:hover{background-color:#f9f9f9;}.search-results td span.alias{color:#000;}.search-results td span.grey{color:#999;}#sidebar-toggle{background-color:#F1F1F1;}#sidebar-toggle:hover{background-color:#E0E0E0;}#source-sidebar{background-color:#F1F1F1;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#E0E0E0;}div.files>.selected{background-color:#fff;}.setting-line>.title{border-bottom-color:#D5D5D5;}
\ No newline at end of file
--- /dev/null
+if(!String.prototype.startsWith){String.prototype.startsWith=function(searchString,position){position=position||0;return this.indexOf(searchString,position)===position}}if(!String.prototype.endsWith){String.prototype.endsWith=function(suffix,length){var l=length||this.length;return this.indexOf(suffix,l-suffix.length)!==-1}}if(!DOMTokenList.prototype.add){DOMTokenList.prototype.add=function(className){if(className&&!hasClass(this,className)){if(this.className&&this.className.length>0){this.className+=" "+className}else{this.className=className}}}}if(!DOMTokenList.prototype.remove){DOMTokenList.prototype.remove=function(className){if(className&&this.className){this.className=(" "+this.className+" ").replace(" "+className+" "," ").trim()}}}function getSearchInput(){return document.getElementsByClassName("search-input")[0]}function getSearchElement(){return document.getElementById("search")}function focusSearchBar(){getSearchInput().focus()}function defocusSearchBar(){getSearchInput().blur()}(function(){"use strict";var itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword","existential","attr","derive","traitalias"];var disableShortcuts=getCurrentValue("rustdoc-disable-shortcuts")==="true";var search_input=getSearchInput();var searchTimeout=null;var currentTab=0;var titleBeforeSearch=document.title;function clearInputTimeout(){if(searchTimeout!==null){clearTimeout(searchTimeout);searchTimeout=null}}function getPageId(){var id=document.location.href.split("#")[1];if(id){return id.split("?")[0].split("&")[0]}return null}function showSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){addClass(elems,"show-it")}var sidebar=document.getElementsByClassName("sidebar")[0];if(sidebar){addClass(sidebar,"mobile");var filler=document.getElementById("sidebar-filler");if(!filler){var div=document.createElement("div");div.id="sidebar-filler";sidebar.appendChild(div)}}var themePickers=document.getElementsByClassName("theme-picker");if(themePickers&&themePickers.length>0){themePickers[0].style.display="none"}}function hideSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){removeClass(elems,"show-it")}var sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"mobile");var filler=document.getElementById("sidebar-filler");if(filler){filler.remove()}document.getElementsByTagName("body")[0].style.marginTop="";var themePickers=document.getElementsByClassName("theme-picker");if(themePickers&&themePickers.length>0){themePickers[0].style.display=null}}function showSearchResults(search){if(search===null||typeof search==='undefined'){search=getSearchElement()}addClass(main,"hidden");removeClass(search,"hidden")}function hideSearchResults(search){if(search===null||typeof search==='undefined'){search=getSearchElement()}addClass(search,"hidden");removeClass(main,"hidden")}var TY_PRIMITIVE=itemTypes.indexOf("primitive");var TY_KEYWORD=itemTypes.indexOf("keyword");function getQueryStringParams(){var params={};window.location.search.substring(1).split("&").map(function(s){var pair=s.split("=");params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function isHidden(elem){return elem.offsetHeight===0}var main=document.getElementById("main");var savedHash="";function handleHashes(ev){var elem;var search=getSearchElement();if(ev!==null&&search&&!hasClass(search,"hidden")&&ev.newURL){hideSearchResults(search);var hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(hash,"","?search=#"+hash)}elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}if(savedHash!==window.location.hash){savedHash=window.location.hash;if(savedHash.length===0){return}elem=document.getElementById(savedHash.slice(1));if(!elem||!isHidden(elem)){return}var parent=elem.parentNode;if(parent&&hasClass(parent,"impl-items")){onEachLazy(parent.getElementsByClassName("collapsed"),function(e){if(e.parentNode===parent){e.click();return true}});if(isHidden(elem)){if(hasClass(parent.lastElementChild,"collapse-toggle")){parent.lastElementChild.click()}}}}}function highlightSourceLines(match,ev){if(typeof match==="undefined"){hideSidebar();match=window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/)}if(!match){return}var from=parseInt(match[1],10);var to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to<from){var tmp=to;to=from;from=tmp}var elem=document.getElementById(from);if(!elem){return}if(!ev){var x=document.getElementById(from);if(x){x.scrollIntoView()}}onEachLazy(document.getElementsByClassName("line-numbers"),function(e){onEachLazy(e.getElementsByTagName("span"),function(i_e){removeClass(i_e,"line-highlighted")})});for(var i=from;i<=to;++i){elem=document.getElementById(i);if(!elem){break}addClass(elem,"line-highlighted")}}function onHashChange(ev){hideSidebar();var match=window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/);if(match){return highlightSourceLines(match,ev)}handleHashes(ev)}function expandSection(id){var elem=document.getElementById(id);if(elem&&isHidden(elem)){var h3=elem.parentNode.previousElementSibling;if(h3&&h3.tagName!=="H3"){h3=h3.previousElementSibling}if(h3){var collapses=h3.getElementsByClassName("collapse-toggle");if(collapses.length>0){collapseDocs(collapses[0],"show")}}}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!="undefined"){return ev.key}var c=ev.charCode||ev.keyCode;if(c==27){return"Escape"}return String.fromCharCode(c)}function getHelpElement(){return document.getElementById("help")}function displayHelp(display,ev,help){help=help?help:getHelpElement();if(display===true){if(hasClass(help,"hidden")){ev.preventDefault();removeClass(help,"hidden");addClass(document.body,"blur")}}else if(hasClass(help,"hidden")===false){ev.preventDefault();addClass(help,"hidden");removeClass(document.body,"blur")}}function handleEscape(ev){var help=getHelpElement();var search=getSearchElement();if(hasClass(help,"hidden")===false){displayHelp(false,ev,help)}else if(hasClass(search,"hidden")===false){clearInputTimeout();ev.preventDefault();hideSearchResults(search);document.title=titleBeforeSearch}defocusSearchBar()}function handleShortcut(ev){if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts===true){return}if(document.activeElement.tagName==="INPUT"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":displayHelp(false,ev);ev.preventDefault();focusSearchBar();break;case"+":case"-":ev.preventDefault();toggleAllDocs();break;case"?":if(ev.shiftKey){displayHelp(true,ev)}break}}}function findParentElement(elem,tagName){do{if(elem&&elem.tagName===tagName){return elem}elem=elem.parentNode}while(elem);return null}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);var handleSourceHighlight=(function(){var prev_line_id=0;var set_fragment=function(name){var x=window.scrollX,y=window.scrollY;if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSourceLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return function(ev){var cur_line_id=parseInt(ev.target.id,10);ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){var tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());document.addEventListener("click",function(ev){if(hasClass(ev.target,"collapse-toggle")){collapseDocs(ev.target,"toggle")}else if(hasClass(ev.target.parentNode,"collapse-toggle")){collapseDocs(ev.target.parentNode,"toggle")}else if(ev.target.tagName==="SPAN"&&hasClass(ev.target.parentNode,"line-numbers")){handleSourceHighlight(ev)}else if(hasClass(getHelpElement(),"hidden")===false){var help=getHelpElement();var is_inside_help_popup=ev.target!==help&&help.contains(ev.target);if(is_inside_help_popup===false){addClass(help,"hidden");removeClass(document.body,"blur")}}else{var a=findParentElement(ev.target,"A");if(a&&a.hash){expandSection(a.hash.replace(/^#/,""))}}});(function(){var x=document.getElementsByClassName("version-selector");if(x.length>0){x[0].onchange=function(){var i,match,url=document.location.href,stripped="",len=rootPath.match(/\.\.\//g).length+1;for(i=0;i<len;++i){match=url.match(/\/[^\/]*$/);if(i<len-1){stripped=match[0]+stripped}url=url.substring(0,url.length-match[0].length)}var selectedVersion=document.getElementsByClassName("version-selector")[0].value;url+="/"+selectedVersion+stripped;document.location.href=url}}}());var levenshtein_row2=[];function levenshtein(s1,s2){if(s1===s2){return 0}var s1_len=s1.length,s2_len=s2.length;if(s1_len&&s2_len){var i1=0,i2=0,a,b,c,c2,row=levenshtein_row2;while(i1<s1_len){row[i1]=++i1}while(i2<s2_len){c2=s2.charCodeAt(i2);a=i2;++i2;b=i2;for(i1=0;i1<s1_len;++i1){c=a+(s1.charCodeAt(i1)!==c2?1:0);a=row[i1];b=b<a?(b<c?b+1:c):(a<c?a+1:c);row[i1]=b}}return b}return s1_len+s2_len}window.initSearch=function(rawSearchIndex){var MAX_LEV_DISTANCE=3;var MAX_RESULTS=200;var GENERICS_DATA=1;var NAME=0;var INPUTS_DATA=0;var OUTPUT_DATA=1;var NO_TYPE_FILTER=-1;var currentResults,index,searchIndex;var ALIASES={};var params=getQueryStringParams();if(search_input.value===""){search_input.value=params.search||""}function execQuery(query,searchWords,filterCrates){function itemTypeFromName(typename){var length=itemTypes.length;for(var i=0;i<length;++i){if(itemTypes[i]===typename){return i}}return NO_TYPE_FILTER}var valLower=query.query.toLowerCase(),val=valLower,typeFilter=itemTypeFromName(query.type),results={},results_in_args={},results_returned={},split=valLower.split("::");var length=split.length;for(var z=0;z<length;++z){if(split[z]===""){split.splice(z,1);z-=1}}function transformResults(results,isType){var out=[];var length=results.length;for(var i=0;i<length;++i){if(results[i].id>-1){var obj=searchIndex[results[i].id];obj.lev=results[i].lev;if(isType!==true||obj.type){var res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}}return out}function sortResults(results,isType){var ar=[];for(var entry in results){if(hasOwnProperty(results,entry)){ar.push(results[entry])}}results=ar;var i;var nresults=results.length;for(i=0;i<nresults;++i){results[i].word=searchWords[results[i].id];results[i].item=searchIndex[results[i].id]||{}}if(results.length===0){return[]}results.sort(function(aaa,bbb){var a,b;a=(aaa.word!==val);b=(bbb.word!==val);if(a!==b){return a-b}a=(aaa.lev);b=(bbb.lev);if(a!==b){return a-b}a=(aaa.item.crate!==window.currentCrate);b=(bbb.item.crate!==window.currentCrate);if(a!==b){return a-b}a=aaa.word.length;b=bbb.word.length;if(a!==b){return a-b}a=aaa.word;b=bbb.word;if(a!==b){return(a>b?+1:-1)}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}if((aaa.item.ty===TY_PRIMITIVE&&bbb.item.ty!==TY_KEYWORD)||(aaa.item.ty===TY_KEYWORD&&bbb.item.ty!==TY_PRIMITIVE)){return-1}if((bbb.item.ty===TY_PRIMITIVE&&aaa.item.ty!==TY_PRIMITIVE)||(bbb.item.ty===TY_KEYWORD&&aaa.item.ty!==TY_KEYWORD)){return 1}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});var length=results.length;for(i=0;i<length;++i){var result=results[i];if(result.dontValidate){continue}var name=result.item.name.toLowerCase(),path=result.item.path.toLowerCase(),parent=result.item.parent;if(isType!==true&&validateResult(name,path,split,parent)===false){result.id=-1}}return transformResults(results)}function extractGenerics(val){val=val.toLowerCase();if(val.indexOf("<")!==-1){var values=val.substring(val.indexOf("<")+1,val.lastIndexOf(">"));return{name:val.substring(0,val.indexOf("<")),generics:values.split(/\s*,\s*/),}}return{name:val,generics:[],}}function getObjectFromId(id){if(typeof id==="number"){return searchIndex[id]}return{'name':id}}function checkGenerics(obj,val){var lev_distance=MAX_LEV_DISTANCE+1;if(val.generics.length>0){if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>=val.generics.length){var elems=obj[GENERICS_DATA].slice(0);var total=0;var done=0;var vlength=val.generics.length;for(var y=0;y<vlength;++y){var lev={pos:-1,lev:MAX_LEV_DISTANCE+1};var elength=elems.length;var firstGeneric=getObjectFromId(val.generics[y]).name;for(var x=0;x<elength;++x){var tmp_lev=levenshtein(getObjectFromId(elems[x]).name,firstGeneric);if(tmp_lev<lev.lev){lev.lev=tmp_lev;lev.pos=x}}if(lev.pos!==-1){elems.splice(lev.pos,1);lev_distance=Math.min(lev.lev,lev_distance);total+=lev.lev;done+=1}else{return MAX_LEV_DISTANCE+1}}return Math.ceil(total/done)}}return MAX_LEV_DISTANCE+1}function checkType(obj,val,literalSearch){var lev_distance=MAX_LEV_DISTANCE+1;var x;if(obj[NAME]===val.name){if(literalSearch===true){if(val.generics&&val.generics.length!==0){if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>=val.generics.length){var elems=obj[GENERICS_DATA].slice(0);var allFound=true;for(var y=0;allFound===true&&y<val.generics.length;++y){allFound=false;var firstGeneric=getObjectFromId(val.generics[y]).name;for(x=0;allFound===false&&x<elems.length;++x){allFound=getObjectFromId(elems[x]).name===firstGeneric}if(allFound===true){elems.splice(x-1,1)}}if(allFound===true){return true}}else{return false}}return true}if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length!==0){var tmp_lev=checkGenerics(obj,val);if(tmp_lev<=MAX_LEV_DISTANCE){return tmp_lev}}else{return 0}}if(literalSearch===true){if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>0){var length=obj[GENERICS_DATA].length;for(x=0;x<length;++x){if(obj[GENERICS_DATA][x]===val.name){return true}}}return false}lev_distance=Math.min(levenshtein(obj[NAME],val.name),lev_distance);if(lev_distance<=MAX_LEV_DISTANCE){lev_distance=Math.ceil((checkGenerics(obj,val)+lev_distance)/2)}else if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>0){var olength=obj[GENERICS_DATA].length;for(x=0;x<olength;++x){lev_distance=Math.min(levenshtein(obj[GENERICS_DATA][x],val.name),lev_distance)}}return lev_distance+1}function findArg(obj,val,literalSearch,typeFilter){var lev_distance=MAX_LEV_DISTANCE+1;if(obj&&obj.type&&obj.type[INPUTS_DATA]&&obj.type[INPUTS_DATA].length>0){var length=obj.type[INPUTS_DATA].length;for(var i=0;i<length;i++){var tmp=obj.type[INPUTS_DATA][i];if(typePassesFilter(typeFilter,tmp[1])===false){continue}tmp=checkType(tmp,val,literalSearch);if(literalSearch===true){if(tmp===true){return true}continue}lev_distance=Math.min(tmp,lev_distance);if(lev_distance===0){return 0}}}return literalSearch===true?false:lev_distance}function checkReturned(obj,val,literalSearch,typeFilter){var lev_distance=MAX_LEV_DISTANCE+1;if(obj&&obj.type&&obj.type.length>OUTPUT_DATA){var ret=obj.type[OUTPUT_DATA];if(typeof ret[0]==="string"){ret=[ret]}for(var x=0;x<ret.length;++x){var tmp=ret[x];if(typePassesFilter(typeFilter,tmp[1])===false){continue}tmp=checkType(tmp,val,literalSearch);if(literalSearch===true){if(tmp===true){return true}continue}lev_distance=Math.min(tmp,lev_distance);if(lev_distance===0){return 0}}}return literalSearch===true?false:lev_distance}function checkPath(contains,lastElem,ty){if(contains.length===0){return 0}var ret_lev=MAX_LEV_DISTANCE+1;var path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}var length=path.length;var clength=contains.length;if(clength>length){return MAX_LEV_DISTANCE+1}for(var i=0;i<length;++i){if(i+clength>length){break}var lev_total=0;var aborted=false;for(var x=0;x<clength;++x){var lev=levenshtein(path[i+x],contains[x]);if(lev>MAX_LEV_DISTANCE){aborted=true;break}lev_total+=lev}if(aborted===false){ret_lev=Math.min(ret_lev,Math.round(lev_total/clength))}}return ret_lev}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER)return true;if(filter===type)return true;var name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function generateId(ty){if(ty.parent&&ty.parent.name){return itemTypes[ty.ty]+ty.path+ty.parent.name+ty.name}return itemTypes[ty.ty]+ty.path+ty.name}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,desc:item.desc,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,}}function handleAliases(ret,query,filterCrates){var aliases=[];var crateAliases=[];var i;if(filterCrates!==undefined){if(ALIASES[filterCrates]&&ALIASES[filterCrates][query.search]){for(i=0;i<ALIASES[filterCrates][query.search].length;++i){aliases.push(createAliasFromItem(searchIndex[ALIASES[filterCrates][query.search][i]]))}}}else{Object.keys(ALIASES).forEach(function(crate){if(ALIASES[crate][query.search]){var pushTo=crate===window.currentCrate?crateAliases:aliases;for(i=0;i<ALIASES[crate][query.search].length;++i){pushTo.push(createAliasFromItem(searchIndex[ALIASES[crate][query.search][i]]))}}})}var sortFunc=function(aaa,bbb){if(aaa.path<bbb.path){return 1}else if(aaa.path===bbb.path){return 0}return-1};crateAliases.sort(sortFunc);aliases.sort(sortFunc);var pushFunc=function(alias){alias.alias=query.raw;var res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};onEach(aliases,pushFunc);onEach(crateAliases,pushFunc)}var nSearchWords=searchWords.length;var i;var ty;var fullId;var returned;var in_args;if((val.charAt(0)==="\""||val.charAt(0)==="'")&&val.charAt(val.length-1)===val.charAt(0)){val=extractGenerics(val.substr(1,val.length-2));for(i=0;i<nSearchWords;++i){if(filterCrates!==undefined&&searchIndex[i].crate!==filterCrates){continue}in_args=findArg(searchIndex[i],val,true,typeFilter);returned=checkReturned(searchIndex[i],val,true,typeFilter);ty=searchIndex[i];fullId=generateId(ty);if(searchWords[i]===val.name&&typePassesFilter(typeFilter,searchIndex[i].ty)&&results[fullId]===undefined){results[fullId]={id:i,index:-1,dontValidate:true,}}if(in_args===true&&results_in_args[fullId]===undefined){results_in_args[fullId]={id:i,index:-1,dontValidate:true,}}if(returned===true&&results_returned[fullId]===undefined){results_returned[fullId]={id:i,index:-1,dontValidate:true,}}}query.inputs=[val];query.output=val;query.search=val}else if(val.search("->")>-1){var trimmer=function(s){return s.trim()};var parts=val.split("->").map(trimmer);var input=parts[0];var inputs=input.split(",").map(trimmer).sort();for(i=0;i<inputs.length;++i){inputs[i]=extractGenerics(inputs[i])}var output=extractGenerics(parts[1]);for(i=0;i<nSearchWords;++i){if(filterCrates!==undefined&&searchIndex[i].crate!==filterCrates){continue}var type=searchIndex[i].type;ty=searchIndex[i];if(!type){continue}fullId=generateId(ty);returned=checkReturned(ty,output,true,NO_TYPE_FILTER);if(output.name==="*"||returned===true){in_args=false;var is_module=false;if(input==="*"){is_module=true}else{var allFound=true;for(var it=0;allFound===true&&it<inputs.length;it++){allFound=checkType(type,inputs[it],true)}in_args=allFound}if(in_args===true){results_in_args[fullId]={id:i,index:-1,dontValidate:true,}}if(returned===true){results_returned[fullId]={id:i,index:-1,dontValidate:true,}}if(is_module===true){results[fullId]={id:i,index:-1,dontValidate:true,}}}}query.inputs=inputs.map(function(input){return input.name});query.output=output.name}else{query.inputs=[val];query.output=val;query.search=val;val=val.replace(/\_/g,"");var valGenerics=extractGenerics(val);var paths=valLower.split("::");var j;for(j=0;j<paths.length;++j){if(paths[j]===""){paths.splice(j,1);j-=1}}val=paths[paths.length-1];var contains=paths.slice(0,paths.length>1?paths.length-1:1);var lev;for(j=0;j<nSearchWords;++j){ty=searchIndex[j];if(!ty||(filterCrates!==undefined&&ty.crate!==filterCrates)){continue}var lev_add=0;if(paths.length>1){lev=checkPath(contains,paths[paths.length-1],ty);if(lev>MAX_LEV_DISTANCE){continue}else if(lev>0){lev_add=lev/10}}returned=MAX_LEV_DISTANCE+1;in_args=MAX_LEV_DISTANCE+1;var index=-1;lev=MAX_LEV_DISTANCE+1;fullId=generateId(ty);if(searchWords[j].indexOf(split[i])>-1||searchWords[j].indexOf(val)>-1||searchWords[j].replace(/_/g,"").indexOf(val)>-1){if(typePassesFilter(typeFilter,ty.ty)&&results[fullId]===undefined){index=searchWords[j].replace(/_/g,"").indexOf(val)}}if((lev=levenshtein(searchWords[j],val))<=MAX_LEV_DISTANCE){if(typePassesFilter(typeFilter,ty.ty)===false){lev=MAX_LEV_DISTANCE+1}else{lev+=1}}in_args=findArg(ty,valGenerics,false,typeFilter);returned=checkReturned(ty,valGenerics,false,typeFilter);lev+=lev_add;if(lev>0&&val.length>3&&searchWords[j].indexOf(val)>-1){if(val.length<6){lev-=1}else{lev=0}}if(in_args<=MAX_LEV_DISTANCE){if(results_in_args[fullId]===undefined){results_in_args[fullId]={id:j,index:index,lev:in_args,}}results_in_args[fullId].lev=Math.min(results_in_args[fullId].lev,in_args)}if(returned<=MAX_LEV_DISTANCE){if(results_returned[fullId]===undefined){results_returned[fullId]={id:j,index:index,lev:returned,}}results_returned[fullId].lev=Math.min(results_returned[fullId].lev,returned)}if(index!==-1||lev<=MAX_LEV_DISTANCE){if(index!==-1&&paths.length<2){lev=0}if(results[fullId]===undefined){results[fullId]={id:j,index:index,lev:lev,}}results[fullId].lev=Math.min(results[fullId].lev,lev)}}}var ret={"in_args":sortResults(results_in_args,true),"returned":sortResults(results_returned,true),"others":sortResults(results),};handleAliases(ret,query,filterCrates);return ret}function validateResult(name,path,keys,parent){for(var i=0;i<keys.length;++i){if(!(name.indexOf(keys[i])>-1||path.indexOf(keys[i])>-1||(parent!==undefined&&parent.name!==undefined&&parent.name.toLowerCase().indexOf(keys[i])>-1)||levenshtein(name,keys[i])<=MAX_LEV_DISTANCE)){return false}}return true}function getQuery(raw){var matches,type,query;query=raw;matches=query.match(/^(fn|mod|struct|enum|trait|type|const|macro)\s*:\s*/i);if(matches){type=matches[1].replace(/^const$/,"constant");query=query.substring(matches[0].length)}return{raw:raw,query:query,type:type,id:query+type}}function initSearchNav(){var hoverTimeout;var click_func=function(e){var el=e.target;while(el.tagName!=="TR"){el=el.parentNode}var dst=e.target.getElementsByTagName("a");if(dst.length<1){return}dst=dst[0];if(window.location.pathname===dst.pathname){hideSearchResults();document.location.href=dst.href}};var mouseover_func=function(e){var el=e.target;while(el.tagName!=="TR"){el=el.parentNode}clearTimeout(hoverTimeout);hoverTimeout=setTimeout(function(){onEachLazy(document.getElementsByClassName("search-results"),function(e){onEachLazy(e.getElementsByClassName("result"),function(i_e){removeClass(i_e,"highlighted")})});addClass(el,"highlighted")},20)};onEachLazy(document.getElementsByClassName("search-results"),function(e){onEachLazy(e.getElementsByClassName("result"),function(i_e){i_e.onclick=click_func;i_e.onmouseover=mouseover_func})});search_input.onkeydown=function(e){var actives=[[],[],[]];var current=0;onEachLazy(document.getElementById("results").childNodes,function(e){onEachLazy(e.getElementsByClassName("highlighted"),function(e){actives[current].push(e)});current+=1});if(e.which===38){if(!actives[currentTab].length||!actives[currentTab][0].previousElementSibling){return}addClass(actives[currentTab][0].previousElementSibling,"highlighted");removeClass(actives[currentTab][0],"highlighted")}else if(e.which===40){if(!actives[currentTab].length){var results=document.getElementById("results").childNodes;if(results.length>0){var res=results[currentTab].getElementsByClassName("result");if(res.length>0){addClass(res[0],"highlighted")}}}else if(actives[currentTab][0].nextElementSibling){addClass(actives[currentTab][0].nextElementSibling,"highlighted");removeClass(actives[currentTab][0],"highlighted")}}else if(e.which===13){if(actives[currentTab].length){document.location.href=actives[currentTab][0].getElementsByTagName("a")[0].href}}else if(e.which===9){if(e.shiftKey){printTab(currentTab>0?currentTab-1:2)}else{printTab(currentTab>1?0:currentTab+1)}e.preventDefault()}else if(e.which===16){}else if(actives[currentTab].length>0){removeClass(actives[currentTab][0],"highlighted")}}}function buildHrefAndPath(item){var displayPath;var href;var type=itemTypes[item.ty];var name=item.name;var path=item.path;if(type==="mod"){displayPath=path+"::";href=rootPath+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="primitive"||type==="keyword"){displayPath="";href=rootPath+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=rootPath+name+"/index.html"}else if(item.parent!==undefined){var myparent=item.parent;var anchor="#"+type+"."+name;var parentType=itemTypes[myparent.ty];var pageType=parentType;var pageName=myparent.name;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){var splitPath=item.path.split("::");var enumName=splitPath.pop();path=splitPath.join("::");displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="#variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}href=rootPath+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html"+anchor}else{displayPath=item.path+"::";href=rootPath+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href]}function escape(content){var h1=document.createElement("h1");h1.textContent=content;return h1.innerHTML}function pathSplitter(path){var tmp="<span>"+path.replace(/::/g,"::</span><span>");if(tmp.endsWith("<span>")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){var extraStyle="";if(display===false){extraStyle=" style=\"display: none;\""}var output="";var duplicates={};var length=0;if(array.length>0){output="<table class=\"search-results\""+extraStyle+">";array.forEach(function(item){var name,type;name=item.name;type=itemTypes[item.ty];if(item.is_alias!==true){if(duplicates[item.fullPath]){return}duplicates[item.fullPath]=true}length+=1;output+="<tr class=\""+type+" result\"><td>"+"<a href=\""+item.href+"\">"+(item.is_alias===true?("<span class=\"alias\"><b>"+item.alias+" </b></span><span "+"class=\"grey\"><i> - see </i></span>"):"")+item.displayPath+"<span class=\""+type+"\">"+name+"</span></a></td><td>"+"<a href=\""+item.href+"\">"+"<span class=\"desc\">"+escape(item.desc)+" </span></a></td></tr>"});output+="</table>"}else{output="<div class=\"search-failed\""+extraStyle+">No results :(<br/>"+"Try on <a href=\"https://duckduckgo.com/?q="+encodeURIComponent("rust "+query.query)+"\">DuckDuckGo</a>?<br/><br/>"+"Or try looking in one of these:<ul><li>The <a "+"href=\"https://doc.rust-lang.org/reference/index.html\">Rust Reference</a> "+" for technical details about the language.</li><li><a "+"href=\"https://doc.rust-lang.org/rust-by-example/index.html\">Rust By "+"Example</a> for expository code examples.</a></li><li>The <a "+"href=\"https://doc.rust-lang.org/book/index.html\">Rust Book</a> for "+"introductions to language features and the language itself.</li><li><a "+"href=\"https://docs.rs\">Docs.rs</a> for documentation of crates released on"+" <a href=\"https://crates.io/\">crates.io</a>.</li></ul></div>"}return[output,length]}function makeTabHeader(tabNb,text,nbElems){if(currentTab===tabNb){return"<div class=\"selected\">"+text+" <div class=\"count\">("+nbElems+")</div></div>"}return"<div>"+text+" <div class=\"count\">("+nbElems+")</div></div>"}function showResults(results){if(results.others.length===1&&getCurrentValue("rustdoc-go-to-only-result")==="true"){var elem=document.createElement("a");elem.href=results.others[0].href;elem.style.display="none";document.body.appendChild(elem);elem.click()}var query=getQuery(search_input.value);currentResults=query.id;var ret_others=addTab(results.others,query);var ret_in_args=addTab(results.in_args,query,false);var ret_returned=addTab(results.returned,query,false);var output="<h1>Results for "+escape(query.query)+(query.type?" (type: "+escape(query.type)+")":"")+"</h1>"+"<div id=\"titles\">"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"</div><div id=\"results\">"+ret_others[0]+ret_in_args[0]+ret_returned[0]+"</div>";var search=getSearchElement();search.innerHTML=output;showSearchResults(search);var tds=search.getElementsByTagName("td");var td_width=0;if(tds.length>0){td_width=tds[0].offsetWidth}var width=search.offsetWidth-40-td_width;onEachLazy(search.getElementsByClassName("desc"),function(e){e.style.width=width+"px"});initSearchNav();var elems=document.getElementById("titles").childNodes;elems[0].onclick=function(){printTab(0)};elems[1].onclick=function(){printTab(1)};elems[2].onclick=function(){printTab(2)};printTab(currentTab)}function execSearch(query,searchWords,filterCrates){function getSmallest(arrays,positions,notDuplicates){var start=null;for(var it=0;it<positions.length;++it){if(arrays[it].length>positions[it]&&(start===null||start>arrays[it][positions[it]].lev)&&!notDuplicates[arrays[it][positions[it]].fullPath]){start=arrays[it][positions[it]].lev}}return start}function mergeArrays(arrays){var ret=[];var positions=[];var notDuplicates={};for(var x=0;x<arrays.length;++x){positions.push(0)}while(ret.length<MAX_RESULTS){var smallest=getSmallest(arrays,positions,notDuplicates);if(smallest===null){break}for(x=0;x<arrays.length&&ret.length<MAX_RESULTS;++x){if(arrays[x].length>positions[x]&&arrays[x][positions[x]].lev===smallest&&!notDuplicates[arrays[x][positions[x]].fullPath]){ret.push(arrays[x][positions[x]]);notDuplicates[arrays[x][positions[x]].fullPath]=true;positions[x]+=1}}}return ret}var queries=query.raw.split(",");var results={"in_args":[],"returned":[],"others":[],};for(var i=0;i<queries.length;++i){query=queries[i].trim();if(query.length!==0){var tmp=execQuery(getQuery(query),searchWords,filterCrates);results.in_args.push(tmp.in_args);results.returned.push(tmp.returned);results.others.push(tmp.others)}}if(queries.length>1){return{"in_args":mergeArrays(results.in_args),"returned":mergeArrays(results.returned),"others":mergeArrays(results.others),}}return{"in_args":results.in_args[0],"returned":results.returned[0],"others":results.others[0],}}function getFilterCrates(){var elem=document.getElementById("crate-search");if(elem&&elem.value!=="All crates"&&hasOwnProperty(rawSearchIndex,elem.value)){return elem.value}return undefined}function search(e,forced){var params=getQueryStringParams();var query=getQuery(search_input.value.trim());if(e){e.preventDefault()}if(query.query.length===0){return}if(forced!==true&&query.id===currentResults){if(query.query.length>0){putBackSearch(search_input)}return}document.title="Results for "+query.query+" - Rust";if(browserSupportsHistoryApi()){if(!history.state&&!params.search){history.pushState(query,"","?search="+encodeURIComponent(query.raw))}else{history.replaceState(query,"","?search="+encodeURIComponent(query.raw))}}var filterCrates=getFilterCrates();showResults(execSearch(query,index,filterCrates))}function buildIndex(rawSearchIndex){searchIndex=[];var searchWords=[];var i;var currentIndex=0;for(var crate in rawSearchIndex){if(!hasOwnProperty(rawSearchIndex,crate)){continue}var crateSize=0;searchWords.push(crate);searchIndex.push({crate:crate,ty:1,name:crate,path:"",desc:rawSearchIndex[crate].doc,type:null,});currentIndex+=1;var items=rawSearchIndex[crate].i;var paths=rawSearchIndex[crate].p;var aliases=rawSearchIndex[crate].a;var len=paths.length;for(i=0;i<len;++i){paths[i]={ty:paths[i][0],name:paths[i][1]}}len=items.length;var lastPath="";for(i=0;i<len;++i){var rawRow=items[i];if(!rawRow[2]){rawRow[2]=lastPath}var row={crate:crate,ty:rawRow[0],name:rawRow[1],path:rawRow[2],desc:rawRow[3],parent:paths[rawRow[4]],type:rawRow[5],};searchIndex.push(row);if(typeof row.name==="string"){var word=row.name.toLowerCase();searchWords.push(word)}else{searchWords.push("")}lastPath=row.path;crateSize+=1}if(aliases){ALIASES[crate]={};var j,local_aliases;for(var alias_name in aliases){if(!aliases.hasOwnProperty(alias_name)){continue}if(!ALIASES[crate].hasOwnProperty(alias_name)){ALIASES[crate][alias_name]=[]}local_aliases=aliases[alias_name];for(j=0;j<local_aliases.length;++j){ALIASES[crate][alias_name].push(local_aliases[j]+currentIndex)}}}currentIndex+=crateSize}return searchWords}function startSearch(){var callback=function(){clearInputTimeout();if(search_input.value.length===0){if(browserSupportsHistoryApi()){history.replaceState("",window.currentCrate+" - Rust","?search=")}hideSearchResults()}else{searchTimeout=setTimeout(search,500)}};search_input.onkeyup=callback;search_input.oninput=callback;document.getElementsByClassName("search-form")[0].onsubmit=function(e){e.preventDefault();clearInputTimeout();search()};search_input.onchange=function(e){if(e.target!==document.activeElement){return}clearInputTimeout();setTimeout(search,0)};search_input.onpaste=search_input.onchange;var selectCrate=document.getElementById("crate-search");if(selectCrate){selectCrate.onchange=function(){updateLocalStorage("rustdoc-saved-filter-crate",selectCrate.value);search(undefined,true)}}if(browserSupportsHistoryApi()){var previousTitle=document.title;window.addEventListener("popstate",function(e){var params=getQueryStringParams();document.title=previousTitle;currentResults=null;if(params.search&¶ms.search.length>0){search_input.value=params.search;search(e)}else{search_input.value="";hideSearchResults()}})}search()}index=buildIndex(rawSearchIndex);startSearch();if(rootPath==="../"||rootPath==="./"){var sidebar=document.getElementsByClassName("sidebar-elems")[0];if(sidebar){var div=document.createElement("div");div.className="block crate";div.innerHTML="<h3>Crates</h3>";var ul=document.createElement("ul");div.appendChild(ul);var crates=[];for(var crate in rawSearchIndex){if(!hasOwnProperty(rawSearchIndex,crate)){continue}crates.push(crate)}crates.sort();for(var i=0;i<crates.length;++i){var klass="crate";if(rootPath!=="./"&&crates[i]===window.currentCrate){klass+=" current"}var link=document.createElement("a");link.href=rootPath+crates[i]+"/index.html";link.title=rawSearchIndex[crates[i]].doc;link.className=klass;link.textContent=crates[i];var li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebar.appendChild(div)}}};window.initSidebarItems=function(items){var sidebar=document.getElementsByClassName("sidebar-elems")[0];var current=window.sidebarCurrent;function block(shortty,longty){var filtered=items[shortty];if(!filtered){return}var div=document.createElement("div");div.className="block "+shortty;var h3=document.createElement("h3");h3.textContent=longty;div.appendChild(h3);var ul=document.createElement("ul");var length=filtered.length;for(var i=0;i<length;++i){var item=filtered[i];var name=item[0];var desc=item[1];var klass=shortty;if(name===current.name&&shortty===current.ty){klass+=" current"}var path;if(shortty==="mod"){path=name+"/index.html"}else{path=shortty+"."+name+".html"}var link=document.createElement("a");link.href=current.relpath+path;link.title=desc;link.className=klass;link.textContent=name;var li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}div.appendChild(ul);if(sidebar){sidebar.appendChild(div)}}block("primitive","Primitive Types");block("mod","Modules");block("macro","Macros");block("struct","Structs");block("enum","Enums");block("union","Unions");block("constant","Constants");block("static","Statics");block("trait","Traits");block("fn","Functions");block("type","Type Definitions");block("foreigntype","Foreign Types");block("keyword","Keywords");block("traitalias","Trait Aliases")};window.register_implementors=function(imp){var implementors=document.getElementById("implementors-list");var synthetic_implementors=document.getElementById("synthetic-implementors-list");if(synthetic_implementors){var inlined_types=new Set();onEachLazy(synthetic_implementors.getElementsByClassName("impl"),function(el){var aliases=el.getAttribute("aliases");if(!aliases){return}aliases.split(",").forEach(function(alias){inlined_types.add(alias)})})}var libs=Object.getOwnPropertyNames(imp);var llength=libs.length;for(var i=0;i<llength;++i){if(libs[i]===currentCrate){continue}var structs=imp[libs[i]];var slength=structs.length;struct_loop:for(var j=0;j<slength;++j){var struct=structs[j];var list=struct.synthetic?synthetic_implementors:implementors;if(struct.synthetic){var stlength=struct.types.length;for(var k=0;k<stlength;k++){if(inlined_types.has(struct.types[k])){continue struct_loop}inlined_types.add(struct.types[k])}}var code=document.createElement("code");code.innerHTML=struct.text;var x=code.getElementsByTagName("a");var xlength=x.length;for(var it=0;it<xlength;it++){var href=x[it].getAttribute("href");if(href&&href.indexOf("http")!==0){x[it].setAttribute("href",rootPath+href)}}var display=document.createElement("h3");addClass(display,"impl");display.innerHTML="<span class=\"in-band\"><table class=\"table-display\">"+"<tbody><tr><td><code>"+code.outerHTML+"</code></td><td></td></tr>"+"</tbody></table></span>";list.appendChild(display)}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}function labelForToggleButton(sectionIsCollapsed){if(sectionIsCollapsed){return"+"}return"\u2212"}function onEveryMatchingChild(elem,className,func){if(elem&&className&&func){var length=elem.childNodes.length;var nodes=elem.childNodes;for(var i=0;i<length;++i){if(hasClass(nodes[i],className)){func(nodes[i])}else{onEveryMatchingChild(nodes[i],className,func)}}}}function toggleAllDocs(pageId,fromAutoCollapse){var innerToggle=document.getElementById("toggle-all-docs");if(!innerToggle){return}if(hasClass(innerToggle,"will-expand")){updateLocalStorage("rustdoc-collapse","false");removeClass(innerToggle,"will-expand");onEveryMatchingChild(innerToggle,"inner",function(e){e.innerHTML=labelForToggleButton(false)});innerToggle.title="collapse all docs";if(fromAutoCollapse!==true){onEachLazy(document.getElementsByClassName("collapse-toggle"),function(e){collapseDocs(e,"show")})}}else{updateLocalStorage("rustdoc-collapse","true");addClass(innerToggle,"will-expand");onEveryMatchingChild(innerToggle,"inner",function(e){var parent=e.parentNode;var superParent=null;if(parent){superParent=parent.parentNode}if(!parent||!superParent||superParent.id!=="main"||hasClass(parent,"impl")===false){e.innerHTML=labelForToggleButton(true)}});innerToggle.title="expand all docs";if(fromAutoCollapse!==true){onEachLazy(document.getElementsByClassName("collapse-toggle"),function(e){var parent=e.parentNode;var superParent=null;if(parent){superParent=parent.parentNode}if(!parent||!superParent||superParent.id!=="main"||hasClass(parent,"impl")===false){collapseDocs(e,"hide",pageId)}})}}}function collapseDocs(toggle,mode,pageId){if(!toggle||!toggle.parentNode){return}function adjustToggle(arg){return function(e){if(hasClass(e,"toggle-label")){if(arg){e.style.display="inline-block"}else{e.style.display="none"}}if(hasClass(e,"inner")){e.innerHTML=labelForToggleButton(arg)}}}function implHider(addOrRemove,fullHide){return function(n){var is_method=hasClass(n,"method")||fullHide;if(is_method||hasClass(n,"type")){if(is_method===true){if(addOrRemove){addClass(n,"hidden-by-impl-hider")}else{removeClass(n,"hidden-by-impl-hider")}}var ns=n.nextElementSibling;while(ns&&(hasClass(ns,"docblock")||hasClass(ns,"stability"))){if(addOrRemove){addClass(ns,"hidden-by-impl-hider")}else{removeClass(ns,"hidden-by-impl-hider")}ns=ns.nextElementSibling}}}}var relatedDoc;var action=mode;if(hasClass(toggle.parentNode,"impl")===false){relatedDoc=toggle.parentNode.nextElementSibling;if(hasClass(relatedDoc,"stability")){relatedDoc=relatedDoc.nextElementSibling}if(hasClass(relatedDoc,"docblock")||hasClass(relatedDoc,"sub-variant")){if(mode==="toggle"){if(hasClass(relatedDoc,"hidden-by-usual-hider")){action="show"}else{action="hide"}}if(action==="hide"){addClass(relatedDoc,"hidden-by-usual-hider");onEachLazy(toggle.childNodes,adjustToggle(true));addClass(toggle.parentNode,"collapsed")}else if(action==="show"){removeClass(relatedDoc,"hidden-by-usual-hider");removeClass(toggle.parentNode,"collapsed");onEachLazy(toggle.childNodes,adjustToggle(false))}}}else{var parentElem=toggle.parentNode;relatedDoc=parentElem;var docblock=relatedDoc.nextElementSibling;while(hasClass(relatedDoc,"impl-items")===false){relatedDoc=relatedDoc.nextElementSibling}if((!relatedDoc&&hasClass(docblock,"docblock")===false)||(pageId&&document.getElementById(pageId))){return}if(mode==="toggle"){if(hasClass(relatedDoc,"fns-now-collapsed")||hasClass(docblock,"hidden-by-impl-hider")){action="show"}else{action="hide"}}var dontApplyBlockRule=toggle.parentNode.parentNode.id!=="main";if(action==="show"){removeClass(relatedDoc,"fns-now-collapsed");removeClass(docblock,"hidden-by-usual-hider");onEachLazy(toggle.childNodes,adjustToggle(false,dontApplyBlockRule));onEachLazy(relatedDoc.childNodes,implHider(false,dontApplyBlockRule))}else if(action==="hide"){addClass(relatedDoc,"fns-now-collapsed");addClass(docblock,"hidden-by-usual-hider");onEachLazy(toggle.childNodes,adjustToggle(true,dontApplyBlockRule));onEachLazy(relatedDoc.childNodes,implHider(true,dontApplyBlockRule))}}}function collapser(pageId,e,collapse){var n=e.parentElement;if(n.id.match(/^impl(?:-\d+)?$/)===null){if(collapse||hasClass(n,"impl")){collapseDocs(e,"hide",pageId)}}}function autoCollapse(pageId,collapse){if(collapse){toggleAllDocs(pageId,true)}else if(getCurrentValue("rustdoc-auto-hide-trait-implementations")!=="false"){var impl_list=document.getElementById("trait-implementations-list");if(impl_list!==null){onEachLazy(impl_list.getElementsByClassName("collapse-toggle"),function(e){collapser(pageId,e,collapse)})}var blanket_list=document.getElementById("blanket-implementations-list");if(blanket_list!==null){onEachLazy(blanket_list.getElementsByClassName("collapse-toggle"),function(e){collapser(pageId,e,collapse)})}}}var toggles=document.getElementById("toggle-all-docs");if(toggles){toggles.onclick=toggleAllDocs}function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}function createSimpleToggle(sectionIsCollapsed){var toggle=document.createElement("a");toggle.href="javascript:void(0)";toggle.className="collapse-toggle";toggle.innerHTML="[<span class=\"inner\">"+labelForToggleButton(sectionIsCollapsed)+"</span>]";return toggle}function createToggle(toggle,otherMessage,fontSize,extraClass,show){var span=document.createElement("span");span.className="toggle-label";if(show){span.style.display="none"}if(!otherMessage){span.innerHTML=" Expand description"}else{span.innerHTML=otherMessage}if(fontSize){span.style.fontSize=fontSize}var mainToggle=toggle.cloneNode(true);mainToggle.appendChild(span);var wrapper=document.createElement("div");wrapper.className="toggle-wrapper";if(!show){addClass(wrapper,"collapsed");var inner=mainToggle.getElementsByClassName("inner");if(inner&&inner.length>0){inner[0].innerHTML="+"}}if(extraClass){addClass(wrapper,extraClass)}wrapper.appendChild(mainToggle);return wrapper}(function(){var toggle=createSimpleToggle(false);var hideMethodDocs=getCurrentValue("rustdoc-auto-hide-method-docs")==="true";var pageId=getPageId();var func=function(e){var next=e.nextElementSibling;if(!next){return}if(hasClass(next,"docblock")===true||(hasClass(next,"stability")===true&&hasClass(next.nextElementSibling,"docblock")===true)){var newToggle=toggle.cloneNode(true);insertAfter(newToggle,e.childNodes[e.childNodes.length-1]);if(hideMethodDocs===true&&hasClass(e,"method")===true){collapseDocs(newToggle,"hide",pageId)}}};var funcImpl=function(e){var next=e.nextElementSibling;if(next&&hasClass(next,"docblock")){next=next.nextElementSibling}if(!next){return}if(next.getElementsByClassName("method").length>0&&hasClass(e,"impl")){insertAfter(toggle.cloneNode(true),e.childNodes[e.childNodes.length-1])}};onEachLazy(document.getElementsByClassName("method"),func);onEachLazy(document.getElementsByClassName("associatedconstant"),func);onEachLazy(document.getElementsByClassName("impl"),funcImpl);var impl_call=function(){};if(hideMethodDocs===true){impl_call=function(e,newToggle){if(e.id.match(/^impl(?:-\d+)?$/)===null){if(hasClass(e,"impl")===true){collapseDocs(newToggle,"hide",pageId)}}}}var newToggle=document.createElement("a");newToggle.href="javascript:void(0)";newToggle.className="collapse-toggle hidden-default collapsed";newToggle.innerHTML="[<span class=\"inner\">"+labelForToggleButton(true)+"</span>] Show hidden undocumented items";function toggleClicked(){if(hasClass(this,"collapsed")){removeClass(this,"collapsed");onEachLazy(this.parentNode.getElementsByClassName("hidden"),function(x){if(hasClass(x,"content")===false){removeClass(x,"hidden");addClass(x,"x")}},true);this.innerHTML="[<span class=\"inner\">"+labelForToggleButton(false)+"</span>] Hide undocumented items"}else{addClass(this,"collapsed");onEachLazy(this.parentNode.getElementsByClassName("x"),function(x){if(hasClass(x,"content")===false){addClass(x,"hidden");removeClass(x,"x")}},true);this.innerHTML="[<span class=\"inner\">"+labelForToggleButton(true)+"</span>] Show hidden undocumented items"}}onEachLazy(document.getElementsByClassName("impl-items"),function(e){onEachLazy(e.getElementsByClassName("associatedconstant"),func);var hiddenElems=e.getElementsByClassName("hidden");var needToggle=false;var hlength=hiddenElems.length;for(var i=0;i<hlength;++i){if(hasClass(hiddenElems[i],"content")===false&&hasClass(hiddenElems[i],"docblock")===false){needToggle=true;break}}if(needToggle===true){var inner_toggle=newToggle.cloneNode(true);inner_toggle.onclick=toggleClicked;e.insertBefore(inner_toggle,e.firstChild);impl_call(e.previousSibling,inner_toggle)}});var currentType=document.getElementsByClassName("type-decl")[0];var className=null;if(currentType){currentType=currentType.getElementsByClassName("rust")[0];if(currentType){currentType.classList.forEach(function(item){if(item!=="main"){className=item;return true}})}}var showItemDeclarations=getCurrentValue("rustdoc-auto-hide-"+className);if(showItemDeclarations===null){if(className==="enum"||className==="macro"){showItemDeclarations="false"}else if(className==="struct"||className==="union"||className==="trait"){showItemDeclarations="true"}else{showItemDeclarations=getCurrentValue("rustdoc-auto-hide-declarations")}}showItemDeclarations=showItemDeclarations==="false";function buildToggleWrapper(e){if(hasClass(e,"autohide")){var wrap=e.previousElementSibling;if(wrap&&hasClass(wrap,"toggle-wrapper")){var inner_toggle=wrap.childNodes[0];var extra=e.childNodes[0].tagName==="H3";e.style.display="none";addClass(wrap,"collapsed");onEachLazy(inner_toggle.getElementsByClassName("inner"),function(e){e.innerHTML=labelForToggleButton(true)});onEachLazy(inner_toggle.getElementsByClassName("toggle-label"),function(e){e.style.display="inline-block";if(extra===true){e.innerHTML=" Show "+e.childNodes[0].innerHTML}})}}if(e.parentNode.id==="main"){var otherMessage="";var fontSize;var extraClass;if(hasClass(e,"type-decl")){fontSize="20px";otherMessage=" Show declaration";if(showItemDeclarations===false){extraClass="collapsed"}}else if(hasClass(e,"sub-variant")){otherMessage=" Show fields"}else if(hasClass(e,"non-exhaustive")){otherMessage=" This ";if(hasClass(e,"non-exhaustive-struct")){otherMessage+="struct"}else if(hasClass(e,"non-exhaustive-enum")){otherMessage+="enum"}else if(hasClass(e,"non-exhaustive-variant")){otherMessage+="enum variant"}else if(hasClass(e,"non-exhaustive-type")){otherMessage+="type"}otherMessage+=" is marked as non-exhaustive"}else if(hasClass(e.childNodes[0],"impl-items")){extraClass="marg-left"}e.parentNode.insertBefore(createToggle(toggle,otherMessage,fontSize,extraClass,hasClass(e,"type-decl")===false||showItemDeclarations===true),e);if(hasClass(e,"type-decl")===true&&showItemDeclarations===true){collapseDocs(e.previousSibling.childNodes[0],"toggle")}if(hasClass(e,"non-exhaustive")===true){collapseDocs(e.previousSibling.childNodes[0],"toggle")}}}onEachLazy(document.getElementsByClassName("docblock"),buildToggleWrapper);onEachLazy(document.getElementsByClassName("sub-variant"),buildToggleWrapper)}());function createToggleWrapper(tog){var span=document.createElement("span");span.className="toggle-label";span.style.display="none";span.innerHTML=" Expand attributes";tog.appendChild(span);var wrapper=document.createElement("div");wrapper.className="toggle-wrapper toggle-attributes";wrapper.appendChild(tog);return wrapper}(function(){var itemAttributesFunc=function(){};if(getCurrentValue("rustdoc-auto-hide-attributes")!=="false"){itemAttributesFunc=function(x){collapseDocs(x.previousSibling.childNodes[0],"toggle")}}var attributesToggle=createToggleWrapper(createSimpleToggle(false));onEachLazy(main.getElementsByClassName("attributes"),function(i_e){var attr_tog=attributesToggle.cloneNode(true);if(hasClass(i_e,"top-attr")===true){addClass(attr_tog,"top-attr")}i_e.parentNode.insertBefore(attr_tog,i_e);itemAttributesFunc(i_e)})}());(function(){var lineNumbersFunc=function(){};if(getCurrentValue("rustdoc-line-numbers")==="true"){lineNumbersFunc=function(x){var count=x.textContent.split("\n").length;var elems=[];for(var i=0;i<count;++i){elems.push(i+1)}var node=document.createElement("pre");addClass(node,"line-number");node.innerHTML=elems.join("\n");x.parentNode.insertBefore(node,x)}}onEachLazy(document.getElementsByClassName("rust-example-rendered"),function(e){if(hasClass(e,"compile_fail")){e.addEventListener("mouseover",function(){this.parentElement.previousElementSibling.childNodes[0].style.color="#f00"});e.addEventListener("mouseout",function(){this.parentElement.previousElementSibling.childNodes[0].style.color=""})}else if(hasClass(e,"ignore")){e.addEventListener("mouseover",function(){this.parentElement.previousElementSibling.childNodes[0].style.color="#ff9200"});e.addEventListener("mouseout",function(){this.parentElement.previousElementSibling.childNodes[0].style.color=""})}lineNumbersFunc(e)})}());function printTab(nb){if(nb===0||nb===1||nb===2){currentTab=nb}var nb_copy=nb;onEachLazy(document.getElementById("titles").childNodes,function(elem){if(nb_copy===0){addClass(elem,"selected")}else{removeClass(elem,"selected")}nb_copy-=1});onEachLazy(document.getElementById("results").childNodes,function(elem){if(nb===0){elem.style.display=""}else{elem.style.display="none"}nb-=1})}function putBackSearch(search_input){var search=getSearchElement();if(search_input.value!==""&&hasClass(search,"hidden")){showSearchResults(search);if(browserSupportsHistoryApi()){history.replaceState(search_input.value,"","?search="+encodeURIComponent(search_input.value))}}}if(search_input){search_input.onfocus=function(){putBackSearch(this)}}var params=getQueryStringParams();if(params&¶ms.search){var search=getSearchElement();search.innerHTML="<h3 style=\"text-align: center;\">Loading search results...</h3>";showSearchResults(search)}var sidebar_menu=document.getElementsByClassName("sidebar-menu")[0];if(sidebar_menu){sidebar_menu.onclick=function(){var sidebar=document.getElementsByClassName("sidebar")[0];if(hasClass(sidebar,"mobile")===true){hideSidebar()}else{showSidebar()}}}window.onresize=function(){hideSidebar()};autoCollapse(getPageId(),getCurrentValue("rustdoc-collapse")==="true");if(window.location.hash&&window.location.hash.length>0){expandSection(window.location.hash.replace(/^#/,""))}if(main){onEachLazy(main.getElementsByClassName("loading-content"),function(e){e.remove()});onEachLazy(main.childNodes,function(e){if(e.tagName==="H2"||e.tagName==="H3"){var nextTagName=e.nextElementSibling.tagName;if(nextTagName=="H2"||nextTagName=="H3"){e.nextElementSibling.style.display="flex"}else{e.nextElementSibling.style.display="block"}}})}window.addSearchOptions=function(crates){var elem=document.getElementById("crate-search");if(!elem){return}var crates_text=[];if(Object.keys(crates).length>1){for(var crate in crates){if(hasOwnProperty(crates,crate)){crates_text.push(crate)}}}crates_text.sort(function(a,b){var lower_a=a.toLowerCase();var lower_b=b.toLowerCase();if(lower_a<lower_b){return-1}else if(lower_a>lower_b){return 1}return 0});var savedCrate=getCurrentValue("rustdoc-saved-filter-crate");for(var i=0;i<crates_text.length;++i){var option=document.createElement("option");option.value=crates_text[i];option.innerText=crates_text[i];elem.appendChild(option);if(crates_text[i]===savedCrate){elem.value=savedCrate}}if(search_input){search_input.removeAttribute('disabled')}};function buildHelperPopup(){var popup=document.createElement("aside");addClass(popup,"hidden");popup.id="help";var container=document.createElement("div");var shortcuts=[["?","Show this help dialog"],["S","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["↹","Switch tab"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"<dt><kbd>"+x[0]+"</kbd></dt><dd>"+x[1]+"</dd>").join("");var div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="<h2>Keyboard Shortcuts</h2><dl>"+shortcuts+"</dl></div>";var infos=["Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to \
+ restrict the search to a given type.","Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, \
+ <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, \
+ and <code>const</code>.","Search functions by type signature (e.g., <code>vec -> usize</code> or \
+ <code>* -> vec</code>)","Search multiple things at once by splitting your query with comma (e.g., \
+ <code>str,u8</code> or <code>String,struct:Vec,test</code>)","You can look for items with an exact name by putting double quotes around \
+ your request: <code>\"string\"</code>","Look for items inside another one by searching for a path: <code>vec::Vec</code>",].map(x=>"<p>"+x+"</p>").join("");var div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="<h2>Search Tricks</h2>"+infos;container.appendChild(div_shortcuts);container.appendChild(div_infos);popup.appendChild(container);insertAfter(popup,getSearchElement())}onHashChange(null);window.onhashchange=onHashChange;buildHelperPopup()}());window.onunload=function(){}
\ No newline at end of file
--- /dev/null
+/*! normalize.css v3.0.0 | MIT License | git.io/normalize */
+html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}
\ No newline at end of file
--- /dev/null
+#main>h2+div,#main>h2+h3,#main>h3+div{display:block;}.loading-content{display:none;}#main>h2+div,#main>h3+div{display:block;}#main>h2+h3{display:flex;}
\ No newline at end of file
--- /dev/null
+ @font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular.woff") format('woff');}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium.woff") format('woff');}@font-face {font-family:'Source Serif Pro';font-style:normal;font-weight:400;src:local('Source Serif Pro'),url("SourceSerifPro-Regular.ttf.woff") format('woff');}@font-face {font-family:'Source Serif Pro';font-style:italic;font-weight:400;src:local('Source Serif Pro Italic'),url("SourceSerifPro-It.ttf.woff") format('woff');}@font-face {font-family:'Source Serif Pro';font-style:normal;font-weight:700;src:local('Source Serif Pro Bold'),url("SourceSerifPro-Bold.ttf.woff") format('woff');}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular.woff") format('woff');}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold.woff") format('woff');}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}html{content:"";}@media (prefers-color-scheme:light){html{content:"light";}}@media (prefers-color-scheme:dark){html{content:"dark";}}body{font:16px/1.4 "Source Serif Pro",serif;margin:0;position:relative;padding:10px 15px 20px 15px;-webkit-font-feature-settings:"kern","liga";-moz-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";}h1{font-size:1.5em;}h2{font-size:1.4em;}h3{font-size:1.3em;}h1,h2,h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.important),h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant){font-weight:500;margin:20px 0 15px 0;padding-bottom:6px;}h1.fqn{border-bottom:1px dashed;margin-top:0;}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant){border-bottom:1px solid;}h3.impl,h3.method,h4.method,h3.type,h4.type,h4.associatedconstant{flex-basis:100%;font-weight:600;margin-top:16px;margin-bottom:10px;position:relative;}h3.impl,h3.method,h3.type{padding-left:15px;}h1,h2,h3,h4,.sidebar,a.source,.search-input,.content table :not(code)>a,.collapse-toggle,div.item-list .out-of-band,#source-sidebar,#sidebar-toggle{font-family:"Fira Sans",sans-serif;}ol,ul{padding-left:25px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.6em;}p{margin:0 0 .6em 0;}summary{outline:none;}code,pre,a.test-arrow{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.1em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;}.source .content pre{padding:20px;}img{max-width:100%;}li{position:relative;}.source .content{margin-top:50px;max-width:none;overflow:visible;margin-left:0px;min-width:70em;}nav.sub{font-size:16px;text-transform:uppercase;}.sidebar{width:200px;position:fixed;left:0;top:0;bottom:0;overflow:auto;}*{scrollbar-width:initial;}.sidebar{scrollbar-width:thin;}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;}.sidebar .block>ul>li{margin-right:-10px;}.content,nav{max-width:960px;}.hidden{display:none !important;}.logo-container{height:100px;width:100px;position:relative;margin:20px auto;display:block;margin-top:10px;}.logo-container>img{max-width:100px;max-height:100px;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:block;}.sidebar .location{border:1px solid;font-size:17px;margin:30px 10px 20px 10px;text-align:center;word-wrap:break-word;}.sidebar .version{font-size:15px;text-align:center;border-bottom:1px solid;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;}.location:empty{border:none;}.location a:first-child{font-weight:500;}.block{padding:0;margin-bottom:14px;}.block h2,.block h3{margin-top:0;margin-bottom:8px;text-align:center;}.block ul,.block li{margin:0 10px;padding:0;list-style:none;}.block a{display:block;text-overflow:ellipsis;overflow:hidden;line-height:15px;padding:7px 5px;font-size:14px;font-weight:300;transition:border 500ms ease-out;}.sidebar-title{border-top:1px solid;border-bottom:1px solid;text-align:center;font-size:17px;margin-bottom:5px;}.sidebar-links{margin-bottom:15px;}.sidebar-links>a{padding-left:10px;width:100%;}.sidebar-menu{display:none;}.content{padding:15px 0;}.source .content pre.rust{white-space:pre;overflow:auto;padding-left:0;}.rustdoc:not(.source) .example-wrap{display:inline-flex;margin-bottom:10px;position:relative;}.example-wrap{width:100%;}.example-wrap>pre.line-number{overflow:initial;border:1px solid;border-top-left-radius:5px;border-bottom-left-radius:5px;padding:13px 8px;text-align:right;}.rustdoc:not(.source) .example-wrap>pre.rust{width:100%;overflow-x:auto;}.rustdoc:not(.source) .example-wrap>pre{margin:0;}#search{margin-left:230px;position:relative;}#results{position:absolute;right:0;left:0;overflow:auto;}#results>table{width:100%;table-layout:fixed;}.content pre.line-numbers{float:left;border:none;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.line-numbers span{cursor:pointer;}.docblock-short p{display:inline;}.docblock-short.nowrap{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}.docblock-short p{overflow:hidden;text-overflow:ellipsis;margin:0;}.docblock code,.docblock-short code{white-space:pre-wrap;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom:1px solid;}#main>.docblock h1{font-size:1.3em;}#main>.docblock h2{font-size:1.15em;}#main>.docblock h3,#main>.docblock h4,#main>.docblock h5{font-size:1em;}#main>h2+div,#main>h2+h3,#main>h3+div{display:none;flex-wrap:wrap;}.docblock h1{font-size:1em;}.docblock h2{font-size:0.95em;}.docblock h3,.docblock h4,.docblock h5{font-size:0.9em;}.docblock{margin-left:24px;position:relative;}.content .out-of-band{float:right;font-size:23px;margin:0px;padding:0px;font-weight:normal;}h3.impl>.out-of-band{font-size:21px;}h4.method>.out-of-band{font-size:19px;}h4>code,h3>code,.invisible>code{max-width:calc(100% - 41px);display:block;}.invisible{width:100%;display:inline-block;}.content .in-band{margin:0px;padding:0px;}.in-band>code{display:inline-block;}#main{position:relative;}#main>.since{top:inherit;font-family:"Fira Sans",sans-serif;}.content table:not(.table-display){border-spacing:0 5px;}.content td{vertical-align:top;}.content td:first-child{padding-right:20px;}.content td p:first-child{margin-top:0;}.content td h1,.content td h2{margin-left:0;font-size:1.1em;}.content tr:first-child td{border-top:0;}.docblock table{margin:.5em 0;width:calc(100% - 2px);border:1px dashed;}.docblock table td{padding:.5em;border:1px dashed;}.docblock table th{padding:.5em;text-align:left;border:1px solid;}.fields+table{margin-bottom:1em;}.content .item-list{list-style-type:none;padding:0;}.content .multi-column{-moz-column-count:5;-moz-column-gap:2.5em;-webkit-column-count:5;-webkit-column-gap:2.5em;column-count:5;column-gap:2.5em;}.content .multi-column li{width:100%;display:inline-block;}.content .method{font-size:1em;position:relative;}.content .method .where,.content .fn .where,.content .where.fmt-newline{display:block;font-size:0.8em;}.content .methods>div{margin-left:40px;margin-bottom:15px;}.content .docblock>.impl-items{margin-left:20px;margin-top:-34px;}.content .docblock>.impl-items>h4{border-bottom:0;}.content .docblock>.impl-items .table-display{margin:0;}.content .docblock>.impl-items table td{padding:0;}.toggle-wrapper.marg-left>.collapse-toggle{left:-24px;}.content .docblock>.impl-items .table-display,.impl-items table td{border:none;}.content .stability code{font-size:90%;}.content .stability{position:relative;margin-left:33px;margin-top:-13px;}.sub-variant>div>.stability{margin-top:initial;}.content .stability::before{content:'⬑';font-size:25px;position:absolute;top:-6px;left:-19px;}.content .impl-items .method,.content .impl-items>.type,.impl-items>.associatedconstant{margin-left:20px;}.content .impl-items .docblock,.content .impl-items .stability{margin-bottom:.6em;}.content .impl-items>.stability{margin-left:40px;}.methods>.stability,.content .impl-items>.stability{margin-top:-8px;}.impl-items{flex-basis:100%;}#main>.stability{margin-top:0;}nav:not(.sidebar){border-bottom:1px solid;padding-bottom:10px;margin-bottom:10px;}nav.main{padding:20px 0;text-align:center;}nav.main .current{border-top:1px solid;border-bottom:1px solid;}nav.main .separator{border:1px solid;display:inline-block;height:23px;margin:0 20px;}nav.sum{text-align:right;}nav.sub form{display:inline;}nav.sub,.content{margin-left:230px;}a{text-decoration:none;background:transparent;}.small-section-header:hover>.anchor{display:initial;}.in-band:hover>.anchor,.impl:hover>.anchor{display:inline-block;position:absolute;}.anchor{display:none;position:absolute;left:-7px;}.anchor.field{left:-5px;}.small-section-header>.anchor{left:-28px;padding-right:10px;}.anchor:before{content:'\2002\00a7\2002';}.docblock a:not(.srclink):not(.test-arrow):hover,.docblock-short a:not(.srclink):not(.test-arrow):hover,.stability a{text-decoration:underline;}.invisible>.srclink,h4>code+.srclink{position:absolute;top:0;right:0;font-size:17px;font-weight:normal;}.block a.current.crate{font-weight:500;}.search-container{position:relative;}.search-container>div{display:inline-flex;width:calc(100% - 34px);}#crate-search{margin-top:5px;padding:6px;padding-right:19px;flex:none;border:0;border-right:0;border-radius:4px 0 0 4px;outline:none;cursor:pointer;border-right:1px solid;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;text-overflow:"";background-repeat:no-repeat;background-color:transparent;background-size:20px;background-position:calc(100% - 1px) 56%;}.search-container>.top-button{position:absolute;right:0;top:10px;}.search-input{-moz-box-sizing:border-box !important;box-sizing:border-box !important;outline:none;border:none;border-radius:1px;margin-top:5px;padding:10px 16px;font-size:17px;transition:border-color 300ms ease;transition:border-radius 300ms ease-in-out;transition:box-shadow 300ms ease-in-out;width:100%;}#crate-search+.search-input{border-radius:0 1px 1px 0;width:calc(100% - 32px);}.search-input:focus{border-radius:2px;border:0;outline:0;}.search-results .desc{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:block;}.search-results a{display:block;}.content .search-results td:first-child{padding-right:0;width:50%;}.content .search-results td:first-child a{padding-right:10px;}.content .search-results td:first-child a:after{clear:both;content:"";display:block;}.content .search-results td:first-child a span{float:left;}tr.result span.primitive::after{content:' (primitive type)';font-style:italic;}tr.result span.keyword::after{content:' (keyword)';font-style:italic;}body.blur>:not(#help){filter:blur(8px);-webkit-filter:blur(8px);opacity:.7;}#help{width:100%;height:100vh;position:fixed;top:0;left:0;display:flex;justify-content:center;align-items:center;}#help>div{flex:0 0 auto;box-shadow:0 0 6px rgba(0,0,0,.2);width:550px;height:auto;border:1px solid;}#help dt{float:left;clear:left;display:block;}#help dd{margin:5px 35px;}#help .infos{padding-left:0;}#help h1,#help h2{margin-top:0;}#help>div div{width:50%;float:left;padding:20px;padding-left:17px;}.stab{display:table;border-width:1px;border-style:solid;padding:3px;margin-bottom:5px;font-size:90%;}.stab p{display:inline;}.stab summary{display:list-item;}.stab .emoji{font-size:1.5em;}.module-item .stab{border-radius:3px;display:inline-block;font-size:80%;line-height:1.2;margin-bottom:0;margin-right:.3em;padding:2px;vertical-align:text-bottom;}.module-item.unstable{opacity:0.65;}.since{font-weight:normal;font-size:initial;position:absolute;right:0;top:0;}.impl-items .since,.impl .since{flex-grow:0;padding-left:12px;padding-right:2px;position:initial;}.impl-items .srclink,.impl .srclink{flex-grow:0;font-size:17px;font-weight:normal;}.impl-items code,.impl code{flex-grow:1;}.impl-items h4,h4.impl,h3.impl{display:flex;flex-basis:100%;font-size:16px;margin-bottom:12px;justify-content:space-between;}.variants_table{width:100%;}.variants_table tbody tr td:first-child{width:1%;}td.summary-column{width:100%;}.summary{padding-right:0px;}pre.rust .question-mark{font-weight:bold;}a.test-arrow{display:inline-block;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:130%;top:5px;right:5px;z-index:1;}a.test-arrow:hover{text-decoration:none;}.section-header:hover a:before{position:absolute;left:-25px;padding-right:10px;content:'\2002\00a7\2002';}.section-header:hover a{text-decoration:none;}.section-header a{color:inherit;}.collapse-toggle{font-weight:300;position:absolute;left:-23px;top:0;}h3>.collapse-toggle,h4>.collapse-toggle{font-size:0.8em;top:5px;}.toggle-wrapper>.collapse-toggle{left:-24px;margin-top:0px;}.toggle-wrapper{position:relative;margin-top:0;}.toggle-wrapper.collapsed{height:25px;transition:height .2s;margin-bottom:.6em;}.collapse-toggle>.inner{display:inline-block;width:1.2ch;text-align:center;}.collapse-toggle.hidden-default{position:relative;margin-left:20px;}.since+.srclink{display:table-cell;padding-left:10px;}.item-spacer{width:100%;height:12px;}.out-of-band>span.since{position:initial;font-size:20px;margin-right:5px;}.toggle-wrapper>.collapse-toggle{left:0;}.variant+.toggle-wrapper+.docblock>p{margin-top:5px;}.sub-variant,.sub-variant>h3{margin-top:1px !important;}#main>.sub-variant>h3{font-size:15px;margin-left:25px;margin-bottom:5px;}.sub-variant>div{margin-left:20px;margin-bottom:10px;}.sub-variant>div>span{display:block;position:relative;}.toggle-label{display:inline-block;margin-left:4px;margin-top:3px;}.enum>.toggle-wrapper+.docblock,.struct>.toggle-wrapper+.docblock{margin-left:30px;margin-bottom:20px;margin-top:5px;}.docblock>.section-header:first-child{margin-left:15px;margin-top:0;}.docblock>.section-header:first-child:hover>a:before{left:-10px;}.enum>.collapsed,.struct>.collapsed{margin-bottom:25px;}#main>.variant,#main>.structfield{display:block;}.attributes{display:block;margin-top:0px !important;margin-right:0px;margin-bottom:0px !important;margin-left:30px;}.toggle-attributes.collapsed{margin-bottom:0;}.impl-items>.toggle-attributes{margin-left:20px;}.impl-items .attributes{font-weight:500;}:target>code{opacity:1;}.information{position:absolute;left:-25px;margin-top:7px;z-index:1;}.tooltip{position:relative;display:inline-block;cursor:pointer;}.tooltip .tooltiptext{width:120px;display:none;text-align:center;padding:5px 3px 3px 3px;border-radius:6px;margin-left:5px;top:-5px;left:105%;z-index:10;font-size:16px;}.tooltip:hover .tooltiptext{display:inline;}.tooltip .tooltiptext::after{content:" ";position:absolute;top:50%;left:16px;margin-top:-5px;border-width:5px;border-style:solid;}.tooltip.compile_fail,.tooltip.ignore{font-weight:bold;font-size:20px;}.tooltip .tooltiptext{border:1px solid;font-weight:normal;}pre.rust{position:relative;tab-size:4;-moz-tab-size:4;}.search-failed{text-align:center;margin-top:20px;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#titles{height:35px;}#titles>div{float:left;width:33.3%;text-align:center;font-size:18px;cursor:pointer;border-top:2px solid;}#titles>div:not(:last-child){margin-right:1px;width:calc(33.3% - 1px);}#titles>div>div.count{display:inline-block;font-size:16px;}#all-types{text-align:center;border:1px solid;margin:0 10px;margin-bottom:10px;display:block;border-radius:7px;}#all-types>p{margin:5px 0;}#sidebar-toggle{position:fixed;top:30px;left:300px;z-index:10;padding:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;cursor:pointer;font-weight:bold;transition:left .5s;font-size:1.2em;border:1px solid;border-left:0;}#source-sidebar{position:fixed;top:0;bottom:0;left:0;width:300px;z-index:1;overflow:auto;transition:left .5s;border-right:1px solid;}#source-sidebar>.title{font-size:1.5em;text-align:center;border-bottom:1px solid;margin-bottom:6px;}.theme-picker{position:absolute;left:211px;top:19px;}.theme-picker button{outline:none;}#settings-menu{position:absolute;right:0;top:10px;outline:none;}#theme-picker,#settings-menu{padding:4px;width:27px;height:29px;border:1px solid;border-radius:3px;cursor:pointer;}#theme-choices{display:none;position:absolute;left:0;top:28px;border:1px solid;border-radius:3px;z-index:1;cursor:pointer;}#theme-choices>button{border:none;width:100%;padding:4px;text-align:center;background:rgba(0,0,0,0);}#theme-choices>button:not(:first-child){border-top:1px solid;}@media (max-width:700px){body{padding-top:0px;}.rustdoc>.sidebar{height:45px;min-height:40px;margin:0;margin-left:-15px;padding:0 15px;position:static;z-index:11;}.sidebar>.location{float:right;margin:0px;margin-top:2px;padding:3px 10px 1px 10px;min-height:39px;background:inherit;text-align:left;font-size:24px;}.sidebar .location:empty{padding:0;}.sidebar .logo-container{width:35px;height:35px;margin-top:5px;margin-bottom:5px;float:left;margin-left:50px;}.sidebar .logo-container>img{max-width:35px;max-height:35px;}.sidebar-menu{position:fixed;z-index:10;font-size:2rem;cursor:pointer;width:45px;left:0;text-align:center;display:block;border-bottom:1px solid;border-right:1px solid;height:45px;}.rustdoc.source>.sidebar>.sidebar-menu{display:none;}.sidebar-elems{position:fixed;z-index:1;left:0;top:45px;bottom:0;overflow-y:auto;border-right:1px solid;display:none;}.sidebar>.block.version{border-bottom:none;margin-top:12px;}nav.sub{width:calc(100% - 32px);float:right;}.content{margin-left:0px;}#main{margin-top:45px;padding:0;}.content .in-band{width:100%;}.content h4>.out-of-band{position:inherit;}.toggle-wrapper>.collapse-toggle{left:0px;}.toggle-wrapper{height:1.5em;}#search{margin-left:0;}.content .impl-items .method,.content .impl-items>.type,.impl-items>.associatedconstant{display:flex;}.anchor{display:none !important;}h1.fqn{overflow:initial;}.theme-picker{left:10px;top:54px;z-index:1;}#titles>div>div.count{float:left;width:100%;}#titles{height:50px;}.sidebar.mobile{position:fixed;width:100%;margin-left:0;background-color:rgba(0,0,0,0);height:100%;}.sidebar{width:calc(100% + 30px);}.show-it{display:block;width:246px;}.show-it>.block.items{margin:8px 0;}.show-it>.block.items>ul{margin:0;}.show-it>.block.items>ul>li{text-align:center;margin:2px 0;}.show-it>.block.items>ul>li>a{font-size:21px;}#sidebar-filler{position:fixed;left:45px;width:calc(100% - 45px);top:0;height:45px;z-index:-1;border-bottom:1px solid;}.collapse-toggle{left:-20px;}.impl>.collapse-toggle{left:-10px;}#all-types{margin:10px;}#sidebar-toggle{top:100px;width:30px;font-size:1.5rem;text-align:center;padding:0;}#source-sidebar{z-index:11;}#main>.line-numbers{margin-top:0;}}@media print{nav.sub,.content .out-of-band,.collapse-toggle{display:none;}}@media (max-width:416px){#titles{height:73px;}#titles>div{height:73px;}}h3.important{margin:0;margin-bottom:13px;font-size:19px;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px;border-radius:3px;box-shadow:inset 0 -1px 0;cursor:default;}.hidden-by-impl-hider,.hidden-by-usual-hider{display:none !important;}#implementations-list>h3>span.in-band{width:100%;}.table-display{width:100%;border:0;border-collapse:collapse;border-spacing:0;font-size:16px;}.table-display tr td:first-child{padding-right:0;}.table-display tr td:last-child{float:right;}.table-display .out-of-band{position:relative;font-size:19px;display:block;}#implementors-list>.impl-items .table-display .out-of-band{font-size:17px;}.table-display td:hover .anchor{display:block;top:2px;left:-5px;}#main>ul{padding-left:10px;}#main>ul>li{list-style:none;}.non-exhaustive{margin-bottom:1em;}div.children{padding-left:27px;display:none;}div.name{cursor:pointer;position:relative;margin-left:16px;}div.files>a{display:block;padding:0 3px;}div.files>a:hover,div.name:hover{background-color:#a14b4b;}div.name.expand+.children{display:block;}div.name::before{content:"\25B6";padding-left:4px;font-size:0.7em;position:absolute;left:-16px;top:4px;}div.name.expand::before{transform:rotate(90deg);left:-15px;top:2px;}.type-decl>pre>.toggle-wrapper.toggle-attributes.top-attr{margin-left:0 !important;}.type-decl>pre>.docblock.attributes.top-attr{margin-left:1.8em !important;}.type-decl>pre>.toggle-attributes{margin-left:2.2em;}.type-decl>pre>.docblock.attributes{margin-left:4em;}
\ No newline at end of file
--- /dev/null
+var searchIndex = JSON.parse('{\
+"bdk":{"doc":"","i":[[3,"FeeRate","bdk","Fee rate",null,null],[3,"UTXO","","A wallet unspent output",null,null],[12,"outpoint","","",0,null],[12,"txout","","",0,null],[12,"is_internal","","",0,null],[3,"TransactionDetails","","A wallet transaction",null,null],[12,"transaction","","",1,null],[12,"txid","","",1,null],[12,"timestamp","","",1,null],[12,"received","","",1,null],[12,"sent","","",1,null],[12,"fees","","",1,null],[12,"height","","",1,null],[4,"Error","","Errors that can be thrown by the `Wallet`",null,null],[13,"KeyMismatch","","",2,null],[13,"MissingInputUTXO","","",2,null],[13,"InvalidU32Bytes","","",2,null],[13,"Generic","","",2,null],[13,"ScriptDoesntHaveAddressForm","","",2,null],[13,"SendAllMultipleOutputs","","",2,null],[13,"NoAddressees","","",2,null],[13,"OutputBelowDustLimit","","",2,null],[13,"InsufficientFunds","","",2,null],[13,"InvalidAddressNetwork","","",2,null],[13,"UnknownUTXO","","",2,null],[13,"DifferentTransactions","","",2,null],[13,"TransactionNotFound","","",2,null],[13,"TransactionConfirmed","","",2,null],[13,"IrreplaceableTransaction","","",2,null],[13,"FeeRateTooLow","","",2,null],[12,"required","bdk::Error","",3,null],[13,"ChecksumMismatch","bdk","",2,null],[13,"DifferentDescriptorStructure","","",2,null],[13,"SpendingPolicyRequired","","",2,null],[13,"InvalidPolicyPathError","","",2,null],[13,"Signer","","",2,null],[13,"Uncapable","","",2,null],[13,"OfflineClient","","",2,null],[13,"InvalidProgressValue","","",2,null],[13,"ProgressUpdateError","","",2,null],[13,"MissingCachedAddresses","","",2,null],[13,"InvalidOutpoint","","",2,null],[13,"Descriptor","","",2,null],[13,"AddressValidator","","",2,null],[13,"Encode","","",2,null],[13,"Miniscript","","",2,null],[13,"BIP32","","",2,null],[13,"Secp256k1","","",2,null],[13,"JSON","","",2,null],[13,"Hex","","",2,null],[13,"PSBT","","",2,null],[13,"Electrum","","",2,null],[13,"Esplora","","",2,null],[13,"CompactFilters","","",2,null],[13,"Sled","","",2,null],[4,"ScriptType","","Types of script",null,null],[13,"External","","",4,null],[13,"Internal","","",4,null],[0,"blockchain","","Blockchain backends",null,null],[3,"OfflineBlockchain","bdk::blockchain","Type that only implements [`Blockchain`] and is always…",null,null],[3,"NoopProgress","","Type that implements [`Progress`] and drops every update…",null,null],[3,"LogProgress","","Type that implements [`Progress`] and logs at level `INFO`…",null,null],[4,"Capability","","Capabilities that can be supported by a [`Blockchain`]…",null,null],[13,"FullHistory","","Can recover the full history of a wallet and not only the…",5,null],[13,"GetAnyTx","","Can fetch any historical transaction given its txid",5,null],[13,"AccurateFees","","Can compute accurate fees for the transactions found…",5,null],[5,"progress","","Shortcut to create a [`channel`] (pair of [`Sender`] and…",null,[[]]],[5,"noop_progress","","Create a new instance of [`NoopProgress`]",null,[[],["noopprogress",3]]],[5,"log_progress","","Create a nwe instance of [`LogProgress`]",null,[[],["logprogress",3]]],[0,"electrum","","Electrum",null,null],[3,"ElectrumBlockchain","bdk::blockchain::electrum","Wrapper over an Electrum Client that implements the…",null,null],[0,"esplora","bdk::blockchain","Esplora",null,null],[3,"EsploraBlockchain","bdk::blockchain::esplora","Structure that implements the logic to sync with Esplora",null,null],[4,"EsploraError","","Errors that can happen during a sync with…",null,null],[13,"Reqwest","","Error with the HTTP call",6,null],[13,"Parsing","","Invalid number returned",6,null],[13,"BitcoinEncoding","","Invalid Bitcoin data returned",6,null],[13,"TransactionNotFound","","Transaction not found",6,null],[11,"new","","Create a new instance of the client from a base URL",7,[[]]],[0,"compact_filters","bdk::blockchain","Compact Filters",null,null],[3,"Mempool","bdk::blockchain::compact_filters","Container for unconfirmed, but valid Bitcoin transactions",null,null],[3,"Peer","","A Bitcoin peer",null,null],[3,"CompactFiltersBlockchain","","Structure implementing the required blockchain traits",null,null],[4,"CompactFiltersError","","An error that can occur during sync with a…",null,null],[13,"InvalidResponse","","A peer sent an invalid or unexpected response",8,null],[13,"InvalidHeaders","","The headers returned are invalid",8,null],[13,"InvalidFilterHeader","","The compact filter headers returned are invalid",8,null],[13,"InvalidFilter","","The compact filter returned is invalid",8,null],[13,"MissingBlock","","The peer is missing a block in the valid chain",8,null],[13,"DataCorruption","","The data stored in the block filters storage are corrupted",8,null],[13,"NotConnected","","A peer is not connected",8,null],[13,"Timeout","","A peer took too long to reply to one of our messages",8,null],[13,"NoPeers","","No peers have been specified",8,null],[13,"DB","","Internal database error",8,null],[13,"IO","","Internal I/O error",8,null],[13,"BIP158","","Invalid BIP158 filter",8,null],[13,"Time","","Internal system time error",8,null],[13,"Global","","Wrapper for [`crate::error::Error`]",8,null],[11,"add_tx","","Add a transaction to the mempool",9,[[["transaction",3]]]],[11,"get_tx","","Look-up a transaction in the mempool given an…",9,[[["inventory",4]],[["transaction",3],["option",4]]]],[11,"has_tx","","Return whether or not the mempool contains a transaction…",9,[[["txid",3]]]],[11,"iter_txs","","Return the list of transactions contained in the mempool",9,[[],[["vec",3],["transaction",3]]]],[11,"connect","","Connect to a peer over a plaintext TCP connection",10,[[["tosocketaddrs",8],["arc",3],["network",4],["mempool",3]],[["compactfilterserror",4],["result",4]]]],[11,"connect_proxy","","Connect to a peer through a SOCKS5 proxy, optionally by…",10,[[["tosocketaddrs",8],["option",4],["arc",3],["network",4],["mempool",3],["totargetaddr",8]],[["compactfilterserror",4],["result",4]]]],[11,"get_version","","Return the [`VersionMessage`] sent by the peer",10,[[],["versionmessage",3]]],[11,"get_network","","Return the Bitcoin [`Network`] in use",10,[[],["network",4]]],[11,"get_mempool","","Return the mempool used by this peer",10,[[],[["mempool",3],["arc",3]]]],[11,"is_connected","","Return whether or not the peer is still connected",10,[[]]],[11,"send","","Send a raw Bitcoin message to the peer",10,[[["networkmessage",4]],[["result",4],["compactfilterserror",4]]]],[11,"recv","","Waits for a specific incoming Bitcoin message, optionally…",10,[[["duration",3],["option",4]],[["compactfilterserror",4],["result",4],["option",4]]]],[11,"new","","Construct a new instance given a list of peers, a path to…",11,[[["peer",3],["asref",8],["path",3],["option",4],["vec",3]],[["compactfilterserror",4],["result",4]]]],[6,"ProgressData","bdk::blockchain","Data sent with a progress update over a [`channel`]",null,null],[8,"BlockchainMarker","","Marker trait for a blockchain backend",null,null],[8,"Blockchain","","Trait that defines the actions that must be supported by a…",null,null],[10,"get_capabilities","","Return the set of [`Capability`] supported by this backend",12,[[],[["hashset",3],["capability",4]]]],[10,"setup","","Setup the backend and populate the internal database for…",12,[[["progress",8],["option",4]],[["result",4],["error",4]]]],[11,"sync","","Populate the internal database with transactions and UTXOs",12,[[["progress",8],["option",4]],[["result",4],["error",4]]]],[10,"get_tx","","Fetch a transaction from the blockchain given its txid",12,[[["txid",3]],[["error",4],["result",4],["option",4]]]],[10,"broadcast","","Broadcast a transaction",12,[[["transaction",3]],[["result",4],["error",4]]]],[10,"get_height","","Return the current height",12,[[],[["error",4],["result",4]]]],[10,"estimate_fee","","Estimate the fee rate required to confirm a transaction in…",12,[[],[["feerate",3],["result",4],["error",4]]]],[8,"Progress","","Trait for types that can receive and process progress…",null,null],[10,"update","","Send a new progress update",13,[[["string",3],["option",4]],[["result",4],["error",4]]]],[0,"database","bdk","Database types",null,null],[0,"memory","bdk::database","In-memory ephemeral database",null,null],[3,"MemoryDatabase","bdk::database::memory","In-memory ephemeral database",null,null],[11,"new","","Create a new empty database",14,[[]]],[8,"BatchOperations","bdk::database","Trait for operations that can be batched",null,null],[10,"set_script_pubkey","","Store a script_pubkey along with its script type and child…",15,[[["scripttype",4],["script",3]],[["result",4],["error",4]]]],[10,"set_utxo","","Store a [`UTXO`]",15,[[["utxo",3]],[["result",4],["error",4]]]],[10,"set_raw_tx","","Store a raw transaction",15,[[["transaction",3]],[["result",4],["error",4]]]],[10,"set_tx","","Store the metadata of a transaction",15,[[["transactiondetails",3]],[["result",4],["error",4]]]],[10,"set_last_index","","Store the last derivation index for a given script type",15,[[["scripttype",4]],[["result",4],["error",4]]]],[10,"del_script_pubkey_from_path","","Delete a script_pubkey given the script type and its child…",15,[[["scripttype",4]],[["option",4],["error",4],["result",4]]]],[10,"del_path_from_script_pubkey","","Delete the data related to a specific script_pubkey,…",15,[[["script",3]],[["error",4],["result",4],["option",4]]]],[10,"del_utxo","","Delete a [`UTXO`] given its [`OutPoint`]",15,[[["outpoint",3]],[["result",4],["error",4],["option",4]]]],[10,"del_raw_tx","","Delete a raw transaction given its [`Txid`]",15,[[["txid",3]],[["error",4],["result",4],["option",4]]]],[10,"del_tx","","Delete the metadata of a transaction and optionally the…",15,[[["txid",3]],[["result",4],["option",4],["error",4]]]],[10,"del_last_index","","Delete the last derivation index for a script type",15,[[["scripttype",4]],[["result",4],["option",4],["error",4]]]],[8,"Database","","Trait for reading data from a database",null,null],[10,"check_descriptor_checksum","","Read and checks the descriptor checksum for a given script…",16,[[["scripttype",4],["asref",8]],[["result",4],["error",4]]]],[10,"iter_script_pubkeys","","Return the list of script_pubkeys",16,[[["scripttype",4],["option",4]],[["error",4],["vec",3],["result",4]]]],[10,"iter_utxos","","Return the list of [`UTXO`]s",16,[[],[["vec",3],["result",4],["error",4]]]],[10,"iter_raw_txs","","Return the list of raw transactions",16,[[],[["result",4],["vec",3],["error",4]]]],[10,"iter_txs","","Return the list of transactions metadata",16,[[],[["result",4],["vec",3],["error",4]]]],[10,"get_script_pubkey_from_path","","Fetch a script_pubkey given the script type and child number",16,[[["scripttype",4]],[["option",4],["error",4],["result",4]]]],[10,"get_path_from_script_pubkey","","Fetch the script type and child number of a given…",16,[[["script",3]],[["error",4],["result",4],["option",4]]]],[10,"get_utxo","","Fetch a [`UTXO`] given its [`OutPoint`]",16,[[["outpoint",3]],[["result",4],["error",4],["option",4]]]],[10,"get_raw_tx","","Fetch a raw transaction given its [`Txid`]",16,[[["txid",3]],[["error",4],["result",4],["option",4]]]],[10,"get_tx","","Fetch the transaction metadata and optionally also the raw…",16,[[["txid",3]],[["result",4],["option",4],["error",4]]]],[10,"get_last_index","","Return the last defivation index for a script type",16,[[["scripttype",4]],[["result",4],["option",4],["error",4]]]],[10,"increment_last_index","","Increment the last derivation index for a script type and…",16,[[["scripttype",4]],[["error",4],["result",4]]]],[8,"BatchDatabase","","Trait for a database that supports batch operations",null,null],[16,"Batch","","Container for the operations",17,null],[10,"begin_batch","","Create a new batch container",17,[[]]],[10,"commit_batch","","Consume and apply a batch of operations",17,[[],[["result",4],["error",4]]]],[0,"descriptor","bdk","Descriptors",null,null],[4,"Descriptor","bdk::descriptor","Script descriptor",null,null],[13,"Bare","","A raw scriptpubkey (including pay-to-pubkey) under Legacy…",18,null],[13,"Pk","","Pay-to-Pubkey",18,null],[13,"Pkh","","Pay-to-PubKey-Hash",18,null],[13,"Wpkh","","Pay-to-Witness-PubKey-Hash",18,null],[13,"ShWpkh","","Pay-to-Witness-PubKey-Hash inside P2SH",18,null],[13,"Sh","","Pay-to-ScriptHash with Legacy context",18,null],[13,"Wsh","","Pay-to-Witness-ScriptHash with Segwitv0 context",18,null],[13,"ShWsh","","P2SH-P2WSH with Segwitv0 context",18,null],[4,"Legacy","","Legacy ScriptContext",null,null],[3,"Miniscript","","Top-level script AST type",null,null],[12,"node","","A node in the Abstract Syntax Tree(",19,null],[12,"ty","","The correctness and malleability type information for the…",19,null],[12,"ext","","Additional information helpful for extra analysis.",19,null],[8,"MiniscriptKey","","Public key trait which can be converted to Hash type",null,null],[11,"is_uncompressed","","Check if the publicKey is uncompressed. The default…",20,[[]]],[16,"Hash","","The associated Hash type with the publicKey",20,null],[10,"to_pubkeyhash","","Converts an object to PublicHash",20,[[]]],[8,"ScriptContext","","",null,null],[10,"check_frag_non_malleable","","Depending on ScriptContext, fragments can be malleable.…",21,[[["terminal",4]],[["scriptcontexterror",4],["result",4]]]],[10,"check_frag_validity","","Depending on script Context, some of the Terminals might…",21,[[["terminal",4]],[["scriptcontexterror",4],["result",4]]]],[4,"Segwitv0","","Segwitv0 ScriptContext",null,null],[4,"Terminal","","All AST elements",null,null],[13,"True","","`1`",22,null],[13,"False","","`0`",22,null],[13,"PkK","","`<key>`",22,null],[13,"PkH","","`DUP HASH160 <keyhash> EQUALVERIFY`",22,null],[13,"After","","`n CHECKLOCKTIMEVERIFY`",22,null],[13,"Older","","`n CHECKSEQUENCEVERIFY`",22,null],[13,"Sha256","","`SIZE 32 EQUALVERIFY SHA256 <hash> EQUAL`",22,null],[13,"Hash256","","`SIZE 32 EQUALVERIFY HASH256 <hash> EQUAL`",22,null],[13,"Ripemd160","","`SIZE 32 EQUALVERIFY RIPEMD160 <hash> EQUAL`",22,null],[13,"Hash160","","`SIZE 32 EQUALVERIFY HASH160 <hash> EQUAL`",22,null],[13,"Alt","","`TOALTSTACK [E] FROMALTSTACK`",22,null],[13,"Swap","","`SWAP [E1]`",22,null],[13,"Check","","`[Kt]/[Ke] CHECKSIG`",22,null],[13,"DupIf","","`DUP IF [V] ENDIF`",22,null],[13,"Verify","","[T] VERIFY",22,null],[13,"NonZero","","SIZE 0NOTEQUAL IF [Fn] ENDIF",22,null],[13,"ZeroNotEqual","","[X] 0NOTEQUAL",22,null],[13,"AndV","","[V] [T]/[V]/[F]/[Kt]",22,null],[13,"AndB","","[E] [W] BOOLAND",22,null],[13,"AndOr","","[various] NOTIF [various] ELSE [various] ENDIF",22,null],[13,"OrB","","[E] [W] BOOLOR",22,null],[13,"OrD","","[E] IFDUP NOTIF [T]/[E] ENDIF",22,null],[13,"OrC","","[E] NOTIF [V] ENDIF",22,null],[13,"OrI","","IF [various] ELSE [various] ENDIF",22,null],[13,"Thresh","","[E] ([W] ADD)* k EQUAL",22,null],[13,"Multi","","k ()* n CHECKMULTISIG",22,null],[8,"ToPublicKey","","Trait describing public key types which can be converted…",null,null],[10,"to_public_key","","Converts an object to a public key",23,[[],["publickey",3]]],[11,"serialized_len","","Computes the size of a public key when serialized in a…",23,[[]]],[10,"hash_to_hash160","","Converts a hashed version of the public key to a `hash160`…",23,[[],["hash",3]]],[0,"checksum","","Descriptor checksum",null,null],[5,"get_checksum","bdk::descriptor::checksum","Compute the checksum of a descriptor",null,[[],[["error",4],["string",3],["result",4]]]],[0,"error","bdk::descriptor","Descriptor errors",null,null],[4,"Error","bdk::descriptor::error","Errors related to the parsing and usage of descriptors",null,null],[13,"InternalError","","",24,null],[13,"InvalidPrefix","","",24,null],[13,"HardenedDerivationOnXpub","","",24,null],[13,"MalformedInput","","",24,null],[13,"KeyParsingError","","",24,null],[13,"Policy","","",24,null],[13,"InputIndexDoesntExist","","",24,null],[13,"MissingPublicKey","","",24,null],[13,"MissingDetails","","",24,null],[13,"InvalidDescriptorCharacter","","",24,null],[13,"CantDeriveWithMiniscript","","",24,null],[13,"BIP32","","",24,null],[13,"Base58","","",24,null],[13,"PK","","",24,null],[13,"Miniscript","","",24,null],[13,"Hex","","",24,null],[0,"policy","bdk::descriptor","Descriptor policy",null,null],[3,"PKOrF","bdk::descriptor::policy","Raw public key or extended key fingerprint",null,null],[3,"Policy","","Descriptor spending policy",null,null],[12,"id","","Identifier for this policy node",25,null],[12,"item","","Type of this policy node",25,null],[12,"satisfaction","","How a much given PSBT already satisfies this polcy node…",25,null],[12,"contribution","","How the wallet\'s descriptor can satisfy this policy node",25,null],[3,"Condition","","An extra condition that must be satisfied but that is out…",null,null],[12,"csv","","",26,null],[12,"timelock","","",26,null],[4,"SatisfiableItem","","An item that need to be satisfied",null,null],[13,"Signature","","",27,null],[13,"SignatureKey","","",27,null],[13,"SHA256Preimage","","",27,null],[12,"hash","bdk::descriptor::policy::SatisfiableItem","",28,null],[13,"HASH256Preimage","bdk::descriptor::policy","",27,null],[12,"hash","bdk::descriptor::policy::SatisfiableItem","",29,null],[13,"RIPEMD160Preimage","bdk::descriptor::policy","",27,null],[12,"hash","bdk::descriptor::policy::SatisfiableItem","",30,null],[13,"HASH160Preimage","bdk::descriptor::policy","",27,null],[12,"hash","bdk::descriptor::policy::SatisfiableItem","",31,null],[13,"AbsoluteTimelock","bdk::descriptor::policy","",27,null],[12,"value","bdk::descriptor::policy::SatisfiableItem","",32,null],[13,"RelativeTimelock","bdk::descriptor::policy","",27,null],[12,"value","bdk::descriptor::policy::SatisfiableItem","",33,null],[13,"Thresh","bdk::descriptor::policy","",27,null],[12,"items","bdk::descriptor::policy::SatisfiableItem","",34,null],[12,"threshold","","",34,null],[13,"Multisig","bdk::descriptor::policy","",27,null],[12,"keys","bdk::descriptor::policy::SatisfiableItem","",35,null],[12,"threshold","","",35,null],[4,"Satisfaction","bdk::descriptor::policy","Represent if and how much a policy item is satisfied by…",null,null],[13,"Partial","","Only a partial satisfaction of some kind of threshold policy",36,null],[12,"n","bdk::descriptor::policy::Satisfaction","Total number of items",37,null],[12,"m","","Threshold",37,null],[12,"items","","The items that can be satisfied by the descriptor",37,null],[12,"conditions","","Extra conditions that also need to be satisfied",37,null],[13,"PartialComplete","bdk::descriptor::policy","Can reach the threshold of some kind of threshold policy",36,null],[12,"n","bdk::descriptor::policy::Satisfaction","Total number of items",38,null],[12,"m","","Threshold",38,null],[12,"items","","The items that can be satisfied by the descriptor",38,null],[12,"conditions","","Extra conditions that also need to be satisfied",38,null],[13,"Complete","bdk::descriptor::policy","Can satisfy the policy item",36,null],[12,"condition","bdk::descriptor::policy::Satisfaction","Extra conditions that also need to be satisfied",39,null],[13,"None","bdk::descriptor::policy","Cannot satisfy or contribute to the policy item",36,null],[4,"PolicyError","","Errors that can happen while extracting and manipulating…",null,null],[13,"NotEnoughItemsSelected","","",40,null],[13,"TooManyItemsSelected","","",40,null],[13,"IndexOutOfRange","","",40,null],[13,"AddOnLeaf","","",40,null],[13,"AddOnPartialComplete","","",40,null],[13,"MixedTimelockUnits","","",40,null],[13,"IncompatibleConditions","","",40,null],[6,"ConditionMap","","",null,null],[6,"FoldedConditionMap","","",null,null],[11,"is_leaf","","",27,[[]]],[11,"id","","",27,[[],["string",3]]],[11,"is_leaf","","",36,[[]]],[11,"is_null","","",26,[[]]],[11,"requires_path","","Return whether or not a specific path in the policy tree…",25,[[]]],[11,"get_condition","","Return the conditions that are set by the spending policy…",25,[[["btreemap",3]],[["policyerror",4],["result",4],["condition",3]]]],[6,"ExtendedDescriptor","bdk::descriptor","Alias for a [`Descriptor`] that can contain extended keys…",null,null],[6,"HDKeyPaths","","Alias for the type of maps that represent derivation paths…",null,null],[8,"ExtractPolicy","","Trait implemented on [`Descriptor`]s to add a method to…",null,null],[10,"extract_policy","","",41,[[["signerscontainer",3],["arc",3]],[["error",4],["option",4],["result",4]]]],[11,"as_byte","bdk","",4,[[]]],[11,"is_internal","","",4,[[]]],[11,"from_btc_per_kvb","","Create a new instance of [`FeeRate`] given a float fee…",42,[[]]],[11,"from_sat_per_vb","","Create a new instance of [`FeeRate`] given a float fee…",42,[[]]],[11,"default_min_relay_fee","","Create a new [`FeeRate`] with the default min relay fee…",42,[[]]],[11,"as_sat_vb","","Return the value as satoshi/vbyte",42,[[]]],[0,"wallet","","Wallet",null,null],[3,"Wallet","bdk::wallet","A Bitcoin wallet",null,null],[0,"address_validator","","Address validation callbacks",null,null],[4,"AddressValidatorError","bdk::wallet::address_validator","Errors that can be returned to fail the validation of an…",null,null],[13,"UserRejected","","",43,null],[13,"ConnectionError","","",43,null],[13,"TimeoutError","","",43,null],[13,"InvalidScript","","",43,null],[13,"Message","","",43,null],[8,"AddressValidator","","Trait to build address validators",null,null],[10,"validate","","Validate or inspect an address",44,[[["scripttype",4],["script",3],["hdkeypaths",6]],[["result",4],["addressvalidatorerror",4]]]],[0,"coin_selection","bdk::wallet","Coin selection",null,null],[3,"CoinSelectionResult","bdk::wallet::coin_selection","Result of a successful coin selection",null,null],[12,"txin","","List of inputs to use, with the respective previous…",45,null],[12,"selected_amount","","Sum of the selected inputs\' value",45,null],[12,"fee_amount","","Total fee amount in satoshi",45,null],[3,"DumbCoinSelection","","Simple and dumb coin selection",null,null],[6,"DefaultCoinSelectionAlgorithm","","Default coin selection algorithm used by `TxBuilder` if…",null,null],[8,"CoinSelectionAlgorithm","","Trait for generalized coin selection algorithms",null,null],[10,"coin_select","","Perform the coin selection",46,[[["vec",3],["feerate",3],["utxo",3]],[["error",4],["result",4],["coinselectionresult",3]]]],[0,"export","bdk::wallet","Wallet export",null,null],[3,"WalletExport","bdk::wallet::export","Structure that contains the export of a wallet",null,null],[12,"blockheight","","Earliest block to rescan when looking for the wallet\'s…",47,null],[12,"label","","Arbitrary label for the wallet",47,null],[11,"export_wallet","","Export a wallet",47,[[["wallet",3]],["result",4]]],[11,"descriptor","","Return the external descriptor",47,[[],["string",3]]],[11,"change_descriptor","","Return the internal descriptor, if present",47,[[],[["string",3],["option",4]]]],[0,"signer","bdk::wallet","Generalized signers",null,null],[3,"SignerOrdering","bdk::wallet::signer","Defines the order in which signers are called",null,null],[12,"0","","",48,null],[3,"SignersContainer","","Container for multiple signers",null,null],[4,"SignerId","","Identifier of a signer in the `SignersContainers`. Used as…",null,null],[13,"PkHash","","",49,null],[13,"Fingerprint","","",49,null],[4,"SignerError","","Signing error",null,null],[13,"MissingKey","","The private key is missing for the required public key",50,null],[13,"UserCanceled","","The user canceled the operation",50,null],[13,"MissingSighash","","The sighash is missing in the PSBT input",50,null],[13,"InputIndexOutOfRange","","Input index is out of range",50,null],[13,"MissingNonWitnessUtxo","","The `non_witness_utxo` field of the transaction is…",50,null],[13,"InvalidNonWitnessUtxo","","The `non_witness_utxo` specified is invalid",50,null],[13,"MissingWitnessUtxo","","The `witness_utxo` field of the transaction is required to…",50,null],[13,"MissingWitnessScript","","The `witness_script` field of the transaction is requied…",50,null],[13,"MissingHDKeypath","","The fingerprint and derivation path are missing from the…",50,null],[8,"Signer","","Trait for signers",null,null],[10,"sign","","Sign a PSBT",51,[[["partiallysignedtransaction",3],["option",4]],[["result",4],["signererror",4]]]],[10,"sign_whole_tx","","Return whether or not the signer signs the whole…",51,[[]]],[11,"descriptor_secret_key","","Return the secret key for the signer",51,[[],[["option",4],["descriptorsecretkey",4]]]],[11,"as_key_map","","",52,[[],["keymap",6]]],[11,"new","","Default constructor",52,[[]]],[11,"add_external","","Adds an external signer to the container for the specified…",52,[[["signerid",4],["signerordering",3],["arc",3],["box",3]],[["arc",3],["option",4]]]],[11,"remove","","Removes a signer from the container and returns it",52,[[["signerid",4],["signerordering",3]],[["arc",3],["option",4]]]],[11,"ids","","Returns the list of identifiers of all the signers in the…",52,[[],[["vec",3],["signerid",4]]]],[11,"signers","","Returns the list of signers in the container, sorted by…",52,[[],[["arc",3],["vec",3]]]],[11,"find","","Finds the signer with lowest ordering for a given id in…",52,[[["signerid",4]],[["arc",3],["option",4]]]],[0,"time","bdk::wallet","Cross-platform time",null,null],[5,"get_timestamp","bdk::wallet::time","Return the current timestamp in seconds",null,[[]]],[0,"tx_builder","bdk::wallet","Transaction builder",null,null],[3,"TxBuilder","bdk::wallet::tx_builder","A transaction builder",null,null],[4,"TxOrdering","","Ordering of the transaction\'s inputs and outputs",null,null],[13,"Shuffle","","Randomized (default)",53,null],[13,"Untouched","","Unchanged",53,null],[13,"BIP69Lexicographic","","BIP69 / Lexicographic",53,null],[4,"ChangeSpendPolicy","","Policy regarding the use of change outputs when creating a…",null,null],[13,"ChangeAllowed","","Use both change and non-change outputs (default)",54,null],[13,"OnlyChange","","Only use change outputs (see…",54,null],[13,"ChangeForbidden","","Only use non-change outputs (see…",54,null],[11,"new","","Create an empty builder",55,[[]]],[11,"with_recipients","","Create a builder starting from a list of recipients",55,[[["vec",3]]]],[11,"set_recipients","","Replace the recipients already added with a new list",55,[[["vec",3]]]],[11,"add_recipient","","Add a recipient to the internal list",55,[[["script",3]]]],[11,"send_all","","Send all the selected utxos to a single output",55,[[]]],[11,"fee_rate","","Set a custom fee rate",55,[[["feerate",3]]]],[11,"policy_path","","Set the policy path to use while creating the transaction",55,[[["btreemap",3],["vec",3],["string",3]]]],[11,"utxos","","Replace the internal list of utxos that must be spent with…",55,[[["outpoint",3],["vec",3]]]],[11,"add_utxo","","Add a utxo to the internal list of utxos that must be spent",55,[[["outpoint",3]]]],[11,"unspendable","","Replace the internal list of unspendable utxos with a new…",55,[[["outpoint",3],["vec",3]]]],[11,"add_unspendable","","Add a utxo to the internal list of unspendable utxos",55,[[["outpoint",3]]]],[11,"sighash","","Sign with a specific sig hash",55,[[["sighashtype",4]]]],[11,"ordering","","Choose the ordering for inputs and outputs of the…",55,[[["txordering",4]]]],[11,"nlocktime","","Use a specific nLockTime while creating the transaction",55,[[]]],[11,"enable_rbf","","Enable signaling RBF",55,[[]]],[11,"enable_rbf_with_sequence","","Enable signaling RBF with a specific nSequence value",55,[[]]],[11,"version","","Build a transaction with a specific version",55,[[]]],[11,"do_not_spend_change","","Do not spend change outputs",55,[[]]],[11,"only_spend_change","","Only spend change outputs",55,[[]]],[11,"change_policy","","Set a specific [`ChangeSpendPolicy`]. See…",55,[[["changespendpolicy",4]]]],[11,"force_non_witness_utxo","","Fill-in the `psbt::Input::non_witness_utxo` field even if…",55,[[]]],[11,"coin_selection","","Choose the coin selection algorithm",55,[[["coinselectionalgorithm",8]],[["txbuilder",3],["coinselectionalgorithm",8]]]],[11,"sort_tx","","",53,[[["transaction",3]]]],[6,"OfflineWallet","bdk::wallet","Type alias for a [`Wallet`] that uses [`OfflineBlockchain`]",null,null],[8,"IsDust","","Trait to check if a value is below the dust limit",null,null],[10,"is_dust","","Check whether or not a value is below dust limit",56,[[]]],[11,"new_offline","","Create a new \\\"offline\\\" wallet",57,[[["option",4],["network",4]],[["result",4],["error",4]]]],[11,"get_new_address","","Return a newly generated address using the external…",57,[[],[["address",3],["result",4],["error",4]]]],[11,"is_mine","","Return whether or not a `script` is part of this wallet…",57,[[["script",3]],[["error",4],["result",4]]]],[11,"list_unspent","","Return the list of unspent outputs of this wallet",57,[[],[["vec",3],["result",4],["error",4]]]],[11,"list_transactions","","Return the list of transactions made and received by the…",57,[[],[["result",4],["vec",3],["error",4]]]],[11,"get_balance","","Return the balance, meaning the sum of this wallet\'s…",57,[[],[["error",4],["result",4]]]],[11,"add_signer","","Add an external signer",57,[[["scripttype",4],["signerid",4],["signerordering",3],["descriptorpublickey",4],["arc",3],["box",3]]]],[11,"add_address_validator","","Add an address validator",57,[[["arc",3],["box",3]]]],[11,"create_tx","","Create a new transaction following the options specified…",57,[[["txbuilder",3],["coinselectionalgorithm",8]],[["result",4],["error",4]]]],[11,"bump_fee","","Bump the fee of a transaction following the options…",57,[[["txid",3],["txbuilder",3],["coinselectionalgorithm",8]],[["result",4],["error",4]]]],[11,"sign","","Sign a transaction with all the wallet\'s signers, in the…",57,[[["psbt",3],["option",4]],[["error",4],["result",4]]]],[11,"policies","","Return the spending policies for the wallet\'s descriptor",57,[[["scripttype",4]],[["result",4],["option",4],["error",4]]]],[11,"public_descriptor","","Return the \\\"public\\\" version of the wallet\'s descriptor,…",57,[[["scripttype",4]],[["error",4],["option",4],["result",4]]]],[11,"finalize_psbt","","Try to finalize a PSBT",57,[[["psbt",3],["option",4]],[["error",4],["result",4]]]],[11,"new","","Create a new \\\"online\\\" wallet",57,[[["option",4],["network",4]],[["result",4],["error",4]]]],[11,"sync","","Sync the internal database with the blockchain",57,[[["progress",8],["option",4]],[["result",4],["error",4]]]],[11,"client","","Return a reference to the internal blockchain client",57,[[],["option",4]]],[11,"broadcast","","Broadcast a transaction to the network",57,[[["transaction",3]],[["result",4],["txid",3],["error",4]]]],[11,"from","bdk","",42,[[]]],[11,"into","","",42,[[]]],[11,"to_owned","","",42,[[]]],[11,"clone_into","","",42,[[]]],[11,"try_from","","",42,[[],["result",4]]],[11,"try_into","","",42,[[],["result",4]]],[11,"borrow","","",42,[[]]],[11,"borrow_mut","","",42,[[]]],[11,"type_id","","",42,[[],["typeid",3]]],[11,"vzip","","",42,[[]]],[11,"from","","",0,[[]]],[11,"into","","",0,[[]]],[11,"to_owned","","",0,[[]]],[11,"clone_into","","",0,[[]]],[11,"try_from","","",0,[[],["result",4]]],[11,"try_into","","",0,[[],["result",4]]],[11,"borrow","","",0,[[]]],[11,"borrow_mut","","",0,[[]]],[11,"type_id","","",0,[[],["typeid",3]]],[11,"equivalent","","",0,[[]]],[11,"vzip","","",0,[[]]],[11,"from","","",1,[[]]],[11,"into","","",1,[[]]],[11,"to_owned","","",1,[[]]],[11,"clone_into","","",1,[[]]],[11,"try_from","","",1,[[],["result",4]]],[11,"try_into","","",1,[[],["result",4]]],[11,"borrow","","",1,[[]]],[11,"borrow_mut","","",1,[[]]],[11,"type_id","","",1,[[],["typeid",3]]],[11,"equivalent","","",1,[[]]],[11,"vzip","","",1,[[]]],[11,"from","","",2,[[]]],[11,"into","","",2,[[]]],[11,"to_string","","",2,[[],["string",3]]],[11,"try_from","","",2,[[],["result",4]]],[11,"try_into","","",2,[[],["result",4]]],[11,"borrow","","",2,[[]]],[11,"borrow_mut","","",2,[[]]],[11,"type_id","","",2,[[],["typeid",3]]],[11,"vzip","","",2,[[]]],[11,"from","","",4,[[]]],[11,"into","","",4,[[]]],[11,"to_owned","","",4,[[]]],[11,"clone_into","","",4,[[]]],[11,"try_from","","",4,[[],["result",4]]],[11,"try_into","","",4,[[],["result",4]]],[11,"borrow","","",4,[[]]],[11,"borrow_mut","","",4,[[]]],[11,"type_id","","",4,[[],["typeid",3]]],[11,"write_base32","","",4,[[],["result",4]]],[11,"base32_len","","",4,[[]]],[11,"check_base32","","",4,[[],[["result",4],["vec",3]]]],[11,"equivalent","","",4,[[]]],[11,"vzip","","",4,[[]]],[11,"from","bdk::blockchain","",58,[[]]],[11,"into","","",58,[[]]],[11,"try_from","","",58,[[],["result",4]]],[11,"try_into","","",58,[[],["result",4]]],[11,"borrow","","",58,[[]]],[11,"borrow_mut","","",58,[[]]],[11,"type_id","","",58,[[],["typeid",3]]],[11,"vzip","","",58,[[]]],[11,"from","","",59,[[]]],[11,"into","","",59,[[]]],[11,"to_owned","","",59,[[]]],[11,"clone_into","","",59,[[]]],[11,"try_from","","",59,[[],["result",4]]],[11,"try_into","","",59,[[],["result",4]]],[11,"borrow","","",59,[[]]],[11,"borrow_mut","","",59,[[]]],[11,"type_id","","",59,[[],["typeid",3]]],[11,"vzip","","",59,[[]]],[11,"from","","",60,[[]]],[11,"into","","",60,[[]]],[11,"to_owned","","",60,[[]]],[11,"clone_into","","",60,[[]]],[11,"try_from","","",60,[[],["result",4]]],[11,"try_into","","",60,[[],["result",4]]],[11,"borrow","","",60,[[]]],[11,"borrow_mut","","",60,[[]]],[11,"type_id","","",60,[[],["typeid",3]]],[11,"vzip","","",60,[[]]],[11,"from","","",5,[[]]],[11,"into","","",5,[[]]],[11,"to_owned","","",5,[[]]],[11,"clone_into","","",5,[[]]],[11,"try_from","","",5,[[],["result",4]]],[11,"try_into","","",5,[[],["result",4]]],[11,"borrow","","",5,[[]]],[11,"borrow_mut","","",5,[[]]],[11,"type_id","","",5,[[],["typeid",3]]],[11,"equivalent","","",5,[[]]],[11,"vzip","","",5,[[]]],[11,"from","bdk::blockchain::electrum","",61,[[]]],[11,"into","","",61,[[]]],[11,"try_from","","",61,[[],["result",4]]],[11,"try_into","","",61,[[],["result",4]]],[11,"borrow","","",61,[[]]],[11,"borrow_mut","","",61,[[]]],[11,"type_id","","",61,[[],["typeid",3]]],[11,"vzip","","",61,[[]]],[11,"from","bdk::blockchain::esplora","",7,[[]]],[11,"into","","",7,[[]]],[11,"try_from","","",7,[[],["result",4]]],[11,"try_into","","",7,[[],["result",4]]],[11,"borrow","","",7,[[]]],[11,"borrow_mut","","",7,[[]]],[11,"type_id","","",7,[[],["typeid",3]]],[11,"vzip","","",7,[[]]],[11,"from","","",6,[[]]],[11,"into","","",6,[[]]],[11,"to_string","","",6,[[],["string",3]]],[11,"try_from","","",6,[[],["result",4]]],[11,"try_into","","",6,[[],["result",4]]],[11,"borrow","","",6,[[]]],[11,"borrow_mut","","",6,[[]]],[11,"type_id","","",6,[[],["typeid",3]]],[11,"vzip","","",6,[[]]],[11,"from","bdk::blockchain::compact_filters","",9,[[]]],[11,"into","","",9,[[]]],[11,"try_from","","",9,[[],["result",4]]],[11,"try_into","","",9,[[],["result",4]]],[11,"borrow","","",9,[[]]],[11,"borrow_mut","","",9,[[]]],[11,"type_id","","",9,[[],["typeid",3]]],[11,"vzip","","",9,[[]]],[11,"from","","",10,[[]]],[11,"into","","",10,[[]]],[11,"try_from","","",10,[[],["result",4]]],[11,"try_into","","",10,[[],["result",4]]],[11,"borrow","","",10,[[]]],[11,"borrow_mut","","",10,[[]]],[11,"type_id","","",10,[[],["typeid",3]]],[11,"vzip","","",10,[[]]],[11,"from","","",11,[[]]],[11,"into","","",11,[[]]],[11,"try_from","","",11,[[],["result",4]]],[11,"try_into","","",11,[[],["result",4]]],[11,"borrow","","",11,[[]]],[11,"borrow_mut","","",11,[[]]],[11,"type_id","","",11,[[],["typeid",3]]],[11,"vzip","","",11,[[]]],[11,"from","","",8,[[]]],[11,"into","","",8,[[]]],[11,"to_string","","",8,[[],["string",3]]],[11,"try_from","","",8,[[],["result",4]]],[11,"try_into","","",8,[[],["result",4]]],[11,"borrow","","",8,[[]]],[11,"borrow_mut","","",8,[[]]],[11,"type_id","","",8,[[],["typeid",3]]],[11,"vzip","","",8,[[]]],[11,"from","bdk::database::memory","",14,[[]]],[11,"into","","",14,[[]]],[11,"try_from","","",14,[[],["result",4]]],[11,"try_into","","",14,[[],["result",4]]],[11,"borrow","","",14,[[]]],[11,"borrow_mut","","",14,[[]]],[11,"type_id","","",14,[[],["typeid",3]]],[11,"vzip","","",14,[[]]],[11,"from","bdk::descriptor","",18,[[]]],[11,"into","","",18,[[]]],[11,"to_owned","","",18,[[]]],[11,"clone_into","","",18,[[]]],[11,"to_string","","",18,[[],["string",3]]],[11,"try_from","","",18,[[],["result",4]]],[11,"try_into","","",18,[[],["result",4]]],[11,"borrow","","",18,[[]]],[11,"borrow_mut","","",18,[[]]],[11,"type_id","","",18,[[],["typeid",3]]],[11,"equivalent","","",18,[[]]],[11,"vzip","","",18,[[]]],[11,"from","","",62,[[]]],[11,"into","","",62,[[]]],[11,"to_owned","","",62,[[]]],[11,"clone_into","","",62,[[]]],[11,"try_from","","",62,[[],["result",4]]],[11,"try_into","","",62,[[],["result",4]]],[11,"borrow","","",62,[[]]],[11,"borrow_mut","","",62,[[]]],[11,"type_id","","",62,[[],["typeid",3]]],[11,"equivalent","","",62,[[]]],[11,"vzip","","",62,[[]]],[11,"from","","",19,[[]]],[11,"into","","",19,[[]]],[11,"to_owned","","",19,[[]]],[11,"clone_into","","",19,[[]]],[11,"to_string","","",19,[[],["string",3]]],[11,"try_from","","",19,[[],["result",4]]],[11,"try_into","","",19,[[],["result",4]]],[11,"borrow","","",19,[[]]],[11,"borrow_mut","","",19,[[]]],[11,"type_id","","",19,[[],["typeid",3]]],[11,"equivalent","","",19,[[]]],[11,"vzip","","",19,[[]]],[11,"from","","",63,[[]]],[11,"into","","",63,[[]]],[11,"to_owned","","",63,[[]]],[11,"clone_into","","",63,[[]]],[11,"try_from","","",63,[[],["result",4]]],[11,"try_into","","",63,[[],["result",4]]],[11,"borrow","","",63,[[]]],[11,"borrow_mut","","",63,[[]]],[11,"type_id","","",63,[[],["typeid",3]]],[11,"equivalent","","",63,[[]]],[11,"vzip","","",63,[[]]],[11,"from","","",22,[[]]],[11,"into","","",22,[[]]],[11,"to_owned","","",22,[[]]],[11,"clone_into","","",22,[[]]],[11,"to_string","","",22,[[],["string",3]]],[11,"try_from","","",22,[[],["result",4]]],[11,"try_into","","",22,[[],["result",4]]],[11,"borrow","","",22,[[]]],[11,"borrow_mut","","",22,[[]]],[11,"type_id","","",22,[[],["typeid",3]]],[11,"equivalent","","",22,[[]]],[11,"vzip","","",22,[[]]],[11,"from","bdk::descriptor::error","",24,[[]]],[11,"into","","",24,[[]]],[11,"to_string","","",24,[[],["string",3]]],[11,"try_from","","",24,[[],["result",4]]],[11,"try_into","","",24,[[],["result",4]]],[11,"borrow","","",24,[[]]],[11,"borrow_mut","","",24,[[]]],[11,"type_id","","",24,[[],["typeid",3]]],[11,"vzip","","",24,[[]]],[11,"from","bdk::descriptor::policy","",64,[[]]],[11,"into","","",64,[[]]],[11,"to_owned","","",64,[[]]],[11,"clone_into","","",64,[[]]],[11,"try_from","","",64,[[],["result",4]]],[11,"try_into","","",64,[[],["result",4]]],[11,"borrow","","",64,[[]]],[11,"borrow_mut","","",64,[[]]],[11,"type_id","","",64,[[],["typeid",3]]],[11,"vzip","","",64,[[]]],[11,"from","","",25,[[]]],[11,"into","","",25,[[]]],[11,"to_owned","","",25,[[]]],[11,"clone_into","","",25,[[]]],[11,"try_from","","",25,[[],["result",4]]],[11,"try_into","","",25,[[],["result",4]]],[11,"borrow","","",25,[[]]],[11,"borrow_mut","","",25,[[]]],[11,"type_id","","",25,[[],["typeid",3]]],[11,"vzip","","",25,[[]]],[11,"from","","",26,[[]]],[11,"into","","",26,[[]]],[11,"to_owned","","",26,[[]]],[11,"clone_into","","",26,[[]]],[11,"try_from","","",26,[[],["result",4]]],[11,"try_into","","",26,[[],["result",4]]],[11,"borrow","","",26,[[]]],[11,"borrow_mut","","",26,[[]]],[11,"type_id","","",26,[[],["typeid",3]]],[11,"equivalent","","",26,[[]]],[11,"vzip","","",26,[[]]],[11,"from","","",27,[[]]],[11,"into","","",27,[[]]],[11,"to_owned","","",27,[[]]],[11,"clone_into","","",27,[[]]],[11,"try_from","","",27,[[],["result",4]]],[11,"try_into","","",27,[[],["result",4]]],[11,"borrow","","",27,[[]]],[11,"borrow_mut","","",27,[[]]],[11,"type_id","","",27,[[],["typeid",3]]],[11,"vzip","","",27,[[]]],[11,"from","","",36,[[]]],[11,"into","","",36,[[]]],[11,"to_owned","","",36,[[]]],[11,"clone_into","","",36,[[]]],[11,"try_from","","",36,[[],["result",4]]],[11,"try_into","","",36,[[],["result",4]]],[11,"borrow","","",36,[[]]],[11,"borrow_mut","","",36,[[]]],[11,"type_id","","",36,[[],["typeid",3]]],[11,"vzip","","",36,[[]]],[11,"from","","",40,[[]]],[11,"into","","",40,[[]]],[11,"to_string","","",40,[[],["string",3]]],[11,"try_from","","",40,[[],["result",4]]],[11,"try_into","","",40,[[],["result",4]]],[11,"borrow","","",40,[[]]],[11,"borrow_mut","","",40,[[]]],[11,"type_id","","",40,[[],["typeid",3]]],[11,"vzip","","",40,[[]]],[11,"from","bdk::wallet","",57,[[]]],[11,"into","","",57,[[]]],[11,"try_from","","",57,[[],["result",4]]],[11,"try_into","","",57,[[],["result",4]]],[11,"borrow","","",57,[[]]],[11,"borrow_mut","","",57,[[]]],[11,"type_id","","",57,[[],["typeid",3]]],[11,"vzip","","",57,[[]]],[11,"from","bdk::wallet::address_validator","",43,[[]]],[11,"into","","",43,[[]]],[11,"to_owned","","",43,[[]]],[11,"clone_into","","",43,[[]]],[11,"to_string","","",43,[[],["string",3]]],[11,"try_from","","",43,[[],["result",4]]],[11,"try_into","","",43,[[],["result",4]]],[11,"borrow","","",43,[[]]],[11,"borrow_mut","","",43,[[]]],[11,"type_id","","",43,[[],["typeid",3]]],[11,"equivalent","","",43,[[]]],[11,"vzip","","",43,[[]]],[11,"from","bdk::wallet::coin_selection","",45,[[]]],[11,"into","","",45,[[]]],[11,"try_from","","",45,[[],["result",4]]],[11,"try_into","","",45,[[],["result",4]]],[11,"borrow","","",45,[[]]],[11,"borrow_mut","","",45,[[]]],[11,"type_id","","",45,[[],["typeid",3]]],[11,"vzip","","",45,[[]]],[11,"from","","",65,[[]]],[11,"into","","",65,[[]]],[11,"try_from","","",65,[[],["result",4]]],[11,"try_into","","",65,[[],["result",4]]],[11,"borrow","","",65,[[]]],[11,"borrow_mut","","",65,[[]]],[11,"type_id","","",65,[[],["typeid",3]]],[11,"vzip","","",65,[[]]],[11,"from","bdk::wallet::export","",47,[[]]],[11,"into","","",47,[[]]],[11,"to_string","","",47,[[],["string",3]]],[11,"try_from","","",47,[[],["result",4]]],[11,"try_into","","",47,[[],["result",4]]],[11,"borrow","","",47,[[]]],[11,"borrow_mut","","",47,[[]]],[11,"type_id","","",47,[[],["typeid",3]]],[11,"vzip","","",47,[[]]],[11,"from","bdk::wallet::signer","",48,[[]]],[11,"into","","",48,[[]]],[11,"to_owned","","",48,[[]]],[11,"clone_into","","",48,[[]]],[11,"try_from","","",48,[[],["result",4]]],[11,"try_into","","",48,[[],["result",4]]],[11,"borrow","","",48,[[]]],[11,"borrow_mut","","",48,[[]]],[11,"type_id","","",48,[[],["typeid",3]]],[11,"equivalent","","",48,[[]]],[11,"vzip","","",48,[[]]],[11,"from","","",52,[[]]],[11,"into","","",52,[[]]],[11,"to_owned","","",52,[[]]],[11,"clone_into","","",52,[[]]],[11,"try_from","","",52,[[],["result",4]]],[11,"try_into","","",52,[[],["result",4]]],[11,"borrow","","",52,[[]]],[11,"borrow_mut","","",52,[[]]],[11,"type_id","","",52,[[],["typeid",3]]],[11,"vzip","","",52,[[]]],[11,"from","","",49,[[]]],[11,"into","","",49,[[]]],[11,"to_owned","","",49,[[]]],[11,"clone_into","","",49,[[]]],[11,"try_from","","",49,[[],["result",4]]],[11,"try_into","","",49,[[],["result",4]]],[11,"borrow","","",49,[[]]],[11,"borrow_mut","","",49,[[]]],[11,"type_id","","",49,[[],["typeid",3]]],[11,"equivalent","","",49,[[]]],[11,"vzip","","",49,[[]]],[11,"from","","",50,[[]]],[11,"into","","",50,[[]]],[11,"to_owned","","",50,[[]]],[11,"clone_into","","",50,[[]]],[11,"to_string","","",50,[[],["string",3]]],[11,"try_from","","",50,[[],["result",4]]],[11,"try_into","","",50,[[],["result",4]]],[11,"borrow","","",50,[[]]],[11,"borrow_mut","","",50,[[]]],[11,"type_id","","",50,[[],["typeid",3]]],[11,"equivalent","","",50,[[]]],[11,"vzip","","",50,[[]]],[11,"from","bdk::wallet::tx_builder","",55,[[]]],[11,"into","","",55,[[]]],[11,"try_from","","",55,[[],["result",4]]],[11,"try_into","","",55,[[],["result",4]]],[11,"borrow","","",55,[[]]],[11,"borrow_mut","","",55,[[]]],[11,"type_id","","",55,[[],["typeid",3]]],[11,"vzip","","",55,[[]]],[11,"from","","",53,[[]]],[11,"into","","",53,[[]]],[11,"to_owned","","",53,[[]]],[11,"clone_into","","",53,[[]]],[11,"try_from","","",53,[[],["result",4]]],[11,"try_into","","",53,[[],["result",4]]],[11,"borrow","","",53,[[]]],[11,"borrow_mut","","",53,[[]]],[11,"type_id","","",53,[[],["typeid",3]]],[11,"equivalent","","",53,[[]]],[11,"vzip","","",53,[[]]],[11,"from","","",54,[[]]],[11,"into","","",54,[[]]],[11,"to_owned","","",54,[[]]],[11,"clone_into","","",54,[[]]],[11,"try_from","","",54,[[],["result",4]]],[11,"try_into","","",54,[[],["result",4]]],[11,"borrow","","",54,[[]]],[11,"borrow_mut","","",54,[[]]],[11,"type_id","","",54,[[],["typeid",3]]],[11,"equivalent","","",54,[[]]],[11,"vzip","","",54,[[]]],[11,"partial_cmp","bdk::descriptor","",22,[[["terminal",4]],[["option",4],["ordering",4]]]],[11,"lt","","",22,[[["terminal",4]]]],[11,"le","","",22,[[["terminal",4]]]],[11,"gt","","",22,[[["terminal",4]]]],[11,"ge","","",22,[[["terminal",4]]]],[11,"partial_cmp","","",62,[[["legacy",4]],[["option",4],["ordering",4]]]],[11,"partial_cmp","","",18,[[["descriptor",4]],[["option",4],["ordering",4]]]],[11,"lt","","",18,[[["descriptor",4]]]],[11,"le","","",18,[[["descriptor",4]]]],[11,"gt","","",18,[[["descriptor",4]]]],[11,"ge","","",18,[[["descriptor",4]]]],[11,"partial_cmp","","",63,[[["segwitv0",4]],[["option",4],["ordering",4]]]],[11,"partial_cmp","","",19,[[["miniscript",3]],[["option",4],["ordering",4]]]],[11,"fmt","","",63,[[["formatter",3]],[["result",4],["error",3]]]],[11,"fmt","","",22,[[["formatter",3]],[["result",4],["error",3]]]],[11,"fmt","","",19,[[["formatter",3]],[["result",4],["error",3]]]],[11,"fmt","","",18,[[["formatter",3]],[["result",4],["error",3]]]],[11,"fmt","","",62,[[["formatter",3]],[["result",4],["error",3]]]],[11,"hash","","",19,[[]]],[11,"hash","","",22,[[]]],[11,"cmp","","",62,[[["legacy",4]],["ordering",4]]],[11,"cmp","","",63,[[["segwitv0",4]],["ordering",4]]],[11,"cmp","","",22,[[["terminal",4]],["ordering",4]]],[11,"cmp","","",19,[[["miniscript",3]],["ordering",4]]],[11,"cmp","","",18,[[["descriptor",4]],["ordering",4]]],[11,"fmt","","",22,[[["formatter",3]],[["result",4],["error",3]]]],[11,"fmt","","",19,[[["formatter",3]],[["result",4],["error",3]]]],[11,"fmt","","",18,[[["formatter",3]],[["result",4],["error",3]]]],[11,"check_frag_non_malleable","","",63,[[["terminal",4]],[["scriptcontexterror",4],["result",4]]]],[11,"check_frag_validity","","",63,[[["terminal",4]],[["scriptcontexterror",4],["result",4]]]],[11,"check_frag_non_malleable","","",62,[[["terminal",4]],[["scriptcontexterror",4],["result",4]]]],[11,"check_frag_validity","","",62,[[["terminal",4]],[["scriptcontexterror",4],["result",4]]]],[11,"clone","","",19,[[],["miniscript",3]]],[11,"clone","","",22,[[],["terminal",4]]],[11,"clone","","",63,[[],["segwitv0",4]]],[11,"clone","","",18,[[],["descriptor",4]]],[11,"clone","","",62,[[],["legacy",4]]],[11,"eq","","",62,[[["legacy",4]]]],[11,"eq","","",22,[[["terminal",4]]]],[11,"ne","","",22,[[["terminal",4]]]],[11,"eq","","",63,[[["segwitv0",4]]]],[11,"eq","","",19,[[["miniscript",3]]]],[11,"eq","","",18,[[["descriptor",4]]]],[11,"ne","","",18,[[["descriptor",4]]]],[11,"from_str","","",19,[[],[["result",4],["error",4],["miniscript",3]]]],[11,"from_str","","",18,[[],[["error",4],["descriptor",4],["result",4]]]],[11,"from_tree","","Parse an expression tree into a Miniscript. As a general…",19,[[["tree",3]],[["result",4],["error",4],["miniscript",3]]]],[11,"from_tree","","",22,[[["tree",3]],[["error",4],["result",4],["terminal",4]]]],[11,"from_tree","","Parse an expression tree into a descriptor",18,[[["tree",3]],[["error",4],["descriptor",4],["result",4]]]],[11,"lift","","",18,[[],["policy",4]]],[11,"lift","","",19,[[],["policy",4]]],[11,"lift","","",22,[[],["policy",4]]],[11,"update","bdk::blockchain","",59,[[["string",3],["option",4]],[["result",4],["error",4]]]],[11,"update","","",60,[[["string",3],["option",4]],[["result",4],["error",4]]]],[11,"set_script_pubkey","bdk::database::memory","",14,[[["scripttype",4],["script",3]],[["result",4],["error",4]]]],[11,"set_utxo","","",14,[[["utxo",3]],[["result",4],["error",4]]]],[11,"set_raw_tx","","",14,[[["transaction",3]],[["result",4],["error",4]]]],[11,"set_tx","","",14,[[["transactiondetails",3]],[["result",4],["error",4]]]],[11,"set_last_index","","",14,[[["scripttype",4]],[["result",4],["error",4]]]],[11,"del_script_pubkey_from_path","","",14,[[["scripttype",4]],[["option",4],["error",4],["result",4]]]],[11,"del_path_from_script_pubkey","","",14,[[["script",3]],[["error",4],["result",4],["option",4]]]],[11,"del_utxo","","",14,[[["outpoint",3]],[["result",4],["error",4],["option",4]]]],[11,"del_raw_tx","","",14,[[["txid",3]],[["error",4],["result",4],["option",4]]]],[11,"del_tx","","",14,[[["txid",3]],[["result",4],["option",4],["error",4]]]],[11,"del_last_index","","",14,[[["scripttype",4]],[["result",4],["option",4],["error",4]]]],[11,"check_descriptor_checksum","","",14,[[["scripttype",4],["asref",8]],[["result",4],["error",4]]]],[11,"iter_script_pubkeys","","",14,[[["scripttype",4],["option",4]],[["error",4],["vec",3],["result",4]]]],[11,"iter_utxos","","",14,[[],[["vec",3],["result",4],["error",4]]]],[11,"iter_raw_txs","","",14,[[],[["result",4],["vec",3],["error",4]]]],[11,"iter_txs","","",14,[[],[["result",4],["vec",3],["error",4]]]],[11,"get_script_pubkey_from_path","","",14,[[["scripttype",4]],[["option",4],["error",4],["result",4]]]],[11,"get_path_from_script_pubkey","","",14,[[["script",3]],[["error",4],["result",4],["option",4]]]],[11,"get_utxo","","",14,[[["outpoint",3]],[["result",4],["error",4],["option",4]]]],[11,"get_raw_tx","","",14,[[["txid",3]],[["error",4],["result",4],["option",4]]]],[11,"get_tx","","",14,[[["txid",3]],[["result",4],["option",4],["error",4]]]],[11,"get_last_index","","",14,[[["scripttype",4]],[["result",4],["option",4],["error",4]]]],[11,"increment_last_index","","",14,[[["scripttype",4]],[["error",4],["result",4]]]],[11,"begin_batch","","",14,[[]]],[11,"commit_batch","","",14,[[],[["result",4],["error",4]]]],[11,"extract_policy","bdk::descriptor","",19,[[["signerscontainer",3],["arc",3]],[["error",4],["option",4],["result",4]]]],[11,"extract_policy","","",18,[[["signerscontainer",3],["arc",3]],[["error",4],["option",4],["result",4]]]],[11,"coin_select","bdk::wallet::coin_selection","",65,[[["vec",3],["feerate",3],["utxo",3]],[["error",4],["result",4],["coinselectionresult",3]]]],[11,"get_capabilities","bdk::blockchain::electrum","",61,[[],[["hashset",3],["capability",4]]]],[11,"setup","","",61,[[["progress",8],["option",4]],[["result",4],["error",4]]]],[11,"get_tx","","",61,[[["txid",3]],[["error",4],["result",4],["option",4]]]],[11,"broadcast","","",61,[[["transaction",3]],[["result",4],["error",4]]]],[11,"get_height","","",61,[[],[["error",4],["result",4]]]],[11,"estimate_fee","","",61,[[],[["feerate",3],["result",4],["error",4]]]],[11,"get_capabilities","bdk::blockchain::esplora","",7,[[],[["hashset",3],["capability",4]]]],[11,"setup","","",7,[[["progress",8],["option",4]],[["result",4],["error",4]]]],[11,"get_tx","","",7,[[["txid",3]],[["error",4],["result",4],["option",4]]]],[11,"broadcast","","",7,[[["transaction",3]],[["result",4],["error",4]]]],[11,"get_height","","",7,[[],[["error",4],["result",4]]]],[11,"estimate_fee","","",7,[[],[["feerate",3],["result",4],["error",4]]]],[11,"get_capabilities","bdk::blockchain::compact_filters","",11,[[],[["hashset",3],["capability",4]]]],[11,"setup","","",11,[[["progress",8],["option",4]],[["result",4],["error",4]]]],[11,"get_tx","","",11,[[["txid",3]],[["error",4],["result",4],["option",4]]]],[11,"broadcast","","",11,[[["transaction",3]],[["result",4],["error",4]]]],[11,"get_height","","",11,[[],[["error",4],["result",4]]]],[11,"estimate_fee","","",11,[[],[["feerate",3],["result",4],["error",4]]]],[11,"as_ref","bdk","",4,[[]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["addressvalidatorerror",4]]]],[11,"from","","",2,[[["policyerror",4]]]],[11,"from","","",2,[[["signererror",4]]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["error",3]]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["esploraerror",4]]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["compactfilterserror",4]]]],[11,"from","bdk::blockchain::electrum","",61,[[["client",4]]]],[11,"from","bdk::blockchain::esplora","",6,[[["error",3]]]],[11,"from","","",6,[[["parseinterror",3]]]],[11,"from","","",6,[[["error",4]]]],[11,"from","bdk::blockchain::compact_filters","",8,[[["error",3]]]],[11,"from","","",8,[[["error",3]]]],[11,"from","","",8,[[["error",4]]]],[11,"from","","",8,[[["systemtimeerror",3]]]],[11,"from","","",8,[[["error",4]]]],[11,"from","bdk::descriptor::error","",24,[[["error",4]]]],[11,"from","","",24,[[["error",4]]]],[11,"from","","",24,[[["error",4]]]],[11,"from","","",24,[[["error",4]]]],[11,"from","","",24,[[["error",4]]]],[11,"from","","",24,[[["policyerror",4]]]],[11,"from","bdk::descriptor::policy","",36,[[]]],[11,"from","","",25,[[["satisfiableitem",4]]]],[11,"from","bdk::wallet::signer","",49,[[["hash",3]],[["signerid",4],["descriptorpublickey",4]]]],[11,"from","","",49,[[["fingerprint",3]],[["signerid",4],["descriptorpublickey",4]]]],[11,"from","","",52,[[["keymap",6]],[["signerscontainer",3],["descriptorpublickey",4]]]],[11,"clone","bdk::blockchain","",5,[[],["capability",4]]],[11,"clone","","",59,[[],["noopprogress",3]]],[11,"clone","","",60,[[],["logprogress",3]]],[11,"clone","bdk::descriptor::policy","",64,[[],["pkorf",3]]],[11,"clone","","",27,[[],["satisfiableitem",4]]],[11,"clone","","",36,[[],["satisfaction",4]]],[11,"clone","","",25,[[],["policy",3]]],[11,"clone","","",26,[[],["condition",3]]],[11,"clone","bdk","",4,[[],["scripttype",4]]],[11,"clone","","",42,[[],["feerate",3]]],[11,"clone","","",0,[[],["utxo",3]]],[11,"clone","","",1,[[],["transactiondetails",3]]],[11,"clone","bdk::wallet::address_validator","",43,[[],["addressvalidatorerror",4]]],[11,"clone","bdk::wallet::signer","",49,[[],["signerid",4]]],[11,"clone","","",50,[[],["signererror",4]]],[11,"clone","","",48,[[],["signerordering",3]]],[11,"clone","","",52,[[],["signerscontainer",3]]],[11,"clone","bdk::wallet::tx_builder","",53,[[],["txordering",4]]],[11,"clone","","",54,[[],["changespendpolicy",4]]],[11,"default","bdk::blockchain::compact_filters","",9,[[],["mempool",3]]],[11,"default","bdk::database::memory","",14,[[],["memorydatabase",3]]],[11,"default","bdk::descriptor::policy","",64,[[],["pkorf",3]]],[11,"default","","",26,[[],["condition",3]]],[11,"default","bdk","",42,[[]]],[11,"default","","",1,[[],["transactiondetails",3]]],[11,"default","bdk::wallet::coin_selection","",65,[[],["dumbcoinselection",3]]],[11,"default","bdk::wallet::signer","",48,[[]]],[11,"default","","",52,[[],["signerscontainer",3]]],[11,"default","bdk::wallet::tx_builder","",55,[[],["txbuilder",3]]],[11,"default","","",53,[[]]],[11,"default","","",54,[[]]],[11,"cmp","bdk::descriptor::policy","",26,[[["condition",3]],["ordering",4]]],[11,"cmp","bdk::wallet::signer","",48,[[["signerordering",3]],["ordering",4]]],[11,"cmp","bdk::wallet::tx_builder","",53,[[["txordering",4]],["ordering",4]]],[11,"cmp","","",54,[[["changespendpolicy",4]],["ordering",4]]],[11,"eq","bdk::blockchain","",5,[[["capability",4]]]],[11,"eq","bdk::descriptor::policy","",26,[[["condition",3]]]],[11,"ne","","",26,[[["condition",3]]]],[11,"eq","bdk","",4,[[["scripttype",4]]]],[11,"eq","","",42,[[["feerate",3]]]],[11,"ne","","",42,[[["feerate",3]]]],[11,"eq","","",0,[[["utxo",3]]]],[11,"ne","","",0,[[["utxo",3]]]],[11,"eq","","",1,[[["transactiondetails",3]]]],[11,"ne","","",1,[[["transactiondetails",3]]]],[11,"eq","bdk::wallet::address_validator","",43,[[["addressvalidatorerror",4]]]],[11,"ne","","",43,[[["addressvalidatorerror",4]]]],[11,"eq","bdk::wallet::signer","",49,[[["signerid",4]]]],[11,"ne","","",49,[[["signerid",4]]]],[11,"eq","","",50,[[["signererror",4]]]],[11,"eq","","",48,[[["signerordering",3]]]],[11,"ne","","",48,[[["signerordering",3]]]],[11,"eq","bdk::wallet::tx_builder","",53,[[["txordering",4]]]],[11,"eq","","",54,[[["changespendpolicy",4]]]],[11,"partial_cmp","bdk::descriptor::policy","",26,[[["condition",3]],[["option",4],["ordering",4]]]],[11,"lt","","",26,[[["condition",3]]]],[11,"le","","",26,[[["condition",3]]]],[11,"gt","","",26,[[["condition",3]]]],[11,"ge","","",26,[[["condition",3]]]],[11,"partial_cmp","bdk","",42,[[["feerate",3]],[["option",4],["ordering",4]]]],[11,"lt","","",42,[[["feerate",3]]]],[11,"le","","",42,[[["feerate",3]]]],[11,"gt","","",42,[[["feerate",3]]]],[11,"ge","","",42,[[["feerate",3]]]],[11,"partial_cmp","bdk::wallet::signer","",48,[[["signerordering",3]],[["option",4],["ordering",4]]]],[11,"lt","","",48,[[["signerordering",3]]]],[11,"le","","",48,[[["signerordering",3]]]],[11,"gt","","",48,[[["signerordering",3]]]],[11,"ge","","",48,[[["signerordering",3]]]],[11,"partial_cmp","bdk::wallet::tx_builder","",53,[[["txordering",4]],[["option",4],["ordering",4]]]],[11,"partial_cmp","","",54,[[["changespendpolicy",4]],[["option",4],["ordering",4]]]],[11,"to_string","bdk::wallet::export","",47,[[],["string",3]]],[11,"fmt","bdk","",2,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::blockchain::esplora","",7,[[["formatter",3]],["result",6]]],[11,"fmt","","",6,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::blockchain::compact_filters","",9,[[["formatter",3]],["result",6]]],[11,"fmt","","",10,[[["formatter",3]],["result",6]]],[11,"fmt","","",11,[[["formatter",3]],["result",6]]],[11,"fmt","","",8,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::blockchain","",5,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::database::memory","",14,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::descriptor::error","",24,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::descriptor::policy","",64,[[["formatter",3]],["result",6]]],[11,"fmt","","",27,[[["formatter",3]],["result",6]]],[11,"fmt","","",36,[[["formatter",3]],["result",6]]],[11,"fmt","","",25,[[["formatter",3]],["result",6]]],[11,"fmt","","",26,[[["formatter",3]],["result",6]]],[11,"fmt","","",40,[[["formatter",3]],["result",6]]],[11,"fmt","bdk","",4,[[["formatter",3]],["result",6]]],[11,"fmt","","",42,[[["formatter",3]],["result",6]]],[11,"fmt","","",0,[[["formatter",3]],["result",6]]],[11,"fmt","","",1,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::wallet::address_validator","",43,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::wallet::coin_selection","",45,[[["formatter",3]],["result",6]]],[11,"fmt","","",65,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::wallet::export","",47,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::wallet::signer","",49,[[["formatter",3]],["result",6]]],[11,"fmt","","",50,[[["formatter",3]],["result",6]]],[11,"fmt","","",48,[[["formatter",3]],["result",6]]],[11,"fmt","","",52,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::wallet::tx_builder","",55,[[["formatter",3]],["result",6]]],[11,"fmt","","",53,[[["formatter",3]],["result",6]]],[11,"fmt","","",54,[[["formatter",3]],["result",6]]],[11,"fmt","bdk","",2,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::blockchain::esplora","",6,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::blockchain::compact_filters","",8,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::descriptor::error","",24,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::descriptor::policy","",40,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::wallet::address_validator","",43,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::wallet::signer","",50,[[["formatter",3]],["result",6]]],[11,"hash","bdk::blockchain","",5,[[]]],[11,"hash","bdk::descriptor::policy","",26,[[]]],[11,"hash","bdk","",4,[[]]],[11,"hash","bdk::wallet::signer","",49,[[]]],[11,"hash","bdk::wallet::tx_builder","",53,[[]]],[11,"hash","","",54,[[]]],[11,"from_str","bdk::wallet::export","",47,[[],["result",4]]],[11,"serialize","bdk::descriptor::policy","",64,[[],["result",4]]],[11,"serialize","","",27,[[],["result",4]]],[11,"serialize","","",36,[[],["result",4]]],[11,"serialize","","",25,[[],["result",4]]],[11,"serialize","","",26,[[],["result",4]]],[11,"serialize","bdk","",4,[[],["result",4]]],[11,"serialize","","",0,[[],["result",4]]],[11,"serialize","","",1,[[],["result",4]]],[11,"serialize","bdk::wallet::export","",47,[[],["result",4]]],[11,"deserialize","bdk","",4,[[],["result",4]]],[11,"deserialize","","",0,[[],["result",4]]],[11,"deserialize","","",1,[[],["result",4]]],[11,"deserialize","bdk::wallet::export","",47,[[],["result",4]]],[11,"translate_pk","bdk::descriptor","Convert a descriptor using abstract keys to one using…",18,[[],[["result",4],["descriptor",4]]]],[11,"address","","Computes the Bitcoin address of the descriptor, if one…",18,[[["network",4]],[["option",4],["address",3]]]],[11,"script_pubkey","","Computes the scriptpubkey of the descriptor",18,[[],["script",3]]],[11,"unsigned_script_sig","","Computes the scriptSig that will be in place for an…",18,[[],["script",3]]],[11,"witness_script","","Computes the \\\"witness script\\\" of the descriptor, i.e. the…",18,[[],["script",3]]],[11,"satisfy","","Attempts to produce a satisfying witness and scriptSig to…",18,[[["txin",3]],[["error",4],["result",4]]]],[11,"max_satisfaction_weight","","Computes an upper bound on the weight of a satisfying…",18,[[]]],[11,"derive","","Derives all wildcard keys in the descriptor using the…",18,[[],[["descriptor",4],["descriptorpublickey",4]]]],[11,"parse_secret","","",18,[[],[["result",4],["error",4]]]],[11,"to_string_with_secret","","",18,[[["hashmap",3]],["string",3]]],[11,"from_ast","","Add type information(Type and Extdata) to Miniscript based…",19,[[["terminal",4]],[["result",4],["error",4],["miniscript",3]]]],[11,"into_inner","","Extracts the `AstElem` representing the root of the…",19,[[],["terminal",4]]],[11,"as_inner","","",19,[[],["terminal",4]]],[11,"parse","","Attempt to parse a script into a Miniscript representation",19,[[["script",3]],[["error",4],["miniscript",3],["result",4]]]],[11,"encode","","Encode as a Bitcoin script",19,[[],["script",3]]],[11,"script_size","","Size, in bytes of the script-pubkey. If this Miniscript is…",19,[[]]],[11,"max_satisfaction_witness_elements","","Maximum number of witness elements used to satisfy the…",19,[[]]],[11,"max_satisfaction_size","","Maximum size, in bytes, of a satisfying witness. For…",19,[[]]],[11,"translate_pk","","This will panic if translatefpk returns an uncompressed…",19,[[],[["result",4],["miniscript",3]]]],[11,"satisfy","","Attempt to produce a satisfying witness for the witness…",19,[[],[["option",4],["vec",3]]]],[11,"translate_pk","","Convert an AST element with one public key type to one of…",22,[[],[["result",4],["terminal",4]]]],[11,"encode","","Encode the element as a fragment of Bitcoin Script. The…",22,[[["builder",3]],["builder",3]]],[11,"script_size","","Size, in bytes of the script-pubkey. If this Miniscript is…",22,[[]]],[11,"max_dissatisfaction_witness_elements","","Maximum number of witness elements used to dissatisfy the…",22,[[],["option",4]]],[11,"max_dissatisfaction_size","","Maximum dissatisfaction cost, in bytes, of a Miniscript…",22,[[],["option",4]]],[11,"max_satisfaction_witness_elements","","Maximum number of witness elements used to satisfy the…",22,[[]]],[11,"max_satisfaction_size","","Maximum size, in bytes, of a satisfying witness. For…",22,[[]]]],"p":[[3,"UTXO"],[3,"TransactionDetails"],[4,"Error"],[13,"FeeRateTooLow"],[4,"ScriptType"],[4,"Capability"],[4,"EsploraError"],[3,"EsploraBlockchain"],[4,"CompactFiltersError"],[3,"Mempool"],[3,"Peer"],[3,"CompactFiltersBlockchain"],[8,"Blockchain"],[8,"Progress"],[3,"MemoryDatabase"],[8,"BatchOperations"],[8,"Database"],[8,"BatchDatabase"],[4,"Descriptor"],[3,"Miniscript"],[8,"MiniscriptKey"],[8,"ScriptContext"],[4,"Terminal"],[8,"ToPublicKey"],[4,"Error"],[3,"Policy"],[3,"Condition"],[4,"SatisfiableItem"],[13,"SHA256Preimage"],[13,"HASH256Preimage"],[13,"RIPEMD160Preimage"],[13,"HASH160Preimage"],[13,"AbsoluteTimelock"],[13,"RelativeTimelock"],[13,"Thresh"],[13,"Multisig"],[4,"Satisfaction"],[13,"Partial"],[13,"PartialComplete"],[13,"Complete"],[4,"PolicyError"],[8,"ExtractPolicy"],[3,"FeeRate"],[4,"AddressValidatorError"],[8,"AddressValidator"],[3,"CoinSelectionResult"],[8,"CoinSelectionAlgorithm"],[3,"WalletExport"],[3,"SignerOrdering"],[4,"SignerId"],[4,"SignerError"],[8,"Signer"],[3,"SignersContainer"],[4,"TxOrdering"],[4,"ChangeSpendPolicy"],[3,"TxBuilder"],[8,"IsDust"],[3,"Wallet"],[3,"OfflineBlockchain"],[3,"NoopProgress"],[3,"LogProgress"],[3,"ElectrumBlockchain"],[4,"Legacy"],[4,"Segwitv0"],[3,"PKOrF"],[3,"DumbCoinSelection"]]}\
+}');
+addSearchOptions(searchIndex);initSearch(searchIndex);
\ No newline at end of file
--- /dev/null
+.setting-line{padding:5px;position:relative;}.setting-line>div{max-width:calc(100% - 74px);display:inline-block;vertical-align:top;font-size:17px;padding-top:2px;}.setting-line>.title{font-size:19px;width:100%;max-width:none;border-bottom:1px solid;}.toggle{position:relative;display:inline-block;width:45px;height:27px;margin-right:20px;}.toggle input{display:none;}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.3s;transition:.3s;}.slider:before{position:absolute;content:"";height:19px;width:19px;left:4px;bottom:4px;background-color:white;-webkit-transition:.3s;transition:.3s;}input:checked+.slider{background-color:#2196F3;}input:focus+.slider{box-shadow:0 0 1px #2196F3;}input:checked+.slider:before{-webkit-transform:translateX(19px);-ms-transform:translateX(19px);transform:translateX(19px);}.setting-line>.sub-settings{padding-left:42px;width:100%;display:block;}
\ No newline at end of file
--- /dev/null
+<!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="Settings of Rustdoc"><meta name="keywords" content="rust, rustlang, rust-lang"><title>Rustdoc settings</title><link rel="stylesheet" type="text/css" href="./normalize.css"><link rel="stylesheet" type="text/css" href="./rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="./settings.css"><link rel="stylesheet" type="text/css" href="./dark.css"><link rel="stylesheet" type="text/css" href="./light.css" id="themeStyle"><script src="./storage.js"></script><noscript><link rel="stylesheet" href="./noscript.css"></noscript><link rel="shortcut icon" href="./favicon.ico"><style type="text/css">#crate-search{background-image:url("./down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='./bdk/index.html'><div class='logo-container'><img src='./rust-logo.png' alt='logo'></div></a><p class='location'>Settings</p><div class='sidebar-elems'></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="./brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="./theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="./settings.html"><img src="./wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Rustdoc settings</span></h1><div class='settings'><div class='setting-line'><div class='title'>Auto-hide item declarations</div><div class='sub-settings'><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-struct' checked><span class='slider'></span></label><div>Auto-hide structs declaration</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-enum' ><span class='slider'></span></label><div>Auto-hide enums declaration</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-union' checked><span class='slider'></span></label><div>Auto-hide unions declaration</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-trait' checked><span class='slider'></span></label><div>Auto-hide traits declaration</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-macro' ><span class='slider'></span></label><div>Auto-hide macros declaration</div></div></div>
+ </div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-attributes' checked><span class='slider'></span></label><div>Auto-hide item attributes.</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-method-docs' ><span class='slider'></span></label><div>Auto-hide item methods' documentation</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-trait-implementations' checked><span class='slider'></span></label><div>Auto-hide trait implementations documentation</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='go-to-only-result' ><span class='slider'></span></label><div>Directly go to item in search if there is only one result</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='line-numbers' ><span class='slider'></span></label><div>Show line numbers on code examples</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='disable-shortcuts' ><span class='slider'></span></label><div>Disable keyboard shortcuts</div></div></div><script src='./settings.js'></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "./";window.currentCrate = "bdk";</script><script src="./main.js"></script><script defer src="./search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+(function(){function changeSetting(settingName,isEnabled){updateLocalStorage('rustdoc-'+settingName,isEnabled)}function getSettingValue(settingName){return getCurrentValue('rustdoc-'+settingName)}function setEvents(){var elems=document.getElementsByClassName("slider");if(!elems||elems.length===0){return}for(var i=0;i<elems.length;++i){var toggle=elems[i].previousElementSibling;var settingId=toggle.id;var settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=function(){changeSetting(this.id,this.checked)}}}setEvents()})()
\ No newline at end of file
--- /dev/null
+var N = null;var sourcesIndex = {};
+sourcesIndex["bdk"] = {"name":"","dirs":[{"name":"blockchain","dirs":[{"name":"compact_filters","files":["mod.rs","peer.rs","store.rs","sync.rs"]}],"files":["electrum.rs","esplora.rs","mod.rs","utils.rs"]},{"name":"database","files":["keyvalue.rs","memory.rs","mod.rs"]},{"name":"descriptor","files":["checksum.rs","error.rs","mod.rs","policy.rs"]},{"name":"psbt","files":["mod.rs"]},{"name":"wallet","files":["address_validator.rs","coin_selection.rs","export.rs","mod.rs","rbf.rs","signer.rs","time.rs","tx_builder.rs","utils.rs"]}],"files":["error.rs","lib.rs","types.rs"]};
+createSourceSidebar();
--- /dev/null
+function getCurrentFilePath(){var parts=window.location.pathname.split("/");var rootPathParts=window.rootPath.split("/");for(var i=0;i<rootPathParts.length;++i){if(rootPathParts[i]===".."){parts.pop()}}var file=window.location.pathname.substring(parts.join("/").length);if(file.startsWith("/")){file=file.substring(1)}return file.substring(0,file.length-5)}function createDirEntry(elem,parent,fullPath,currentFile,hasFoundFile){var name=document.createElement("div");name.className="name";fullPath+=elem["name"]+"/";name.onclick=function(){if(hasClass(this,"expand")){removeClass(this,"expand")}else{addClass(this,"expand")}};name.innerText=elem["name"];var children=document.createElement("div");children.className="children";var folders=document.createElement("div");folders.className="folders";if(elem.dirs){for(var i=0;i<elem.dirs.length;++i){if(createDirEntry(elem.dirs[i],folders,fullPath,currentFile,hasFoundFile)===true){addClass(name,"expand");hasFoundFile=true}}}children.appendChild(folders);var files=document.createElement("div");files.className="files";if(elem.files){for(i=0;i<elem.files.length;++i){var file=document.createElement("a");file.innerText=elem.files[i];file.href=window.rootPath+"src/"+fullPath+elem.files[i]+".html";if(hasFoundFile===false&¤tFile===fullPath+elem.files[i]){file.className="selected";addClass(name,"expand");hasFoundFile=true}files.appendChild(file)}}search.fullPath=fullPath;children.appendChild(files);parent.appendChild(name);parent.appendChild(children);return hasFoundFile===true&¤tFile.startsWith(fullPath)}function toggleSidebar(){var sidebar=document.getElementById("source-sidebar");var child=this.children[0].children[0];if(child.innerText===">"){sidebar.style.left="";this.style.left="";child.innerText="<";updateLocalStorage("rustdoc-source-sidebar-show","true")}else{sidebar.style.left="-300px";this.style.left="0";child.innerText=">";updateLocalStorage("rustdoc-source-sidebar-show","false")}}function createSidebarToggle(){var sidebarToggle=document.createElement("div");sidebarToggle.id="sidebar-toggle";sidebarToggle.onclick=toggleSidebar;var inner1=document.createElement("div");inner1.style.position="relative";var inner2=document.createElement("div");inner2.style.paddingTop="3px";if(getCurrentValue("rustdoc-source-sidebar-show")==="true"){inner2.innerText="<"}else{inner2.innerText=">";sidebarToggle.style.left="0"}inner1.appendChild(inner2);sidebarToggle.appendChild(inner1);return sidebarToggle}function createSourceSidebar(){if(window.rootPath.endsWith("/")===false){window.rootPath+="/"}var main=document.getElementById("main");var sidebarToggle=createSidebarToggle();main.insertBefore(sidebarToggle,main.firstChild);var sidebar=document.createElement("div");sidebar.id="source-sidebar";if(getCurrentValue("rustdoc-source-sidebar-show")!=="true"){sidebar.style.left="-300px"}var currentFile=getCurrentFilePath();var hasFoundFile=false;var title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);Object.keys(sourcesIndex).forEach(function(key){sourcesIndex[key].name=key;hasFoundFile=createDirEntry(sourcesIndex[key],sidebar,"",currentFile,hasFoundFile)});main.insertBefore(sidebar,main.firstChild)}
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/blockchain/compact_filters/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../../bdk/index.html'><div class='logo-container'><img src='../../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+<span id="163">163</span>
+<span id="164">164</span>
+<span id="165">165</span>
+<span id="166">166</span>
+<span id="167">167</span>
+<span id="168">168</span>
+<span id="169">169</span>
+<span id="170">170</span>
+<span id="171">171</span>
+<span id="172">172</span>
+<span id="173">173</span>
+<span id="174">174</span>
+<span id="175">175</span>
+<span id="176">176</span>
+<span id="177">177</span>
+<span id="178">178</span>
+<span id="179">179</span>
+<span id="180">180</span>
+<span id="181">181</span>
+<span id="182">182</span>
+<span id="183">183</span>
+<span id="184">184</span>
+<span id="185">185</span>
+<span id="186">186</span>
+<span id="187">187</span>
+<span id="188">188</span>
+<span id="189">189</span>
+<span id="190">190</span>
+<span id="191">191</span>
+<span id="192">192</span>
+<span id="193">193</span>
+<span id="194">194</span>
+<span id="195">195</span>
+<span id="196">196</span>
+<span id="197">197</span>
+<span id="198">198</span>
+<span id="199">199</span>
+<span id="200">200</span>
+<span id="201">201</span>
+<span id="202">202</span>
+<span id="203">203</span>
+<span id="204">204</span>
+<span id="205">205</span>
+<span id="206">206</span>
+<span id="207">207</span>
+<span id="208">208</span>
+<span id="209">209</span>
+<span id="210">210</span>
+<span id="211">211</span>
+<span id="212">212</span>
+<span id="213">213</span>
+<span id="214">214</span>
+<span id="215">215</span>
+<span id="216">216</span>
+<span id="217">217</span>
+<span id="218">218</span>
+<span id="219">219</span>
+<span id="220">220</span>
+<span id="221">221</span>
+<span id="222">222</span>
+<span id="223">223</span>
+<span id="224">224</span>
+<span id="225">225</span>
+<span id="226">226</span>
+<span id="227">227</span>
+<span id="228">228</span>
+<span id="229">229</span>
+<span id="230">230</span>
+<span id="231">231</span>
+<span id="232">232</span>
+<span id="233">233</span>
+<span id="234">234</span>
+<span id="235">235</span>
+<span id="236">236</span>
+<span id="237">237</span>
+<span id="238">238</span>
+<span id="239">239</span>
+<span id="240">240</span>
+<span id="241">241</span>
+<span id="242">242</span>
+<span id="243">243</span>
+<span id="244">244</span>
+<span id="245">245</span>
+<span id="246">246</span>
+<span id="247">247</span>
+<span id="248">248</span>
+<span id="249">249</span>
+<span id="250">250</span>
+<span id="251">251</span>
+<span id="252">252</span>
+<span id="253">253</span>
+<span id="254">254</span>
+<span id="255">255</span>
+<span id="256">256</span>
+<span id="257">257</span>
+<span id="258">258</span>
+<span id="259">259</span>
+<span id="260">260</span>
+<span id="261">261</span>
+<span id="262">262</span>
+<span id="263">263</span>
+<span id="264">264</span>
+<span id="265">265</span>
+<span id="266">266</span>
+<span id="267">267</span>
+<span id="268">268</span>
+<span id="269">269</span>
+<span id="270">270</span>
+<span id="271">271</span>
+<span id="272">272</span>
+<span id="273">273</span>
+<span id="274">274</span>
+<span id="275">275</span>
+<span id="276">276</span>
+<span id="277">277</span>
+<span id="278">278</span>
+<span id="279">279</span>
+<span id="280">280</span>
+<span id="281">281</span>
+<span id="282">282</span>
+<span id="283">283</span>
+<span id="284">284</span>
+<span id="285">285</span>
+<span id="286">286</span>
+<span id="287">287</span>
+<span id="288">288</span>
+<span id="289">289</span>
+<span id="290">290</span>
+<span id="291">291</span>
+<span id="292">292</span>
+<span id="293">293</span>
+<span id="294">294</span>
+<span id="295">295</span>
+<span id="296">296</span>
+<span id="297">297</span>
+<span id="298">298</span>
+<span id="299">299</span>
+<span id="300">300</span>
+<span id="301">301</span>
+<span id="302">302</span>
+<span id="303">303</span>
+<span id="304">304</span>
+<span id="305">305</span>
+<span id="306">306</span>
+<span id="307">307</span>
+<span id="308">308</span>
+<span id="309">309</span>
+<span id="310">310</span>
+<span id="311">311</span>
+<span id="312">312</span>
+<span id="313">313</span>
+<span id="314">314</span>
+<span id="315">315</span>
+<span id="316">316</span>
+<span id="317">317</span>
+<span id="318">318</span>
+<span id="319">319</span>
+<span id="320">320</span>
+<span id="321">321</span>
+<span id="322">322</span>
+<span id="323">323</span>
+<span id="324">324</span>
+<span id="325">325</span>
+<span id="326">326</span>
+<span id="327">327</span>
+<span id="328">328</span>
+<span id="329">329</span>
+<span id="330">330</span>
+<span id="331">331</span>
+<span id="332">332</span>
+<span id="333">333</span>
+<span id="334">334</span>
+<span id="335">335</span>
+<span id="336">336</span>
+<span id="337">337</span>
+<span id="338">338</span>
+<span id="339">339</span>
+<span id="340">340</span>
+<span id="341">341</span>
+<span id="342">342</span>
+<span id="343">343</span>
+<span id="344">344</span>
+<span id="345">345</span>
+<span id="346">346</span>
+<span id="347">347</span>
+<span id="348">348</span>
+<span id="349">349</span>
+<span id="350">350</span>
+<span id="351">351</span>
+<span id="352">352</span>
+<span id="353">353</span>
+<span id="354">354</span>
+<span id="355">355</span>
+<span id="356">356</span>
+<span id="357">357</span>
+<span id="358">358</span>
+<span id="359">359</span>
+<span id="360">360</span>
+<span id="361">361</span>
+<span id="362">362</span>
+<span id="363">363</span>
+<span id="364">364</span>
+<span id="365">365</span>
+<span id="366">366</span>
+<span id="367">367</span>
+<span id="368">368</span>
+<span id="369">369</span>
+<span id="370">370</span>
+<span id="371">371</span>
+<span id="372">372</span>
+<span id="373">373</span>
+<span id="374">374</span>
+<span id="375">375</span>
+<span id="376">376</span>
+<span id="377">377</span>
+<span id="378">378</span>
+<span id="379">379</span>
+<span id="380">380</span>
+<span id="381">381</span>
+<span id="382">382</span>
+<span id="383">383</span>
+<span id="384">384</span>
+<span id="385">385</span>
+<span id="386">386</span>
+<span id="387">387</span>
+<span id="388">388</span>
+<span id="389">389</span>
+<span id="390">390</span>
+<span id="391">391</span>
+<span id="392">392</span>
+<span id="393">393</span>
+<span id="394">394</span>
+<span id="395">395</span>
+<span id="396">396</span>
+<span id="397">397</span>
+<span id="398">398</span>
+<span id="399">399</span>
+<span id="400">400</span>
+<span id="401">401</span>
+<span id="402">402</span>
+<span id="403">403</span>
+<span id="404">404</span>
+<span id="405">405</span>
+<span id="406">406</span>
+<span id="407">407</span>
+<span id="408">408</span>
+<span id="409">409</span>
+<span id="410">410</span>
+<span id="411">411</span>
+<span id="412">412</span>
+<span id="413">413</span>
+<span id="414">414</span>
+<span id="415">415</span>
+<span id="416">416</span>
+<span id="417">417</span>
+<span id="418">418</span>
+<span id="419">419</span>
+<span id="420">420</span>
+<span id="421">421</span>
+<span id="422">422</span>
+<span id="423">423</span>
+<span id="424">424</span>
+<span id="425">425</span>
+<span id="426">426</span>
+<span id="427">427</span>
+<span id="428">428</span>
+<span id="429">429</span>
+<span id="430">430</span>
+<span id="431">431</span>
+<span id="432">432</span>
+<span id="433">433</span>
+<span id="434">434</span>
+<span id="435">435</span>
+<span id="436">436</span>
+<span id="437">437</span>
+<span id="438">438</span>
+<span id="439">439</span>
+<span id="440">440</span>
+<span id="441">441</span>
+<span id="442">442</span>
+<span id="443">443</span>
+<span id="444">444</span>
+<span id="445">445</span>
+<span id="446">446</span>
+<span id="447">447</span>
+<span id="448">448</span>
+<span id="449">449</span>
+<span id="450">450</span>
+<span id="451">451</span>
+<span id="452">452</span>
+<span id="453">453</span>
+<span id="454">454</span>
+<span id="455">455</span>
+<span id="456">456</span>
+<span id="457">457</span>
+<span id="458">458</span>
+<span id="459">459</span>
+<span id="460">460</span>
+<span id="461">461</span>
+<span id="462">462</span>
+<span id="463">463</span>
+<span id="464">464</span>
+<span id="465">465</span>
+<span id="466">466</span>
+<span id="467">467</span>
+<span id="468">468</span>
+<span id="469">469</span>
+<span id="470">470</span>
+<span id="471">471</span>
+<span id="472">472</span>
+<span id="473">473</span>
+<span id="474">474</span>
+<span id="475">475</span>
+<span id="476">476</span>
+<span id="477">477</span>
+<span id="478">478</span>
+<span id="479">479</span>
+<span id="480">480</span>
+<span id="481">481</span>
+<span id="482">482</span>
+<span id="483">483</span>
+<span id="484">484</span>
+<span id="485">485</span>
+<span id="486">486</span>
+<span id="487">487</span>
+<span id="488">488</span>
+<span id="489">489</span>
+<span id="490">490</span>
+<span id="491">491</span>
+<span id="492">492</span>
+<span id="493">493</span>
+<span id="494">494</span>
+<span id="495">495</span>
+<span id="496">496</span>
+<span id="497">497</span>
+<span id="498">498</span>
+<span id="499">499</span>
+<span id="500">500</span>
+<span id="501">501</span>
+<span id="502">502</span>
+<span id="503">503</span>
+<span id="504">504</span>
+<span id="505">505</span>
+<span id="506">506</span>
+<span id="507">507</span>
+<span id="508">508</span>
+<span id="509">509</span>
+<span id="510">510</span>
+<span id="511">511</span>
+<span id="512">512</span>
+<span id="513">513</span>
+<span id="514">514</span>
+<span id="515">515</span>
+<span id="516">516</span>
+<span id="517">517</span>
+<span id="518">518</span>
+<span id="519">519</span>
+<span id="520">520</span>
+<span id="521">521</span>
+<span id="522">522</span>
+<span id="523">523</span>
+<span id="524">524</span>
+<span id="525">525</span>
+<span id="526">526</span>
+<span id="527">527</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="doccomment">//! Compact Filters</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! This module contains a multithreaded implementation of an [`Blockchain`] backend that</span>
+<span class="doccomment">//! uses BIP157 (aka "Neutrino") to populate the wallet's [database](crate::database::Database)</span>
+<span class="doccomment">//! by downloading compact filters from the P2P network.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! Since there are currently very few peers "in the wild" that advertise the required service</span>
+<span class="doccomment">//! flag, this implementation requires that one or more known peers are provided by the user.</span>
+<span class="doccomment">//! No dns or other kinds of peer discovery are done internally.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! Moreover, this module doesn't currently support detecting and resolving conflicts between</span>
+<span class="doccomment">//! messages received by different peers. Thus, it's recommended to use this module by only</span>
+<span class="doccomment">//! connecting to a single peer at a time, optionally by opening multiple connections if it's</span>
+<span class="doccomment">//! desirable to use multiple threads at once to sync in parallel.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ## Example</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ```no_run</span>
+<span class="doccomment">//! # use std::sync::Arc;</span>
+<span class="doccomment">//! # use bitcoin::*;</span>
+<span class="doccomment">//! # use bdk::*;</span>
+<span class="doccomment">//! # use bdk::blockchain::compact_filters::*;</span>
+<span class="doccomment">//! let num_threads = 4;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! let mempool = Arc::new(Mempool::default());</span>
+<span class="doccomment">//! let peers = (0..num_threads)</span>
+<span class="doccomment">//! .map(|_| Peer::connect(</span>
+<span class="doccomment">//! "btcd-mainnet.lightning.computer:8333",</span>
+<span class="doccomment">//! Arc::clone(&mempool),</span>
+<span class="doccomment">//! Network::Bitcoin,</span>
+<span class="doccomment">//! ))</span>
+<span class="doccomment">//! .collect::<Result<_, _>>()?;</span>
+<span class="doccomment">//! let blockchain = CompactFiltersBlockchain::new(peers, "./wallet-filters", Some(500_000))?;</span>
+<span class="doccomment">//! # Ok::<(), bdk::error::Error>(())</span>
+<span class="doccomment">//! ```</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashSet</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">atomic</span>::{<span class="ident">AtomicUsize</span>, <span class="ident">Ordering</span>};
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::{<span class="ident">Arc</span>, <span class="ident">Mutex</span>};
+
+<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_imports</span>)]</span>
+<span class="kw">use</span> <span class="ident">log</span>::{<span class="ident">debug</span>, <span class="ident">error</span>, <span class="ident">info</span>, <span class="ident">trace</span>};
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">message_blockdata</span>::<span class="ident">Inventory</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">OutPoint</span>, <span class="ident">Transaction</span>, <span class="ident">Txid</span>};
+
+<span class="kw">use</span> <span class="ident">rocksdb</span>::{<span class="ident">Options</span>, <span class="ident">SliceTransform</span>, <span class="ident">DB</span>};
+
+<span class="kw">mod</span> <span class="ident">peer</span>;
+<span class="kw">mod</span> <span class="ident">store</span>;
+<span class="kw">mod</span> <span class="ident">sync</span>;
+
+<span class="kw">use</span> <span class="kw">super</span>::{<span class="ident">Blockchain</span>, <span class="ident">Capability</span>, <span class="ident">Progress</span>};
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::{<span class="ident">BatchDatabase</span>, <span class="ident">BatchOperations</span>, <span class="ident">DatabaseUtils</span>};
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::{<span class="ident">ScriptType</span>, <span class="ident">TransactionDetails</span>, <span class="ident">UTXO</span>};
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">FeeRate</span>;
+
+<span class="kw">use</span> <span class="ident">peer</span>::<span class="kw-2">*</span>;
+<span class="kw">use</span> <span class="ident">store</span>::<span class="kw-2">*</span>;
+<span class="kw">use</span> <span class="ident">sync</span>::<span class="kw-2">*</span>;
+
+<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">peer</span>::{<span class="ident">Mempool</span>, <span class="ident">Peer</span>};
+
+<span class="kw">const</span> <span class="ident">SYNC_HEADERS_COST</span>: <span class="ident">f32</span> <span class="op">=</span> <span class="number">1.0</span>;
+<span class="kw">const</span> <span class="ident">SYNC_FILTERS_COST</span>: <span class="ident">f32</span> <span class="op">=</span> <span class="number">11.6</span> <span class="op">*</span> <span class="number">1_000.0</span>;
+<span class="kw">const</span> <span class="ident">PROCESS_BLOCKS_COST</span>: <span class="ident">f32</span> <span class="op">=</span> <span class="number">20_000.0</span>;
+
+<span class="doccomment">/// Structure implementing the required blockchain traits</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ## Example</span>
+<span class="doccomment">/// See the [`blockchain::compact_filters`](crate::blockchain::compact_filters) module for a usage example.</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">CompactFiltersBlockchain</span> {
+ <span class="ident">peers</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Arc</span><span class="op"><</span><span class="ident">Peer</span><span class="op">></span><span class="op">></span>,
+ <span class="ident">headers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Full</span><span class="op">></span><span class="op">></span>,
+ <span class="ident">skip_blocks</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
+}
+
+<span class="kw">impl</span> <span class="ident">CompactFiltersBlockchain</span> {
+ <span class="doccomment">/// Construct a new instance given a list of peers, a path to store headers and block</span>
+ <span class="doccomment">/// filters downloaded during the sync and optionally a number of blocks to ignore starting</span>
+ <span class="doccomment">/// from the genesis while scanning for the wallet's outputs.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// For each [`Peer`] specified a new thread will be spawned to download and verify the filters</span>
+ <span class="doccomment">/// in parallel. It's currently recommended to only connect to a single peer to avoid</span>
+ <span class="doccomment">/// inconsistencies in the data returned, optionally with multiple connections in parallel to</span>
+ <span class="doccomment">/// speed-up the sync process.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span><span class="op"><</span><span class="ident">P</span>: <span class="ident">AsRef</span><span class="op"><</span><span class="ident">Path</span><span class="op">></span><span class="op">></span>(
+ <span class="ident">peers</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Peer</span><span class="op">></span>,
+ <span class="ident">storage_dir</span>: <span class="ident">P</span>,
+ <span class="ident">skip_blocks</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="ident">peers</span>.<span class="ident">is_empty</span>() {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">NoPeers</span>);
+ }
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">opts</span> <span class="op">=</span> <span class="ident">Options</span>::<span class="ident">default</span>();
+ <span class="ident">opts</span>.<span class="ident">create_if_missing</span>(<span class="bool-val">true</span>);
+ <span class="ident">opts</span>.<span class="ident">set_prefix_extractor</span>(<span class="ident">SliceTransform</span>::<span class="ident">create_fixed_prefix</span>(<span class="number">16</span>));
+
+ <span class="kw">let</span> <span class="ident">network</span> <span class="op">=</span> <span class="ident">peers</span>[<span class="number">0</span>].<span class="ident">get_network</span>();
+
+ <span class="kw">let</span> <span class="ident">cfs</span> <span class="op">=</span> <span class="ident">DB</span>::<span class="ident">list_cf</span>(<span class="kw-2">&</span><span class="ident">opts</span>, <span class="kw-2">&</span><span class="ident">storage_dir</span>).<span class="ident">unwrap_or</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="string">"default"</span>.<span class="ident">to_string</span>()]);
+ <span class="kw">let</span> <span class="ident">db</span> <span class="op">=</span> <span class="ident">DB</span>::<span class="ident">open_cf</span>(<span class="kw-2">&</span><span class="ident">opts</span>, <span class="kw-2">&</span><span class="ident">storage_dir</span>, <span class="kw-2">&</span><span class="ident">cfs</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">headers</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">ChainStore</span>::<span class="ident">new</span>(<span class="ident">db</span>, <span class="ident">network</span>)<span class="question-mark">?</span>);
+
+ <span class="comment">// try to recover partial snapshots</span>
+ <span class="kw">for</span> <span class="ident">cf_name</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">cfs</span> {
+ <span class="kw">if</span> <span class="op">!</span><span class="ident">cf_name</span>.<span class="ident">starts_with</span>(<span class="string">"_headers:"</span>) {
+ <span class="kw">continue</span>;
+ }
+
+ <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Trying to recover: {:?}"</span>, <span class="ident">cf_name</span>);
+ <span class="ident">headers</span>.<span class="ident">recover_snapshot</span>(<span class="ident">cf_name</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">CompactFiltersBlockchain</span> {
+ <span class="ident">peers</span>: <span class="ident">peers</span>.<span class="ident">into_iter</span>().<span class="ident">map</span>(<span class="ident">Arc</span>::<span class="ident">new</span>).<span class="ident">collect</span>(),
+ <span class="ident">headers</span>,
+ <span class="ident">skip_blocks</span>,
+ })
+ }
+
+ <span class="doccomment">/// Process a transaction by looking for inputs that spend from a UTXO in the database or</span>
+ <span class="doccomment">/// outputs that send funds to a know script_pubkey.</span>
+ <span class="kw">fn</span> <span class="ident">process_tx</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
+ <span class="ident">tx</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>,
+ <span class="ident">height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+ <span class="ident">timestamp</span>: <span class="ident">u64</span>,
+ <span class="ident">internal_max_deriv</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+ <span class="ident">external_max_deriv</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">updates</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">begin_batch</span>();
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">incoming</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">outgoing</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">inputs_sum</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">outputs_sum</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
+
+ <span class="comment">// look for our own inputs</span>
+ <span class="kw">for</span> (<span class="ident">i</span>, <span class="ident">input</span>) <span class="kw">in</span> <span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">previous_output</span>) <span class="op">=</span> <span class="ident">database</span>.<span class="ident">get_previous_output</span>(<span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">previous_output</span>)<span class="question-mark">?</span> {
+ <span class="ident">inputs_sum</span> <span class="op">+</span><span class="op">=</span> <span class="ident">previous_output</span>.<span class="ident">value</span>;
+
+ <span class="kw">if</span> <span class="ident">database</span>.<span class="ident">is_mine</span>(<span class="kw-2">&</span><span class="ident">previous_output</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span> {
+ <span class="ident">outgoing</span> <span class="op">+</span><span class="op">=</span> <span class="ident">previous_output</span>.<span class="ident">value</span>;
+
+ <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"{} input #{} is mine, removing from utxo"</span>, <span class="ident">tx</span>.<span class="ident">txid</span>(), <span class="ident">i</span>);
+ <span class="ident">updates</span>.<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">previous_output</span>)<span class="question-mark">?</span>;
+ }
+ }
+ }
+
+ <span class="kw">for</span> (<span class="ident">i</span>, <span class="ident">output</span>) <span class="kw">in</span> <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
+ <span class="comment">// to compute the fees later</span>
+ <span class="ident">outputs_sum</span> <span class="op">+</span><span class="op">=</span> <span class="ident">output</span>.<span class="ident">value</span>;
+
+ <span class="comment">// this output is ours, we have a path to derive it</span>
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">script_type</span>, <span class="ident">child</span>)) <span class="op">=</span>
+ <span class="ident">database</span>.<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">output</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span>
+ {
+ <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"{} output #{} is mine, adding utxo"</span>, <span class="ident">tx</span>.<span class="ident">txid</span>(), <span class="ident">i</span>);
+ <span class="ident">updates</span>.<span class="ident">set_utxo</span>(<span class="kw-2">&</span><span class="ident">UTXO</span> {
+ <span class="ident">outpoint</span>: <span class="ident">OutPoint</span>::<span class="ident">new</span>(<span class="ident">tx</span>.<span class="ident">txid</span>(), <span class="ident">i</span> <span class="kw">as</span> <span class="ident">u32</span>),
+ <span class="ident">txout</span>: <span class="ident">output</span>.<span class="ident">clone</span>(),
+ <span class="ident">is_internal</span>: <span class="ident">script_type</span>.<span class="ident">is_internal</span>(),
+ })<span class="question-mark">?</span>;
+ <span class="ident">incoming</span> <span class="op">+</span><span class="op">=</span> <span class="ident">output</span>.<span class="ident">value</span>;
+
+ <span class="kw">if</span> <span class="ident">script_type</span> <span class="op">=</span><span class="op">=</span> <span class="ident">ScriptType</span>::<span class="ident">Internal</span>
+ <span class="kw-2">&</span><span class="op">&</span> (<span class="ident">internal_max_deriv</span>.<span class="ident">is_none</span>() <span class="op">|</span><span class="op">|</span> <span class="ident">child</span> <span class="op">></span> <span class="ident">internal_max_deriv</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>))
+ {
+ <span class="kw-2">*</span><span class="ident">internal_max_deriv</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">child</span>);
+ } <span class="kw">else</span> <span class="kw">if</span> <span class="ident">script_type</span> <span class="op">=</span><span class="op">=</span> <span class="ident">ScriptType</span>::<span class="ident">External</span>
+ <span class="kw-2">&</span><span class="op">&</span> (<span class="ident">external_max_deriv</span>.<span class="ident">is_none</span>() <span class="op">|</span><span class="op">|</span> <span class="ident">child</span> <span class="op">></span> <span class="ident">external_max_deriv</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>))
+ {
+ <span class="kw-2">*</span><span class="ident">external_max_deriv</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">child</span>);
+ }
+ }
+ }
+
+ <span class="kw">if</span> <span class="ident">incoming</span> <span class="op">></span> <span class="number">0</span> <span class="op">|</span><span class="op">|</span> <span class="ident">outgoing</span> <span class="op">></span> <span class="number">0</span> {
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">TransactionDetails</span> {
+ <span class="ident">txid</span>: <span class="ident">tx</span>.<span class="ident">txid</span>(),
+ <span class="ident">transaction</span>: <span class="prelude-val">Some</span>(<span class="ident">tx</span>.<span class="ident">clone</span>()),
+ <span class="ident">received</span>: <span class="ident">incoming</span>,
+ <span class="ident">sent</span>: <span class="ident">outgoing</span>,
+ <span class="ident">height</span>,
+ <span class="ident">timestamp</span>,
+ <span class="ident">fees</span>: <span class="ident">inputs_sum</span>.<span class="ident">checked_sub</span>(<span class="ident">outputs_sum</span>).<span class="ident">unwrap_or</span>(<span class="number">0</span>),
+ };
+
+ <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Saving tx {}"</span>, <span class="ident">tx</span>.<span class="ident">txid</span>);
+ <span class="ident">updates</span>.<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">tx</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="ident">database</span>.<span class="ident">commit_batch</span>(<span class="ident">updates</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">Blockchain</span> <span class="kw">for</span> <span class="ident">CompactFiltersBlockchain</span> {
+ <span class="kw">fn</span> <span class="ident">get_capabilities</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Capability</span><span class="op">></span> {
+ <span class="macro">vec</span><span class="macro">!</span>[<span class="ident">Capability</span>::<span class="ident">FullHistory</span>].<span class="ident">into_iter</span>().<span class="ident">collect</span>()
+ }
+
+ <span class="kw">fn</span> <span class="ident">setup</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span>, <span class="ident">P</span>: <span class="lifetime">'static</span> <span class="op">+</span> <span class="ident">Progress</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">_stop_gap</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>, <span class="comment">// TODO: move to electrum and esplora only</span>
+ <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
+ <span class="ident">progress_update</span>: <span class="ident">P</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">first_peer</span> <span class="op">=</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">peers</span>[<span class="number">0</span>];
+
+ <span class="kw">let</span> <span class="ident">skip_blocks</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">skip_blocks</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>);
+
+ <span class="kw">let</span> <span class="ident">cf_sync</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">CFSync</span>::<span class="ident">new</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">headers</span>), <span class="ident">skip_blocks</span>, <span class="number">0x00</span>)<span class="question-mark">?</span>);
+
+ <span class="kw">let</span> <span class="ident">initial_height</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">headers</span>.<span class="ident">get_height</span>()<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">total_bundles</span> <span class="op">=</span> (<span class="ident">first_peer</span>.<span class="ident">get_version</span>().<span class="ident">start_height</span> <span class="kw">as</span> <span class="ident">usize</span>)
+ .<span class="ident">checked_sub</span>(<span class="ident">skip_blocks</span>)
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">/</span> <span class="number">1000</span>)
+ .<span class="ident">unwrap_or</span>(<span class="number">0</span>)
+ <span class="op">+</span> <span class="number">1</span>;
+ <span class="kw">let</span> <span class="ident">expected_bundles_to_sync</span> <span class="op">=</span> <span class="ident">total_bundles</span>
+ .<span class="ident">checked_sub</span>(<span class="ident">cf_sync</span>.<span class="ident">pruned_bundles</span>()<span class="question-mark">?</span>)
+ .<span class="ident">unwrap_or</span>(<span class="number">0</span>);
+
+ <span class="kw">let</span> <span class="ident">headers_cost</span> <span class="op">=</span> (<span class="ident">first_peer</span>.<span class="ident">get_version</span>().<span class="ident">start_height</span> <span class="kw">as</span> <span class="ident">usize</span>)
+ .<span class="ident">checked_sub</span>(<span class="ident">initial_height</span>)
+ .<span class="ident">unwrap_or</span>(<span class="number">0</span>) <span class="kw">as</span> <span class="ident">f32</span>
+ <span class="op">*</span> <span class="ident">SYNC_HEADERS_COST</span>;
+ <span class="kw">let</span> <span class="ident">filters_cost</span> <span class="op">=</span> <span class="ident">expected_bundles_to_sync</span> <span class="kw">as</span> <span class="ident">f32</span> <span class="op">*</span> <span class="ident">SYNC_FILTERS_COST</span>;
+
+ <span class="kw">let</span> <span class="ident">total_cost</span> <span class="op">=</span> <span class="ident">headers_cost</span> <span class="op">+</span> <span class="ident">filters_cost</span> <span class="op">+</span> <span class="ident">PROCESS_BLOCKS_COST</span>;
+
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">snapshot</span>) <span class="op">=</span> <span class="ident">sync</span>::<span class="ident">sync_headers</span>(
+ <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">first_peer</span>),
+ <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">headers</span>),
+ <span class="op">|</span><span class="ident">new_height</span><span class="op">|</span> {
+ <span class="kw">let</span> <span class="ident">local_headers_cost</span> <span class="op">=</span>
+ <span class="ident">new_height</span>.<span class="ident">checked_sub</span>(<span class="ident">initial_height</span>).<span class="ident">unwrap_or</span>(<span class="number">0</span>) <span class="kw">as</span> <span class="ident">f32</span> <span class="op">*</span> <span class="ident">SYNC_HEADERS_COST</span>;
+ <span class="ident">progress_update</span>.<span class="ident">update</span>(
+ <span class="ident">local_headers_cost</span> <span class="op">/</span> <span class="ident">total_cost</span> <span class="op">*</span> <span class="number">100.0</span>,
+ <span class="prelude-val">Some</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"Synced headers to {}"</span>, <span class="ident">new_height</span>)),
+ )
+ },
+ )<span class="question-mark">?</span> {
+ <span class="kw">if</span> <span class="ident">snapshot</span>.<span class="ident">work</span>()<span class="question-mark">?</span> <span class="op">></span> <span class="self">self</span>.<span class="ident">headers</span>.<span class="ident">work</span>()<span class="question-mark">?</span> {
+ <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Applying snapshot with work: {}"</span>, <span class="ident">snapshot</span>.<span class="ident">work</span>()<span class="question-mark">?</span>);
+ <span class="self">self</span>.<span class="ident">headers</span>.<span class="ident">apply_snapshot</span>(<span class="ident">snapshot</span>)<span class="question-mark">?</span>;
+ }
+ }
+
+ <span class="kw">let</span> <span class="ident">synced_height</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">headers</span>.<span class="ident">get_height</span>()<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">buried_height</span> <span class="op">=</span> <span class="ident">synced_height</span>
+ .<span class="ident">checked_sub</span>(<span class="ident">sync</span>::<span class="ident">BURIED_CONFIRMATIONS</span>)
+ .<span class="ident">unwrap_or</span>(<span class="number">0</span>);
+ <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Synced headers to height: {}"</span>, <span class="ident">synced_height</span>);
+
+ <span class="ident">cf_sync</span>.<span class="ident">prepare_sync</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">first_peer</span>))<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="ident">all_scripts</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(
+ <span class="ident">database</span>
+ .<span class="ident">iter_script_pubkeys</span>(<span class="prelude-val">None</span>)<span class="question-mark">?</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">s</span><span class="op">|</span> <span class="ident">s</span>.<span class="ident">to_bytes</span>())
+ .<span class="ident">collect</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span><span class="op">></span>(),
+ );
+
+ <span class="kw">let</span> <span class="ident">last_synced_block</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Mutex</span>::<span class="ident">new</span>(<span class="ident">synced_height</span>));
+ <span class="kw">let</span> <span class="ident">synced_bundles</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">AtomicUsize</span>::<span class="ident">new</span>(<span class="number">0</span>));
+ <span class="kw">let</span> <span class="ident">progress_update</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Mutex</span>::<span class="ident">new</span>(<span class="ident">progress_update</span>));
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">threads</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="self">self</span>.<span class="ident">peers</span>.<span class="ident">len</span>());
+ <span class="kw">for</span> <span class="ident">peer</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">peers</span> {
+ <span class="kw">let</span> <span class="ident">cf_sync</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">cf_sync</span>);
+ <span class="kw">let</span> <span class="ident">peer</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">peer</span>);
+ <span class="kw">let</span> <span class="ident">headers</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">headers</span>);
+ <span class="kw">let</span> <span class="ident">all_scripts</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">all_scripts</span>);
+ <span class="kw">let</span> <span class="ident">last_synced_block</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">last_synced_block</span>);
+ <span class="kw">let</span> <span class="ident">progress_update</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">progress_update</span>);
+ <span class="kw">let</span> <span class="ident">synced_bundles</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">synced_bundles</span>);
+
+ <span class="kw">let</span> <span class="ident">thread</span> <span class="op">=</span> <span class="ident">std</span>::<span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="kw">move</span> <span class="op">|</span><span class="op">|</span> {
+ <span class="ident">cf_sync</span>.<span class="ident">capture_thread_for_sync</span>(
+ <span class="ident">peer</span>,
+ <span class="op">|</span><span class="ident">block_hash</span>, <span class="ident">filter</span><span class="op">|</span> {
+ <span class="kw">if</span> <span class="op">!</span><span class="ident">filter</span>
+ .<span class="ident">match_any</span>(<span class="ident">block_hash</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">all_scripts</span>.<span class="ident">iter</span>().<span class="ident">map</span>(<span class="ident">AsRef</span>::<span class="ident">as_ref</span>))<span class="question-mark">?</span>
+ {
+ <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="bool-val">false</span>);
+ }
+
+ <span class="kw">let</span> <span class="ident">block_height</span> <span class="op">=</span> <span class="ident">headers</span>.<span class="ident">get_height_for</span>(<span class="ident">block_hash</span>)<span class="question-mark">?</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>);
+ <span class="kw">let</span> <span class="ident">saved_correct_block</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">headers</span>.<span class="ident">get_full_block</span>(<span class="ident">block_height</span>)<span class="question-mark">?</span> {
+ <span class="prelude-val">Some</span>(<span class="ident">block</span>) <span class="kw">if</span> <span class="kw-2">&</span><span class="ident">block</span>.<span class="ident">block_hash</span>() <span class="op">=</span><span class="op">=</span> <span class="ident">block_hash</span> <span class="op">=</span><span class="op">></span> <span class="bool-val">true</span>,
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="bool-val">false</span>,
+ };
+
+ <span class="kw">if</span> <span class="ident">saved_correct_block</span> {
+ <span class="prelude-val">Ok</span>(<span class="bool-val">false</span>)
+ } <span class="kw">else</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">last_synced_block</span> <span class="op">=</span> <span class="ident">last_synced_block</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
+
+ <span class="comment">// If we download a block older than `last_synced_block`, we update it so that</span>
+ <span class="comment">// we know to delete and re-process all txs starting from that height</span>
+ <span class="kw">if</span> <span class="ident">block_height</span> <span class="op"><</span> <span class="kw-2">*</span><span class="ident">last_synced_block</span> {
+ <span class="kw-2">*</span><span class="ident">last_synced_block</span> <span class="op">=</span> <span class="ident">block_height</span>;
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="bool-val">true</span>)
+ }
+ },
+ <span class="op">|</span><span class="ident">index</span><span class="op">|</span> {
+ <span class="kw">let</span> <span class="ident">synced_bundles</span> <span class="op">=</span> <span class="ident">synced_bundles</span>.<span class="ident">fetch_add</span>(<span class="number">1</span>, <span class="ident">Ordering</span>::<span class="ident">SeqCst</span>);
+ <span class="kw">let</span> <span class="ident">local_filters_cost</span> <span class="op">=</span> <span class="ident">synced_bundles</span> <span class="kw">as</span> <span class="ident">f32</span> <span class="op">*</span> <span class="ident">SYNC_FILTERS_COST</span>;
+ <span class="ident">progress_update</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>().<span class="ident">update</span>(
+ (<span class="ident">headers_cost</span> <span class="op">+</span> <span class="ident">local_filters_cost</span>) <span class="op">/</span> <span class="ident">total_cost</span> <span class="op">*</span> <span class="number">100.0</span>,
+ <span class="prelude-val">Some</span>(<span class="macro">format</span><span class="macro">!</span>(
+ <span class="string">"Synced filters {} - {}"</span>,
+ <span class="ident">index</span> <span class="op">*</span> <span class="number">1000</span> <span class="op">+</span> <span class="number">1</span>,
+ (<span class="ident">index</span> <span class="op">+</span> <span class="number">1</span>) <span class="op">*</span> <span class="number">1000</span>
+ )),
+ )
+ },
+ )
+ });
+
+ <span class="ident">threads</span>.<span class="ident">push</span>(<span class="ident">thread</span>);
+ }
+
+ <span class="kw">for</span> <span class="ident">t</span> <span class="kw">in</span> <span class="ident">threads</span> {
+ <span class="ident">t</span>.<span class="ident">join</span>().<span class="ident">unwrap</span>()<span class="question-mark">?</span>;
+ }
+
+ <span class="ident">progress_update</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>().<span class="ident">update</span>(
+ (<span class="ident">headers_cost</span> <span class="op">+</span> <span class="ident">filters_cost</span>) <span class="op">/</span> <span class="ident">total_cost</span> <span class="op">*</span> <span class="number">100.0</span>,
+ <span class="prelude-val">Some</span>(<span class="string">"Processing downloaded blocks and mempool"</span>.<span class="ident">into</span>()),
+ )<span class="question-mark">?</span>;
+
+ <span class="comment">// delete all txs newer than last_synced_block</span>
+ <span class="kw">let</span> <span class="ident">last_synced_block</span> <span class="op">=</span> <span class="kw-2">*</span><span class="ident">last_synced_block</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
+ <span class="ident">log</span>::<span class="macro">debug</span><span class="macro">!</span>(
+ <span class="string">"Dropping transactions newer than `last_synced_block` = {}"</span>,
+ <span class="ident">last_synced_block</span>
+ );
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">updates</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">begin_batch</span>();
+ <span class="kw">for</span> <span class="ident">details</span> <span class="kw">in</span> <span class="ident">database</span>.<span class="ident">iter_txs</span>(<span class="bool-val">false</span>)<span class="question-mark">?</span> {
+ <span class="kw">match</span> <span class="ident">details</span>.<span class="ident">height</span> {
+ <span class="prelude-val">Some</span>(<span class="ident">height</span>) <span class="kw">if</span> (<span class="ident">height</span> <span class="kw">as</span> <span class="ident">usize</span>) <span class="op"><</span> <span class="ident">last_synced_block</span> <span class="op">=</span><span class="op">></span> <span class="kw">continue</span>,
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="ident">updates</span>.<span class="ident">del_tx</span>(<span class="kw-2">&</span><span class="ident">details</span>.<span class="ident">txid</span>, <span class="bool-val">false</span>)<span class="question-mark">?</span>,
+ };
+ }
+ <span class="ident">database</span>.<span class="ident">commit_batch</span>(<span class="ident">updates</span>)<span class="question-mark">?</span>;
+
+ <span class="ident">first_peer</span>.<span class="ident">ask_for_mempool</span>()<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">internal_max_deriv</span> <span class="op">=</span> <span class="prelude-val">None</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">external_max_deriv</span> <span class="op">=</span> <span class="prelude-val">None</span>;
+
+ <span class="kw">for</span> (<span class="ident">height</span>, <span class="ident">block</span>) <span class="kw">in</span> <span class="self">self</span>.<span class="ident">headers</span>.<span class="ident">iter_full_blocks</span>()<span class="question-mark">?</span> {
+ <span class="kw">for</span> <span class="ident">tx</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">block</span>.<span class="ident">txdata</span> {
+ <span class="self">self</span>.<span class="ident">process_tx</span>(
+ <span class="ident">database</span>,
+ <span class="ident">tx</span>,
+ <span class="prelude-val">Some</span>(<span class="ident">height</span> <span class="kw">as</span> <span class="ident">u32</span>),
+ <span class="number">0</span>,
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">internal_max_deriv</span>,
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">external_max_deriv</span>,
+ )<span class="question-mark">?</span>;
+ }
+ }
+ <span class="kw">for</span> <span class="ident">tx</span> <span class="kw">in</span> <span class="ident">first_peer</span>.<span class="ident">get_mempool</span>().<span class="ident">iter_txs</span>().<span class="ident">iter</span>() {
+ <span class="self">self</span>.<span class="ident">process_tx</span>(
+ <span class="ident">database</span>,
+ <span class="ident">tx</span>,
+ <span class="prelude-val">None</span>,
+ <span class="number">0</span>,
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">internal_max_deriv</span>,
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">external_max_deriv</span>,
+ )<span class="question-mark">?</span>;
+ }
+
+ <span class="kw">let</span> <span class="ident">current_ext</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">get_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>)<span class="question-mark">?</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>);
+ <span class="kw">let</span> <span class="ident">first_ext_new</span> <span class="op">=</span> <span class="ident">external_max_deriv</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">+</span> <span class="number">1</span>).<span class="ident">unwrap_or</span>(<span class="number">0</span>);
+ <span class="kw">if</span> <span class="ident">first_ext_new</span> <span class="op">></span> <span class="ident">current_ext</span> {
+ <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Setting external index to {}"</span>, <span class="ident">first_ext_new</span>);
+ <span class="ident">database</span>.<span class="ident">set_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="ident">first_ext_new</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="kw">let</span> <span class="ident">current_int</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">get_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>)<span class="question-mark">?</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>);
+ <span class="kw">let</span> <span class="ident">first_int_new</span> <span class="op">=</span> <span class="ident">internal_max_deriv</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">+</span> <span class="number">1</span>).<span class="ident">unwrap_or</span>(<span class="number">0</span>);
+ <span class="kw">if</span> <span class="ident">first_int_new</span> <span class="op">></span> <span class="ident">current_int</span> {
+ <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Setting internal index to {}"</span>, <span class="ident">first_int_new</span>);
+ <span class="ident">database</span>.<span class="ident">set_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>, <span class="ident">first_int_new</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Dropping blocks until {}"</span>, <span class="ident">buried_height</span>);
+ <span class="self">self</span>.<span class="ident">headers</span>.<span class="ident">delete_blocks_until</span>(<span class="ident">buried_height</span>)<span class="question-mark">?</span>;
+
+ <span class="ident">progress_update</span>
+ .<span class="ident">lock</span>()
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">update</span>(<span class="number">100.0</span>, <span class="prelude-val">Some</span>(<span class="string">"Done"</span>.<span class="ident">into</span>()))<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">peers</span>[<span class="number">0</span>]
+ .<span class="ident">get_mempool</span>()
+ .<span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="ident">Inventory</span>::<span class="ident">Transaction</span>(<span class="kw-2">*</span><span class="ident">txid</span>)))
+ }
+
+ <span class="kw">fn</span> <span class="ident">broadcast</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">peers</span>[<span class="number">0</span>].<span class="ident">broadcast_tx</span>(<span class="ident">tx</span>.<span class="ident">clone</span>())<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_height</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">headers</span>.<span class="ident">get_height</span>()<span class="question-mark">?</span> <span class="kw">as</span> <span class="ident">u32</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">estimate_fee</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">_target</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">FeeRate</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="comment">// TODO</span>
+ <span class="prelude-val">Ok</span>(<span class="ident">FeeRate</span>::<span class="ident">default</span>())
+ }
+}
+
+<span class="doccomment">/// An error that can occur during sync with a [`CompactFiltersBlockchain`]</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">CompactFiltersError</span> {
+ <span class="doccomment">/// A peer sent an invalid or unexpected response</span>
+ <span class="ident">InvalidResponse</span>,
+ <span class="doccomment">/// The headers returned are invalid</span>
+ <span class="ident">InvalidHeaders</span>,
+ <span class="doccomment">/// The compact filter headers returned are invalid</span>
+ <span class="ident">InvalidFilterHeader</span>,
+ <span class="doccomment">/// The compact filter returned is invalid</span>
+ <span class="ident">InvalidFilter</span>,
+ <span class="doccomment">/// The peer is missing a block in the valid chain</span>
+ <span class="ident">MissingBlock</span>,
+ <span class="doccomment">/// The data stored in the block filters storage are corrupted</span>
+ <span class="ident">DataCorruption</span>,
+
+ <span class="doccomment">/// A peer is not connected</span>
+ <span class="ident">NotConnected</span>,
+ <span class="doccomment">/// A peer took too long to reply to one of our messages</span>
+ <span class="ident">Timeout</span>,
+
+ <span class="doccomment">/// No peers have been specified</span>
+ <span class="ident">NoPeers</span>,
+
+ <span class="doccomment">/// Internal database error</span>
+ <span class="ident">DB</span>(<span class="ident">rocksdb</span>::<span class="ident">Error</span>),
+ <span class="doccomment">/// Internal I/O error</span>
+ <span class="ident">IO</span>(<span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">Error</span>),
+ <span class="doccomment">/// Invalid BIP158 filter</span>
+ <span class="ident">BIP158</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip158</span>::<span class="ident">Error</span>),
+ <span class="doccomment">/// Internal system time error</span>
+ <span class="ident">Time</span>(<span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">SystemTimeError</span>),
+
+ <span class="doccomment">/// Wrapper for [`crate::error::Error`]</span>
+ <span class="ident">Global</span>(<span class="ident">Box</span><span class="op"><</span><span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span><span class="op">></span>),
+}
+
+<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">CompactFiltersError</span> {
+ <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
+ <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"{:?}"</span>, <span class="self">self</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span> <span class="kw">for</span> <span class="ident">CompactFiltersError</span> {}
+
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_error</span> {
+ ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">from</span>:<span class="ident">ty</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">to</span>:<span class="ident">ident</span> ) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">convert</span>::<span class="ident">From</span><span class="op"><</span><span class="macro-nonterminal">$</span><span class="macro-nonterminal">from</span><span class="op">></span> <span class="kw">for</span> <span class="ident">CompactFiltersError</span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">err</span>: <span class="macro-nonterminal">$</span><span class="macro-nonterminal">from</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">CompactFiltersError</span>::<span class="macro-nonterminal">$</span><span class="macro-nonterminal">to</span>(<span class="ident">err</span>)
+ }
+ }
+ };
+}
+
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">rocksdb</span>::<span class="ident">Error</span>, <span class="ident">DB</span>);
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">Error</span>, <span class="ident">IO</span>);
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip158</span>::<span class="ident">Error</span>, <span class="ident">BIP158</span>);
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">SystemTimeError</span>, <span class="ident">Time</span>);
+
+<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span><span class="op">></span> <span class="kw">for</span> <span class="ident">CompactFiltersError</span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">err</span>: <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">CompactFiltersError</span>::<span class="ident">Global</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">err</span>))
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "bdk";</script><script src="../../../../main.js"></script><script src="../../../../source-script.js"></script><script src="../../../../source-files.js"></script><script defer src="../../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/blockchain/compact_filters/peer.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>peer.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../../bdk/index.html'><div class='logo-container'><img src='../../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+<span id="163">163</span>
+<span id="164">164</span>
+<span id="165">165</span>
+<span id="166">166</span>
+<span id="167">167</span>
+<span id="168">168</span>
+<span id="169">169</span>
+<span id="170">170</span>
+<span id="171">171</span>
+<span id="172">172</span>
+<span id="173">173</span>
+<span id="174">174</span>
+<span id="175">175</span>
+<span id="176">176</span>
+<span id="177">177</span>
+<span id="178">178</span>
+<span id="179">179</span>
+<span id="180">180</span>
+<span id="181">181</span>
+<span id="182">182</span>
+<span id="183">183</span>
+<span id="184">184</span>
+<span id="185">185</span>
+<span id="186">186</span>
+<span id="187">187</span>
+<span id="188">188</span>
+<span id="189">189</span>
+<span id="190">190</span>
+<span id="191">191</span>
+<span id="192">192</span>
+<span id="193">193</span>
+<span id="194">194</span>
+<span id="195">195</span>
+<span id="196">196</span>
+<span id="197">197</span>
+<span id="198">198</span>
+<span id="199">199</span>
+<span id="200">200</span>
+<span id="201">201</span>
+<span id="202">202</span>
+<span id="203">203</span>
+<span id="204">204</span>
+<span id="205">205</span>
+<span id="206">206</span>
+<span id="207">207</span>
+<span id="208">208</span>
+<span id="209">209</span>
+<span id="210">210</span>
+<span id="211">211</span>
+<span id="212">212</span>
+<span id="213">213</span>
+<span id="214">214</span>
+<span id="215">215</span>
+<span id="216">216</span>
+<span id="217">217</span>
+<span id="218">218</span>
+<span id="219">219</span>
+<span id="220">220</span>
+<span id="221">221</span>
+<span id="222">222</span>
+<span id="223">223</span>
+<span id="224">224</span>
+<span id="225">225</span>
+<span id="226">226</span>
+<span id="227">227</span>
+<span id="228">228</span>
+<span id="229">229</span>
+<span id="230">230</span>
+<span id="231">231</span>
+<span id="232">232</span>
+<span id="233">233</span>
+<span id="234">234</span>
+<span id="235">235</span>
+<span id="236">236</span>
+<span id="237">237</span>
+<span id="238">238</span>
+<span id="239">239</span>
+<span id="240">240</span>
+<span id="241">241</span>
+<span id="242">242</span>
+<span id="243">243</span>
+<span id="244">244</span>
+<span id="245">245</span>
+<span id="246">246</span>
+<span id="247">247</span>
+<span id="248">248</span>
+<span id="249">249</span>
+<span id="250">250</span>
+<span id="251">251</span>
+<span id="252">252</span>
+<span id="253">253</span>
+<span id="254">254</span>
+<span id="255">255</span>
+<span id="256">256</span>
+<span id="257">257</span>
+<span id="258">258</span>
+<span id="259">259</span>
+<span id="260">260</span>
+<span id="261">261</span>
+<span id="262">262</span>
+<span id="263">263</span>
+<span id="264">264</span>
+<span id="265">265</span>
+<span id="266">266</span>
+<span id="267">267</span>
+<span id="268">268</span>
+<span id="269">269</span>
+<span id="270">270</span>
+<span id="271">271</span>
+<span id="272">272</span>
+<span id="273">273</span>
+<span id="274">274</span>
+<span id="275">275</span>
+<span id="276">276</span>
+<span id="277">277</span>
+<span id="278">278</span>
+<span id="279">279</span>
+<span id="280">280</span>
+<span id="281">281</span>
+<span id="282">282</span>
+<span id="283">283</span>
+<span id="284">284</span>
+<span id="285">285</span>
+<span id="286">286</span>
+<span id="287">287</span>
+<span id="288">288</span>
+<span id="289">289</span>
+<span id="290">290</span>
+<span id="291">291</span>
+<span id="292">292</span>
+<span id="293">293</span>
+<span id="294">294</span>
+<span id="295">295</span>
+<span id="296">296</span>
+<span id="297">297</span>
+<span id="298">298</span>
+<span id="299">299</span>
+<span id="300">300</span>
+<span id="301">301</span>
+<span id="302">302</span>
+<span id="303">303</span>
+<span id="304">304</span>
+<span id="305">305</span>
+<span id="306">306</span>
+<span id="307">307</span>
+<span id="308">308</span>
+<span id="309">309</span>
+<span id="310">310</span>
+<span id="311">311</span>
+<span id="312">312</span>
+<span id="313">313</span>
+<span id="314">314</span>
+<span id="315">315</span>
+<span id="316">316</span>
+<span id="317">317</span>
+<span id="318">318</span>
+<span id="319">319</span>
+<span id="320">320</span>
+<span id="321">321</span>
+<span id="322">322</span>
+<span id="323">323</span>
+<span id="324">324</span>
+<span id="325">325</span>
+<span id="326">326</span>
+<span id="327">327</span>
+<span id="328">328</span>
+<span id="329">329</span>
+<span id="330">330</span>
+<span id="331">331</span>
+<span id="332">332</span>
+<span id="333">333</span>
+<span id="334">334</span>
+<span id="335">335</span>
+<span id="336">336</span>
+<span id="337">337</span>
+<span id="338">338</span>
+<span id="339">339</span>
+<span id="340">340</span>
+<span id="341">341</span>
+<span id="342">342</span>
+<span id="343">343</span>
+<span id="344">344</span>
+<span id="345">345</span>
+<span id="346">346</span>
+<span id="347">347</span>
+<span id="348">348</span>
+<span id="349">349</span>
+<span id="350">350</span>
+<span id="351">351</span>
+<span id="352">352</span>
+<span id="353">353</span>
+<span id="354">354</span>
+<span id="355">355</span>
+<span id="356">356</span>
+<span id="357">357</span>
+<span id="358">358</span>
+<span id="359">359</span>
+<span id="360">360</span>
+<span id="361">361</span>
+<span id="362">362</span>
+<span id="363">363</span>
+<span id="364">364</span>
+<span id="365">365</span>
+<span id="366">366</span>
+<span id="367">367</span>
+<span id="368">368</span>
+<span id="369">369</span>
+<span id="370">370</span>
+<span id="371">371</span>
+<span id="372">372</span>
+<span id="373">373</span>
+<span id="374">374</span>
+<span id="375">375</span>
+<span id="376">376</span>
+<span id="377">377</span>
+<span id="378">378</span>
+<span id="379">379</span>
+<span id="380">380</span>
+<span id="381">381</span>
+<span id="382">382</span>
+<span id="383">383</span>
+<span id="384">384</span>
+<span id="385">385</span>
+<span id="386">386</span>
+<span id="387">387</span>
+<span id="388">388</span>
+<span id="389">389</span>
+<span id="390">390</span>
+<span id="391">391</span>
+<span id="392">392</span>
+<span id="393">393</span>
+<span id="394">394</span>
+<span id="395">395</span>
+<span id="396">396</span>
+<span id="397">397</span>
+<span id="398">398</span>
+<span id="399">399</span>
+<span id="400">400</span>
+<span id="401">401</span>
+<span id="402">402</span>
+<span id="403">403</span>
+<span id="404">404</span>
+<span id="405">405</span>
+<span id="406">406</span>
+<span id="407">407</span>
+<span id="408">408</span>
+<span id="409">409</span>
+<span id="410">410</span>
+<span id="411">411</span>
+<span id="412">412</span>
+<span id="413">413</span>
+<span id="414">414</span>
+<span id="415">415</span>
+<span id="416">416</span>
+<span id="417">417</span>
+<span id="418">418</span>
+<span id="419">419</span>
+<span id="420">420</span>
+<span id="421">421</span>
+<span id="422">422</span>
+<span id="423">423</span>
+<span id="424">424</span>
+<span id="425">425</span>
+<span id="426">426</span>
+<span id="427">427</span>
+<span id="428">428</span>
+<span id="429">429</span>
+<span id="430">430</span>
+<span id="431">431</span>
+<span id="432">432</span>
+<span id="433">433</span>
+<span id="434">434</span>
+<span id="435">435</span>
+<span id="436">436</span>
+<span id="437">437</span>
+<span id="438">438</span>
+<span id="439">439</span>
+<span id="440">440</span>
+<span id="441">441</span>
+<span id="442">442</span>
+<span id="443">443</span>
+<span id="444">444</span>
+<span id="445">445</span>
+<span id="446">446</span>
+<span id="447">447</span>
+<span id="448">448</span>
+<span id="449">449</span>
+<span id="450">450</span>
+<span id="451">451</span>
+<span id="452">452</span>
+<span id="453">453</span>
+<span id="454">454</span>
+<span id="455">455</span>
+<span id="456">456</span>
+<span id="457">457</span>
+<span id="458">458</span>
+<span id="459">459</span>
+<span id="460">460</span>
+<span id="461">461</span>
+<span id="462">462</span>
+<span id="463">463</span>
+<span id="464">464</span>
+<span id="465">465</span>
+<span id="466">466</span>
+<span id="467">467</span>
+<span id="468">468</span>
+<span id="469">469</span>
+<span id="470">470</span>
+<span id="471">471</span>
+<span id="472">472</span>
+<span id="473">473</span>
+<span id="474">474</span>
+<span id="475">475</span>
+<span id="476">476</span>
+<span id="477">477</span>
+<span id="478">478</span>
+<span id="479">479</span>
+<span id="480">480</span>
+<span id="481">481</span>
+<span id="482">482</span>
+<span id="483">483</span>
+<span id="484">484</span>
+<span id="485">485</span>
+<span id="486">486</span>
+<span id="487">487</span>
+<span id="488">488</span>
+<span id="489">489</span>
+<span id="490">490</span>
+<span id="491">491</span>
+<span id="492">492</span>
+<span id="493">493</span>
+<span id="494">494</span>
+<span id="495">495</span>
+<span id="496">496</span>
+<span id="497">497</span>
+<span id="498">498</span>
+<span id="499">499</span>
+<span id="500">500</span>
+<span id="501">501</span>
+<span id="502">502</span>
+<span id="503">503</span>
+<span id="504">504</span>
+<span id="505">505</span>
+<span id="506">506</span>
+<span id="507">507</span>
+<span id="508">508</span>
+<span id="509">509</span>
+<span id="510">510</span>
+<span id="511">511</span>
+<span id="512">512</span>
+<span id="513">513</span>
+<span id="514">514</span>
+<span id="515">515</span>
+<span id="516">516</span>
+<span id="517">517</span>
+<span id="518">518</span>
+<span id="519">519</span>
+<span id="520">520</span>
+<span id="521">521</span>
+<span id="522">522</span>
+<span id="523">523</span>
+<span id="524">524</span>
+<span id="525">525</span>
+<span id="526">526</span>
+<span id="527">527</span>
+<span id="528">528</span>
+<span id="529">529</span>
+<span id="530">530</span>
+<span id="531">531</span>
+<span id="532">532</span>
+<span id="533">533</span>
+<span id="534">534</span>
+<span id="535">535</span>
+<span id="536">536</span>
+<span id="537">537</span>
+<span id="538">538</span>
+<span id="539">539</span>
+<span id="540">540</span>
+<span id="541">541</span>
+<span id="542">542</span>
+<span id="543">543</span>
+<span id="544">544</span>
+<span id="545">545</span>
+<span id="546">546</span>
+<span id="547">547</span>
+<span id="548">548</span>
+<span id="549">549</span>
+<span id="550">550</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashMap</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">net</span>::{<span class="ident">TcpStream</span>, <span class="ident">ToSocketAddrs</span>};
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::{<span class="ident">Arc</span>, <span class="ident">Condvar</span>, <span class="ident">Mutex</span>, <span class="ident">RwLock</span>};
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">thread</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::{<span class="ident">Duration</span>, <span class="ident">SystemTime</span>, <span class="ident">UNIX_EPOCH</span>};
+
+<span class="kw">use</span> <span class="ident">socks</span>::{<span class="ident">Socks5Stream</span>, <span class="ident">ToTargetAddr</span>};
+
+<span class="kw">use</span> <span class="ident">rand</span>::{<span class="ident">thread_rng</span>, <span class="ident">Rng</span>};
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">Encodable</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hash_types</span>::<span class="ident">BlockHash</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">Hash</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">constants</span>::<span class="ident">ServiceFlags</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">message</span>::{<span class="ident">NetworkMessage</span>, <span class="ident">RawNetworkMessage</span>};
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">message_blockdata</span>::<span class="kw-2">*</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">message_filter</span>::<span class="kw-2">*</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">message_network</span>::<span class="ident">VersionMessage</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">stream_reader</span>::<span class="ident">StreamReader</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">Address</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Block</span>, <span class="ident">Network</span>, <span class="ident">Transaction</span>, <span class="ident">Txid</span>};
+
+<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">CompactFiltersError</span>;
+
+<span class="kw">type</span> <span class="ident">ResponsesMap</span> <span class="op">=</span> <span class="ident">HashMap</span><span class="op"><</span><span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span>, <span class="ident">Arc</span><span class="op"><</span>(<span class="ident">Mutex</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">NetworkMessage</span><span class="op">></span><span class="op">></span>, <span class="ident">Condvar</span>)<span class="op">></span><span class="op">></span>;
+
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const</span> <span class="ident">TIMEOUT_SECS</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">30</span>;
+
+<span class="doccomment">/// Container for unconfirmed, but valid Bitcoin transactions</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// It is normally shared between [`Peer`]s with the use of [`Arc`], so that transactions are not</span>
+<span class="doccomment">/// duplicated in memory.</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Default</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Mempool</span> {
+ <span class="ident">txs</span>: <span class="ident">RwLock</span><span class="op"><</span><span class="ident">HashMap</span><span class="op"><</span><span class="ident">Txid</span>, <span class="ident">Transaction</span><span class="op">></span><span class="op">></span>,
+}
+
+<span class="kw">impl</span> <span class="ident">Mempool</span> {
+ <span class="doccomment">/// Add a transaction to the mempool</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// Note that this doesn't propagate the transaction to other</span>
+ <span class="doccomment">/// peers. To do that, [`broadcast`](crate::blockchain::Blockchain::broadcast) should be used.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">add_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="ident">Transaction</span>) {
+ <span class="self">self</span>.<span class="ident">txs</span>.<span class="ident">write</span>().<span class="ident">unwrap</span>().<span class="ident">insert</span>(<span class="ident">tx</span>.<span class="ident">txid</span>(), <span class="ident">tx</span>);
+ }
+
+ <span class="doccomment">/// Look-up a transaction in the mempool given an [`Inventory`] request</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">inventory</span>: <span class="kw-2">&</span><span class="ident">Inventory</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">inventory</span> {
+ <span class="ident">Inventory</span>::<span class="ident">Error</span> <span class="op">|</span> <span class="ident">Inventory</span>::<span class="ident">Block</span>(<span class="kw">_</span>) <span class="op">|</span> <span class="ident">Inventory</span>::<span class="ident">WitnessBlock</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">None</span>,
+ <span class="ident">Inventory</span>::<span class="ident">Transaction</span>(<span class="ident">txid</span>) <span class="op">=</span><span class="op">></span> <span class="kw-2">*</span><span class="ident">txid</span>,
+ <span class="ident">Inventory</span>::<span class="ident">WitnessTransaction</span>(<span class="ident">wtxid</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Txid</span>::<span class="ident">from_inner</span>(<span class="ident">wtxid</span>.<span class="ident">into_inner</span>()),
+ };
+ <span class="self">self</span>.<span class="ident">txs</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>().<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">txid</span>).<span class="ident">cloned</span>()
+ }
+
+ <span class="doccomment">/// Return whether or not the mempool contains a transaction with a given txid</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">has_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="self">self</span>.<span class="ident">txs</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>().<span class="ident">contains_key</span>(<span class="ident">txid</span>)
+ }
+
+ <span class="doccomment">/// Return the list of transactions contained in the mempool</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">iter_txs</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">txs</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>().<span class="ident">values</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>()
+ }
+}
+
+<span class="doccomment">/// A Bitcoin peer</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Peer</span> {
+ <span class="ident">writer</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mutex</span><span class="op"><</span><span class="ident">TcpStream</span><span class="op">></span><span class="op">></span>,
+ <span class="ident">responses</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">RwLock</span><span class="op"><</span><span class="ident">ResponsesMap</span><span class="op">></span><span class="op">></span>,
+
+ <span class="ident">reader_thread</span>: <span class="ident">thread</span>::<span class="ident">JoinHandle</span><span class="op"><</span>()<span class="op">></span>,
+ <span class="ident">connected</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">RwLock</span><span class="op"><</span><span class="ident">bool</span><span class="op">></span><span class="op">></span>,
+
+ <span class="ident">mempool</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mempool</span><span class="op">></span>,
+
+ <span class="ident">version</span>: <span class="ident">VersionMessage</span>,
+ <span class="ident">network</span>: <span class="ident">Network</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">Peer</span> {
+ <span class="doccomment">/// Connect to a peer over a plaintext TCP connection</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This function internally spawns a new thread that will monitor incoming messages from the</span>
+ <span class="doccomment">/// peer, and optionally reply to some of them transparently, like [pings](NetworkMessage::Ping)</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">connect</span><span class="op"><</span><span class="ident">A</span>: <span class="ident">ToSocketAddrs</span><span class="op">></span>(
+ <span class="ident">address</span>: <span class="ident">A</span>,
+ <span class="ident">mempool</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mempool</span><span class="op">></span>,
+ <span class="ident">network</span>: <span class="ident">Network</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">stream</span> <span class="op">=</span> <span class="ident">TcpStream</span>::<span class="ident">connect</span>(<span class="ident">address</span>)<span class="question-mark">?</span>;
+
+ <span class="ident">Peer</span>::<span class="ident">from_stream</span>(<span class="ident">stream</span>, <span class="ident">mempool</span>, <span class="ident">network</span>)
+ }
+
+ <span class="doccomment">/// Connect to a peer through a SOCKS5 proxy, optionally by using some credentials, specified</span>
+ <span class="doccomment">/// as a tuple of `(username, password)`</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This function internally spawns a new thread that will monitor incoming messages from the</span>
+ <span class="doccomment">/// peer, and optionally reply to some of them transparently, like [pings](NetworkMessage::Ping)</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">connect_proxy</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">ToTargetAddr</span>, <span class="ident">P</span>: <span class="ident">ToSocketAddrs</span><span class="op">></span>(
+ <span class="ident">target</span>: <span class="ident">T</span>,
+ <span class="ident">proxy</span>: <span class="ident">P</span>,
+ <span class="ident">credentials</span>: <span class="prelude-ty">Option</span><span class="op"><</span>(<span class="kw-2">&</span><span class="ident">str</span>, <span class="kw-2">&</span><span class="ident">str</span>)<span class="op">></span>,
+ <span class="ident">mempool</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mempool</span><span class="op">></span>,
+ <span class="ident">network</span>: <span class="ident">Network</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">socks_stream</span> <span class="op">=</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">username</span>, <span class="ident">password</span>)) <span class="op">=</span> <span class="ident">credentials</span> {
+ <span class="ident">Socks5Stream</span>::<span class="ident">connect_with_password</span>(<span class="ident">proxy</span>, <span class="ident">target</span>, <span class="ident">username</span>, <span class="ident">password</span>)<span class="question-mark">?</span>
+ } <span class="kw">else</span> {
+ <span class="ident">Socks5Stream</span>::<span class="ident">connect</span>(<span class="ident">proxy</span>, <span class="ident">target</span>)<span class="question-mark">?</span>
+ };
+
+ <span class="ident">Peer</span>::<span class="ident">from_stream</span>(<span class="ident">socks_stream</span>.<span class="ident">into_inner</span>(), <span class="ident">mempool</span>, <span class="ident">network</span>)
+ }
+
+ <span class="doccomment">/// Create a [`Peer`] from an already connected TcpStream</span>
+ <span class="kw">fn</span> <span class="ident">from_stream</span>(
+ <span class="ident">stream</span>: <span class="ident">TcpStream</span>,
+ <span class="ident">mempool</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mempool</span><span class="op">></span>,
+ <span class="ident">network</span>: <span class="ident">Network</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">writer</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Mutex</span>::<span class="ident">new</span>(<span class="ident">stream</span>.<span class="ident">try_clone</span>()<span class="question-mark">?</span>));
+ <span class="kw">let</span> <span class="ident">responses</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">RwLock</span><span class="op"><</span><span class="ident">ResponsesMap</span><span class="op">></span><span class="op">></span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">RwLock</span>::<span class="ident">new</span>(<span class="ident">HashMap</span>::<span class="ident">new</span>()));
+ <span class="kw">let</span> <span class="ident">connected</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">RwLock</span>::<span class="ident">new</span>(<span class="bool-val">true</span>));
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">locked_writer</span> <span class="op">=</span> <span class="ident">writer</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">reader_thread_responses</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">responses</span>);
+ <span class="kw">let</span> <span class="ident">reader_thread_writer</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">writer</span>);
+ <span class="kw">let</span> <span class="ident">reader_thread_mempool</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">mempool</span>);
+ <span class="kw">let</span> <span class="ident">reader_thread_connected</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">connected</span>);
+ <span class="kw">let</span> <span class="ident">reader_thread</span> <span class="op">=</span> <span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="kw">move</span> <span class="op">|</span><span class="op">|</span> {
+ <span class="self">Self</span>::<span class="ident">reader_thread</span>(
+ <span class="ident">network</span>,
+ <span class="ident">stream</span>,
+ <span class="ident">reader_thread_responses</span>,
+ <span class="ident">reader_thread_writer</span>,
+ <span class="ident">reader_thread_mempool</span>,
+ <span class="ident">reader_thread_connected</span>,
+ )
+ });
+
+ <span class="kw">let</span> <span class="ident">timestamp</span> <span class="op">=</span> <span class="ident">SystemTime</span>::<span class="ident">now</span>().<span class="ident">duration_since</span>(<span class="ident">UNIX_EPOCH</span>)<span class="question-mark">?</span>.<span class="ident">as_secs</span>() <span class="kw">as</span> <span class="ident">i64</span>;
+ <span class="kw">let</span> <span class="ident">nonce</span> <span class="op">=</span> <span class="ident">thread_rng</span>().<span class="ident">gen</span>();
+ <span class="kw">let</span> <span class="ident">receiver</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="ident">locked_writer</span>.<span class="ident">peer_addr</span>()<span class="question-mark">?</span>, <span class="ident">ServiceFlags</span>::<span class="ident">NONE</span>);
+ <span class="kw">let</span> <span class="ident">sender</span> <span class="op">=</span> <span class="ident">Address</span> {
+ <span class="ident">services</span>: <span class="ident">ServiceFlags</span>::<span class="ident">NONE</span>,
+ <span class="ident">address</span>: [<span class="number">0u16</span>; <span class="number">8</span>],
+ <span class="ident">port</span>: <span class="number">0</span>,
+ };
+
+ <span class="self">Self</span>::<span class="ident">_send</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">locked_writer</span>,
+ <span class="ident">network</span>.<span class="ident">magic</span>(),
+ <span class="ident">NetworkMessage</span>::<span class="ident">Version</span>(<span class="ident">VersionMessage</span>::<span class="ident">new</span>(
+ <span class="ident">ServiceFlags</span>::<span class="ident">WITNESS</span>,
+ <span class="ident">timestamp</span>,
+ <span class="ident">receiver</span>,
+ <span class="ident">sender</span>,
+ <span class="ident">nonce</span>,
+ <span class="string">"MagicalBitcoinWallet"</span>.<span class="ident">into</span>(),
+ <span class="number">0</span>,
+ )),
+ )<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">version</span> <span class="op">=</span> <span class="kw">if</span> <span class="kw">let</span> <span class="ident">NetworkMessage</span>::<span class="ident">Version</span>(<span class="ident">version</span>) <span class="op">=</span>
+ <span class="self">Self</span>::<span class="ident">_recv</span>(<span class="kw-2">&</span><span class="ident">responses</span>, <span class="string">"version"</span>, <span class="prelude-val">None</span>)<span class="question-mark">?</span>.<span class="ident">unwrap</span>()
+ {
+ <span class="ident">version</span>
+ } <span class="kw">else</span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>);
+ };
+
+ <span class="kw">if</span> <span class="kw">let</span> <span class="ident">NetworkMessage</span>::<span class="ident">Verack</span> <span class="op">=</span> <span class="self">Self</span>::<span class="ident">_recv</span>(<span class="kw-2">&</span><span class="ident">responses</span>, <span class="string">"verack"</span>, <span class="prelude-val">None</span>)<span class="question-mark">?</span>.<span class="ident">unwrap</span>() {
+ <span class="self">Self</span>::<span class="ident">_send</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">locked_writer</span>, <span class="ident">network</span>.<span class="ident">magic</span>(), <span class="ident">NetworkMessage</span>::<span class="ident">Verack</span>)<span class="question-mark">?</span>;
+ } <span class="kw">else</span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>);
+ }
+
+ <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">locked_writer</span>);
+
+ <span class="prelude-val">Ok</span>(<span class="ident">Peer</span> {
+ <span class="ident">writer</span>,
+ <span class="ident">reader_thread</span>,
+ <span class="ident">responses</span>,
+ <span class="ident">connected</span>,
+ <span class="ident">mempool</span>,
+ <span class="ident">network</span>,
+ <span class="ident">version</span>,
+ })
+ }
+
+ <span class="doccomment">/// Send a Bitcoin network message</span>
+ <span class="kw">fn</span> <span class="ident">_send</span>(
+ <span class="ident">writer</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">TcpStream</span>,
+ <span class="ident">magic</span>: <span class="ident">u32</span>,
+ <span class="ident">payload</span>: <span class="ident">NetworkMessage</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"==> {:?}"</span>, <span class="ident">payload</span>);
+
+ <span class="kw">let</span> <span class="ident">raw_message</span> <span class="op">=</span> <span class="ident">RawNetworkMessage</span> { <span class="ident">magic</span>, <span class="ident">payload</span> };
+
+ <span class="ident">raw_message</span>
+ .<span class="ident">consensus_encode</span>(<span class="ident">writer</span>)
+ .<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="doccomment">/// Wait for a specific incoming Bitcoin message, optionally with a timeout</span>
+ <span class="kw">fn</span> <span class="ident">_recv</span>(
+ <span class="ident">responses</span>: <span class="kw-2">&</span><span class="ident">Arc</span><span class="op"><</span><span class="ident">RwLock</span><span class="op"><</span><span class="ident">ResponsesMap</span><span class="op">></span><span class="op">></span>,
+ <span class="ident">wait_for</span>: <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span>,
+ <span class="ident">timeout</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Duration</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">NetworkMessage</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">message_resp</span> <span class="op">=</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">lock</span> <span class="op">=</span> <span class="ident">responses</span>.<span class="ident">write</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">message_resp</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">entry</span>(<span class="ident">wait_for</span>).<span class="ident">or_default</span>();
+ <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">message_resp</span>)
+ };
+
+ <span class="kw">let</span> (<span class="ident">lock</span>, <span class="ident">cvar</span>) <span class="op">=</span> <span class="kw-2">&</span><span class="kw-2">*</span><span class="ident">message_resp</span>;
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">messages</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
+ <span class="kw">while</span> <span class="ident">messages</span>.<span class="ident">is_empty</span>() {
+ <span class="kw">match</span> <span class="ident">timeout</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="ident">messages</span> <span class="op">=</span> <span class="ident">cvar</span>.<span class="ident">wait</span>(<span class="ident">messages</span>).<span class="ident">unwrap</span>(),
+ <span class="prelude-val">Some</span>(<span class="ident">t</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">cvar</span>.<span class="ident">wait_timeout</span>(<span class="ident">messages</span>, <span class="ident">t</span>).<span class="ident">unwrap</span>();
+ <span class="kw">if</span> <span class="ident">result</span>.<span class="number">1</span>.<span class="ident">timed_out</span>() {
+ <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>);
+ }
+
+ <span class="ident">messages</span> <span class="op">=</span> <span class="ident">result</span>.<span class="number">0</span>;
+ }
+ }
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">messages</span>.<span class="ident">pop</span>())
+ }
+
+ <span class="doccomment">/// Return the [`VersionMessage`] sent by the peer</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_version</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="kw-2">&</span><span class="ident">VersionMessage</span> {
+ <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">version</span>
+ }
+
+ <span class="doccomment">/// Return the Bitcoin [`Network`] in use</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_network</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Network</span> {
+ <span class="self">self</span>.<span class="ident">network</span>
+ }
+
+ <span class="doccomment">/// Return the mempool used by this peer</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_mempool</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mempool</span><span class="op">></span> {
+ <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">mempool</span>)
+ }
+
+ <span class="doccomment">/// Return whether or not the peer is still connected</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_connected</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="kw-2">*</span><span class="self">self</span>.<span class="ident">connected</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>()
+ }
+
+ <span class="doccomment">/// Internal function called once the `reader_thread` is spawned</span>
+ <span class="kw">fn</span> <span class="ident">reader_thread</span>(
+ <span class="ident">network</span>: <span class="ident">Network</span>,
+ <span class="ident">connection</span>: <span class="ident">TcpStream</span>,
+ <span class="ident">reader_thread_responses</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">RwLock</span><span class="op"><</span><span class="ident">ResponsesMap</span><span class="op">></span><span class="op">></span>,
+ <span class="ident">reader_thread_writer</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mutex</span><span class="op"><</span><span class="ident">TcpStream</span><span class="op">></span><span class="op">></span>,
+ <span class="ident">reader_thread_mempool</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mempool</span><span class="op">></span>,
+ <span class="ident">reader_thread_connected</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">RwLock</span><span class="op"><</span><span class="ident">bool</span><span class="op">></span><span class="op">></span>,
+ ) {
+ <span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">check_disconnect</span> {
+ (<span class="macro-nonterminal">$</span><span class="macro-nonterminal">call</span>:<span class="ident">expr</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">match</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">call</span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">good</span>) <span class="op">=</span><span class="op">></span> <span class="ident">good</span>,
+ <span class="prelude-val">Err</span>(<span class="ident">e</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="ident">log</span>::<span class="macro">debug</span><span class="macro">!</span>(<span class="string">"Error {:?}"</span>, <span class="ident">e</span>);
+ <span class="kw-2">*</span><span class="ident">reader_thread_connected</span>.<span class="ident">write</span>().<span class="ident">unwrap</span>() <span class="op">=</span> <span class="bool-val">false</span>;
+
+ <span class="kw">break</span>;
+ }
+ }
+ };
+ }
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">reader</span> <span class="op">=</span> <span class="ident">StreamReader</span>::<span class="ident">new</span>(<span class="ident">connection</span>, <span class="prelude-val">None</span>);
+ <span class="kw">loop</span> {
+ <span class="kw">let</span> <span class="ident">raw_message</span>: <span class="ident">RawNetworkMessage</span> <span class="op">=</span> <span class="macro">check_disconnect</span><span class="macro">!</span>(<span class="ident">reader</span>.<span class="ident">read_next</span>());
+
+ <span class="kw">let</span> <span class="ident">in_message</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">raw_message</span>.<span class="ident">magic</span> <span class="op">!</span><span class="op">=</span> <span class="ident">network</span>.<span class="ident">magic</span>() {
+ <span class="kw">continue</span>;
+ } <span class="kw">else</span> {
+ <span class="ident">raw_message</span>.<span class="ident">payload</span>
+ };
+
+ <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"<== {:?}"</span>, <span class="ident">in_message</span>);
+
+ <span class="kw">match</span> <span class="ident">in_message</span> {
+ <span class="ident">NetworkMessage</span>::<span class="ident">Ping</span>(<span class="ident">nonce</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="macro">check_disconnect</span><span class="macro">!</span>(<span class="self">Self</span>::<span class="ident">_send</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">reader_thread_writer</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>(),
+ <span class="ident">network</span>.<span class="ident">magic</span>(),
+ <span class="ident">NetworkMessage</span>::<span class="ident">Pong</span>(<span class="ident">nonce</span>),
+ ));
+
+ <span class="kw">continue</span>;
+ }
+ <span class="ident">NetworkMessage</span>::<span class="ident">Alert</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="kw">continue</span>,
+ <span class="ident">NetworkMessage</span>::<span class="ident">GetData</span>(<span class="kw-2">ref</span> <span class="ident">inv</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> (<span class="ident">found</span>, <span class="ident">not_found</span>): (<span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>) <span class="op">=</span> <span class="ident">inv</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">item</span><span class="op">|</span> (<span class="kw-2">*</span><span class="ident">item</span>, <span class="ident">reader_thread_mempool</span>.<span class="ident">get_tx</span>(<span class="ident">item</span>)))
+ .<span class="ident">partition</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">d</span>)<span class="op">|</span> <span class="ident">d</span>.<span class="ident">is_some</span>());
+ <span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">found_tx</span>) <span class="kw">in</span> <span class="ident">found</span> {
+ <span class="macro">check_disconnect</span><span class="macro">!</span>(<span class="self">Self</span>::<span class="ident">_send</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">reader_thread_writer</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>(),
+ <span class="ident">network</span>.<span class="ident">magic</span>(),
+ <span class="ident">NetworkMessage</span>::<span class="ident">Tx</span>(<span class="ident">found_tx</span>.<span class="ident">unwrap</span>()),
+ ));
+ }
+
+ <span class="kw">if</span> <span class="op">!</span><span class="ident">not_found</span>.<span class="ident">is_empty</span>() {
+ <span class="macro">check_disconnect</span><span class="macro">!</span>(<span class="self">Self</span>::<span class="ident">_send</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">reader_thread_writer</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>(),
+ <span class="ident">network</span>.<span class="ident">magic</span>(),
+ <span class="ident">NetworkMessage</span>::<span class="ident">NotFound</span>(
+ <span class="ident">not_found</span>.<span class="ident">into_iter</span>().<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">i</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">i</span>).<span class="ident">collect</span>(),
+ ),
+ ));
+ }
+ }
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> {}
+ }
+
+ <span class="kw">let</span> <span class="ident">message_resp</span> <span class="op">=</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">lock</span> <span class="op">=</span> <span class="ident">reader_thread_responses</span>.<span class="ident">write</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">message_resp</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">entry</span>(<span class="ident">in_message</span>.<span class="ident">cmd</span>()).<span class="ident">or_default</span>();
+ <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">message_resp</span>)
+ };
+
+ <span class="kw">let</span> (<span class="ident">lock</span>, <span class="ident">cvar</span>) <span class="op">=</span> <span class="kw-2">&</span><span class="kw-2">*</span><span class="ident">message_resp</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">messages</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
+ <span class="ident">messages</span>.<span class="ident">push</span>(<span class="ident">in_message</span>);
+ <span class="ident">cvar</span>.<span class="ident">notify_all</span>();
+ }
+ }
+
+ <span class="doccomment">/// Send a raw Bitcoin message to the peer</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">send</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">payload</span>: <span class="ident">NetworkMessage</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">writer</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">writer</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
+ <span class="self">Self</span>::<span class="ident">_send</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">writer</span>, <span class="self">self</span>.<span class="ident">network</span>.<span class="ident">magic</span>(), <span class="ident">payload</span>)
+ }
+
+ <span class="doccomment">/// Waits for a specific incoming Bitcoin message, optionally with a timeout</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">recv</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">wait_for</span>: <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span>,
+ <span class="ident">timeout</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Duration</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">NetworkMessage</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="self">Self</span>::<span class="ident">_recv</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">responses</span>, <span class="ident">wait_for</span>, <span class="ident">timeout</span>)
+ }
+}
+
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">CompactFiltersPeer</span> {
+ <span class="kw">fn</span> <span class="ident">get_cf_checkpt</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">filter_type</span>: <span class="ident">u8</span>,
+ <span class="ident">stop_hash</span>: <span class="ident">BlockHash</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CFCheckpt</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>;
+ <span class="kw">fn</span> <span class="ident">get_cf_headers</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">filter_type</span>: <span class="ident">u8</span>,
+ <span class="ident">start_height</span>: <span class="ident">u32</span>,
+ <span class="ident">stop_hash</span>: <span class="ident">BlockHash</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CFHeaders</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>;
+ <span class="kw">fn</span> <span class="ident">get_cf_filters</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">filter_type</span>: <span class="ident">u8</span>,
+ <span class="ident">start_height</span>: <span class="ident">u32</span>,
+ <span class="ident">stop_hash</span>: <span class="ident">BlockHash</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span>;
+ <span class="kw">fn</span> <span class="ident">pop_cf_filter_resp</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CFilter</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>;
+}
+
+<span class="kw">impl</span> <span class="ident">CompactFiltersPeer</span> <span class="kw">for</span> <span class="ident">Peer</span> {
+ <span class="kw">fn</span> <span class="ident">get_cf_checkpt</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">filter_type</span>: <span class="ident">u8</span>,
+ <span class="ident">stop_hash</span>: <span class="ident">BlockHash</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CFCheckpt</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">GetCFCheckpt</span>(<span class="ident">GetCFCheckpt</span> {
+ <span class="ident">filter_type</span>,
+ <span class="ident">stop_hash</span>,
+ }))<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="ident">response</span> <span class="op">=</span> <span class="self">self</span>
+ .<span class="ident">recv</span>(<span class="string">"cfcheckpt"</span>, <span class="prelude-val">Some</span>(<span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="ident">TIMEOUT_SECS</span>)))<span class="question-mark">?</span>
+ .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">Timeout</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">response</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">response</span> {
+ <span class="ident">NetworkMessage</span>::<span class="ident">CFCheckpt</span>(<span class="ident">response</span>) <span class="op">=</span><span class="op">></span> <span class="ident">response</span>,
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>),
+ };
+
+ <span class="kw">if</span> <span class="ident">response</span>.<span class="ident">filter_type</span> <span class="op">!</span><span class="op">=</span> <span class="ident">filter_type</span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>);
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">response</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_cf_headers</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">filter_type</span>: <span class="ident">u8</span>,
+ <span class="ident">start_height</span>: <span class="ident">u32</span>,
+ <span class="ident">stop_hash</span>: <span class="ident">BlockHash</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CFHeaders</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">GetCFHeaders</span>(<span class="ident">GetCFHeaders</span> {
+ <span class="ident">filter_type</span>,
+ <span class="ident">start_height</span>,
+ <span class="ident">stop_hash</span>,
+ }))<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="ident">response</span> <span class="op">=</span> <span class="self">self</span>
+ .<span class="ident">recv</span>(<span class="string">"cfheaders"</span>, <span class="prelude-val">Some</span>(<span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="ident">TIMEOUT_SECS</span>)))<span class="question-mark">?</span>
+ .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">Timeout</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">response</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">response</span> {
+ <span class="ident">NetworkMessage</span>::<span class="ident">CFHeaders</span>(<span class="ident">response</span>) <span class="op">=</span><span class="op">></span> <span class="ident">response</span>,
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>),
+ };
+
+ <span class="kw">if</span> <span class="ident">response</span>.<span class="ident">filter_type</span> <span class="op">!</span><span class="op">=</span> <span class="ident">filter_type</span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>);
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">response</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">pop_cf_filter_resp</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CFilter</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">response</span> <span class="op">=</span> <span class="self">self</span>
+ .<span class="ident">recv</span>(<span class="string">"cfilter"</span>, <span class="prelude-val">Some</span>(<span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="ident">TIMEOUT_SECS</span>)))<span class="question-mark">?</span>
+ .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">Timeout</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">response</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">response</span> {
+ <span class="ident">NetworkMessage</span>::<span class="ident">CFilter</span>(<span class="ident">response</span>) <span class="op">=</span><span class="op">></span> <span class="ident">response</span>,
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>),
+ };
+
+ <span class="prelude-val">Ok</span>(<span class="ident">response</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_cf_filters</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">filter_type</span>: <span class="ident">u8</span>,
+ <span class="ident">start_height</span>: <span class="ident">u32</span>,
+ <span class="ident">stop_hash</span>: <span class="ident">BlockHash</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">GetCFilters</span>(<span class="ident">GetCFilters</span> {
+ <span class="ident">filter_type</span>,
+ <span class="ident">start_height</span>,
+ <span class="ident">stop_hash</span>,
+ }))<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+}
+
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">InvPeer</span> {
+ <span class="kw">fn</span> <span class="ident">get_block</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">block_hash</span>: <span class="ident">BlockHash</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Block</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span>;
+ <span class="kw">fn</span> <span class="ident">ask_for_mempool</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span>;
+ <span class="kw">fn</span> <span class="ident">broadcast_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span>;
+}
+
+<span class="kw">impl</span> <span class="ident">InvPeer</span> <span class="kw">for</span> <span class="ident">Peer</span> {
+ <span class="kw">fn</span> <span class="ident">get_block</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">block_hash</span>: <span class="ident">BlockHash</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Block</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">GetData</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">Inventory</span>::<span class="ident">WitnessBlock</span>(
+ <span class="ident">block_hash</span>,
+ )]))<span class="question-mark">?</span>;
+
+ <span class="kw">match</span> <span class="self">self</span>.<span class="ident">recv</span>(<span class="string">"block"</span>, <span class="prelude-val">Some</span>(<span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="ident">TIMEOUT_SECS</span>)))<span class="question-mark">?</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">NetworkMessage</span>::<span class="ident">Block</span>(<span class="ident">response</span>)) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">response</span>)),
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>),
+ }
+ }
+
+ <span class="kw">fn</span> <span class="ident">ask_for_mempool</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">MemPool</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">inv</span> <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span>.<span class="ident">recv</span>(<span class="string">"inv"</span>, <span class="prelude-val">Some</span>(<span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="number">5</span>)))<span class="question-mark">?</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Ok</span>(()), <span class="comment">// empty mempool</span>
+ <span class="prelude-val">Some</span>(<span class="ident">NetworkMessage</span>::<span class="ident">Inv</span>(<span class="ident">inv</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">inv</span>,
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>),
+ };
+
+ <span class="kw">let</span> <span class="ident">getdata</span> <span class="op">=</span> <span class="ident">inv</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">cloned</span>()
+ .<span class="ident">filter</span>(<span class="op">|</span><span class="ident">item</span><span class="op">|</span> <span class="kw">match</span> <span class="ident">item</span> {
+ <span class="ident">Inventory</span>::<span class="ident">Transaction</span>(<span class="ident">txid</span>) <span class="kw">if</span> <span class="op">!</span><span class="self">self</span>.<span class="ident">mempool</span>.<span class="ident">has_tx</span>(<span class="ident">txid</span>) <span class="op">=</span><span class="op">></span> <span class="bool-val">true</span>,
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="bool-val">false</span>,
+ })
+ .<span class="ident">collect</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span><span class="op">></span>();
+ <span class="kw">let</span> <span class="ident">num_txs</span> <span class="op">=</span> <span class="ident">getdata</span>.<span class="ident">len</span>();
+ <span class="self">self</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">GetData</span>(<span class="ident">getdata</span>))<span class="question-mark">?</span>;
+
+ <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">num_txs</span> {
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="self">self</span>
+ .<span class="ident">recv</span>(<span class="string">"tx"</span>, <span class="prelude-val">Some</span>(<span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="ident">TIMEOUT_SECS</span>)))<span class="question-mark">?</span>
+ .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">Timeout</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">tx</span> {
+ <span class="ident">NetworkMessage</span>::<span class="ident">Tx</span>(<span class="ident">tx</span>) <span class="op">=</span><span class="op">></span> <span class="ident">tx</span>,
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>),
+ };
+
+ <span class="self">self</span>.<span class="ident">mempool</span>.<span class="ident">add_tx</span>(<span class="ident">tx</span>);
+ }
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">fn</span> <span class="ident">broadcast_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">mempool</span>.<span class="ident">add_tx</span>(<span class="ident">tx</span>.<span class="ident">clone</span>());
+ <span class="self">self</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">Tx</span>(<span class="ident">tx</span>))<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "bdk";</script><script src="../../../../main.js"></script><script src="../../../../source-script.js"></script><script src="../../../../source-files.js"></script><script defer src="../../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/blockchain/compact_filters/store.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>store.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../../bdk/index.html'><div class='logo-container'><img src='../../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+<span id="163">163</span>
+<span id="164">164</span>
+<span id="165">165</span>
+<span id="166">166</span>
+<span id="167">167</span>
+<span id="168">168</span>
+<span id="169">169</span>
+<span id="170">170</span>
+<span id="171">171</span>
+<span id="172">172</span>
+<span id="173">173</span>
+<span id="174">174</span>
+<span id="175">175</span>
+<span id="176">176</span>
+<span id="177">177</span>
+<span id="178">178</span>
+<span id="179">179</span>
+<span id="180">180</span>
+<span id="181">181</span>
+<span id="182">182</span>
+<span id="183">183</span>
+<span id="184">184</span>
+<span id="185">185</span>
+<span id="186">186</span>
+<span id="187">187</span>
+<span id="188">188</span>
+<span id="189">189</span>
+<span id="190">190</span>
+<span id="191">191</span>
+<span id="192">192</span>
+<span id="193">193</span>
+<span id="194">194</span>
+<span id="195">195</span>
+<span id="196">196</span>
+<span id="197">197</span>
+<span id="198">198</span>
+<span id="199">199</span>
+<span id="200">200</span>
+<span id="201">201</span>
+<span id="202">202</span>
+<span id="203">203</span>
+<span id="204">204</span>
+<span id="205">205</span>
+<span id="206">206</span>
+<span id="207">207</span>
+<span id="208">208</span>
+<span id="209">209</span>
+<span id="210">210</span>
+<span id="211">211</span>
+<span id="212">212</span>
+<span id="213">213</span>
+<span id="214">214</span>
+<span id="215">215</span>
+<span id="216">216</span>
+<span id="217">217</span>
+<span id="218">218</span>
+<span id="219">219</span>
+<span id="220">220</span>
+<span id="221">221</span>
+<span id="222">222</span>
+<span id="223">223</span>
+<span id="224">224</span>
+<span id="225">225</span>
+<span id="226">226</span>
+<span id="227">227</span>
+<span id="228">228</span>
+<span id="229">229</span>
+<span id="230">230</span>
+<span id="231">231</span>
+<span id="232">232</span>
+<span id="233">233</span>
+<span id="234">234</span>
+<span id="235">235</span>
+<span id="236">236</span>
+<span id="237">237</span>
+<span id="238">238</span>
+<span id="239">239</span>
+<span id="240">240</span>
+<span id="241">241</span>
+<span id="242">242</span>
+<span id="243">243</span>
+<span id="244">244</span>
+<span id="245">245</span>
+<span id="246">246</span>
+<span id="247">247</span>
+<span id="248">248</span>
+<span id="249">249</span>
+<span id="250">250</span>
+<span id="251">251</span>
+<span id="252">252</span>
+<span id="253">253</span>
+<span id="254">254</span>
+<span id="255">255</span>
+<span id="256">256</span>
+<span id="257">257</span>
+<span id="258">258</span>
+<span id="259">259</span>
+<span id="260">260</span>
+<span id="261">261</span>
+<span id="262">262</span>
+<span id="263">263</span>
+<span id="264">264</span>
+<span id="265">265</span>
+<span id="266">266</span>
+<span id="267">267</span>
+<span id="268">268</span>
+<span id="269">269</span>
+<span id="270">270</span>
+<span id="271">271</span>
+<span id="272">272</span>
+<span id="273">273</span>
+<span id="274">274</span>
+<span id="275">275</span>
+<span id="276">276</span>
+<span id="277">277</span>
+<span id="278">278</span>
+<span id="279">279</span>
+<span id="280">280</span>
+<span id="281">281</span>
+<span id="282">282</span>
+<span id="283">283</span>
+<span id="284">284</span>
+<span id="285">285</span>
+<span id="286">286</span>
+<span id="287">287</span>
+<span id="288">288</span>
+<span id="289">289</span>
+<span id="290">290</span>
+<span id="291">291</span>
+<span id="292">292</span>
+<span id="293">293</span>
+<span id="294">294</span>
+<span id="295">295</span>
+<span id="296">296</span>
+<span id="297">297</span>
+<span id="298">298</span>
+<span id="299">299</span>
+<span id="300">300</span>
+<span id="301">301</span>
+<span id="302">302</span>
+<span id="303">303</span>
+<span id="304">304</span>
+<span id="305">305</span>
+<span id="306">306</span>
+<span id="307">307</span>
+<span id="308">308</span>
+<span id="309">309</span>
+<span id="310">310</span>
+<span id="311">311</span>
+<span id="312">312</span>
+<span id="313">313</span>
+<span id="314">314</span>
+<span id="315">315</span>
+<span id="316">316</span>
+<span id="317">317</span>
+<span id="318">318</span>
+<span id="319">319</span>
+<span id="320">320</span>
+<span id="321">321</span>
+<span id="322">322</span>
+<span id="323">323</span>
+<span id="324">324</span>
+<span id="325">325</span>
+<span id="326">326</span>
+<span id="327">327</span>
+<span id="328">328</span>
+<span id="329">329</span>
+<span id="330">330</span>
+<span id="331">331</span>
+<span id="332">332</span>
+<span id="333">333</span>
+<span id="334">334</span>
+<span id="335">335</span>
+<span id="336">336</span>
+<span id="337">337</span>
+<span id="338">338</span>
+<span id="339">339</span>
+<span id="340">340</span>
+<span id="341">341</span>
+<span id="342">342</span>
+<span id="343">343</span>
+<span id="344">344</span>
+<span id="345">345</span>
+<span id="346">346</span>
+<span id="347">347</span>
+<span id="348">348</span>
+<span id="349">349</span>
+<span id="350">350</span>
+<span id="351">351</span>
+<span id="352">352</span>
+<span id="353">353</span>
+<span id="354">354</span>
+<span id="355">355</span>
+<span id="356">356</span>
+<span id="357">357</span>
+<span id="358">358</span>
+<span id="359">359</span>
+<span id="360">360</span>
+<span id="361">361</span>
+<span id="362">362</span>
+<span id="363">363</span>
+<span id="364">364</span>
+<span id="365">365</span>
+<span id="366">366</span>
+<span id="367">367</span>
+<span id="368">368</span>
+<span id="369">369</span>
+<span id="370">370</span>
+<span id="371">371</span>
+<span id="372">372</span>
+<span id="373">373</span>
+<span id="374">374</span>
+<span id="375">375</span>
+<span id="376">376</span>
+<span id="377">377</span>
+<span id="378">378</span>
+<span id="379">379</span>
+<span id="380">380</span>
+<span id="381">381</span>
+<span id="382">382</span>
+<span id="383">383</span>
+<span id="384">384</span>
+<span id="385">385</span>
+<span id="386">386</span>
+<span id="387">387</span>
+<span id="388">388</span>
+<span id="389">389</span>
+<span id="390">390</span>
+<span id="391">391</span>
+<span id="392">392</span>
+<span id="393">393</span>
+<span id="394">394</span>
+<span id="395">395</span>
+<span id="396">396</span>
+<span id="397">397</span>
+<span id="398">398</span>
+<span id="399">399</span>
+<span id="400">400</span>
+<span id="401">401</span>
+<span id="402">402</span>
+<span id="403">403</span>
+<span id="404">404</span>
+<span id="405">405</span>
+<span id="406">406</span>
+<span id="407">407</span>
+<span id="408">408</span>
+<span id="409">409</span>
+<span id="410">410</span>
+<span id="411">411</span>
+<span id="412">412</span>
+<span id="413">413</span>
+<span id="414">414</span>
+<span id="415">415</span>
+<span id="416">416</span>
+<span id="417">417</span>
+<span id="418">418</span>
+<span id="419">419</span>
+<span id="420">420</span>
+<span id="421">421</span>
+<span id="422">422</span>
+<span id="423">423</span>
+<span id="424">424</span>
+<span id="425">425</span>
+<span id="426">426</span>
+<span id="427">427</span>
+<span id="428">428</span>
+<span id="429">429</span>
+<span id="430">430</span>
+<span id="431">431</span>
+<span id="432">432</span>
+<span id="433">433</span>
+<span id="434">434</span>
+<span id="435">435</span>
+<span id="436">436</span>
+<span id="437">437</span>
+<span id="438">438</span>
+<span id="439">439</span>
+<span id="440">440</span>
+<span id="441">441</span>
+<span id="442">442</span>
+<span id="443">443</span>
+<span id="444">444</span>
+<span id="445">445</span>
+<span id="446">446</span>
+<span id="447">447</span>
+<span id="448">448</span>
+<span id="449">449</span>
+<span id="450">450</span>
+<span id="451">451</span>
+<span id="452">452</span>
+<span id="453">453</span>
+<span id="454">454</span>
+<span id="455">455</span>
+<span id="456">456</span>
+<span id="457">457</span>
+<span id="458">458</span>
+<span id="459">459</span>
+<span id="460">460</span>
+<span id="461">461</span>
+<span id="462">462</span>
+<span id="463">463</span>
+<span id="464">464</span>
+<span id="465">465</span>
+<span id="466">466</span>
+<span id="467">467</span>
+<span id="468">468</span>
+<span id="469">469</span>
+<span id="470">470</span>
+<span id="471">471</span>
+<span id="472">472</span>
+<span id="473">473</span>
+<span id="474">474</span>
+<span id="475">475</span>
+<span id="476">476</span>
+<span id="477">477</span>
+<span id="478">478</span>
+<span id="479">479</span>
+<span id="480">480</span>
+<span id="481">481</span>
+<span id="482">482</span>
+<span id="483">483</span>
+<span id="484">484</span>
+<span id="485">485</span>
+<span id="486">486</span>
+<span id="487">487</span>
+<span id="488">488</span>
+<span id="489">489</span>
+<span id="490">490</span>
+<span id="491">491</span>
+<span id="492">492</span>
+<span id="493">493</span>
+<span id="494">494</span>
+<span id="495">495</span>
+<span id="496">496</span>
+<span id="497">497</span>
+<span id="498">498</span>
+<span id="499">499</span>
+<span id="500">500</span>
+<span id="501">501</span>
+<span id="502">502</span>
+<span id="503">503</span>
+<span id="504">504</span>
+<span id="505">505</span>
+<span id="506">506</span>
+<span id="507">507</span>
+<span id="508">508</span>
+<span id="509">509</span>
+<span id="510">510</span>
+<span id="511">511</span>
+<span id="512">512</span>
+<span id="513">513</span>
+<span id="514">514</span>
+<span id="515">515</span>
+<span id="516">516</span>
+<span id="517">517</span>
+<span id="518">518</span>
+<span id="519">519</span>
+<span id="520">520</span>
+<span id="521">521</span>
+<span id="522">522</span>
+<span id="523">523</span>
+<span id="524">524</span>
+<span id="525">525</span>
+<span id="526">526</span>
+<span id="527">527</span>
+<span id="528">528</span>
+<span id="529">529</span>
+<span id="530">530</span>
+<span id="531">531</span>
+<span id="532">532</span>
+<span id="533">533</span>
+<span id="534">534</span>
+<span id="535">535</span>
+<span id="536">536</span>
+<span id="537">537</span>
+<span id="538">538</span>
+<span id="539">539</span>
+<span id="540">540</span>
+<span id="541">541</span>
+<span id="542">542</span>
+<span id="543">543</span>
+<span id="544">544</span>
+<span id="545">545</span>
+<span id="546">546</span>
+<span id="547">547</span>
+<span id="548">548</span>
+<span id="549">549</span>
+<span id="550">550</span>
+<span id="551">551</span>
+<span id="552">552</span>
+<span id="553">553</span>
+<span id="554">554</span>
+<span id="555">555</span>
+<span id="556">556</span>
+<span id="557">557</span>
+<span id="558">558</span>
+<span id="559">559</span>
+<span id="560">560</span>
+<span id="561">561</span>
+<span id="562">562</span>
+<span id="563">563</span>
+<span id="564">564</span>
+<span id="565">565</span>
+<span id="566">566</span>
+<span id="567">567</span>
+<span id="568">568</span>
+<span id="569">569</span>
+<span id="570">570</span>
+<span id="571">571</span>
+<span id="572">572</span>
+<span id="573">573</span>
+<span id="574">574</span>
+<span id="575">575</span>
+<span id="576">576</span>
+<span id="577">577</span>
+<span id="578">578</span>
+<span id="579">579</span>
+<span id="580">580</span>
+<span id="581">581</span>
+<span id="582">582</span>
+<span id="583">583</span>
+<span id="584">584</span>
+<span id="585">585</span>
+<span id="586">586</span>
+<span id="587">587</span>
+<span id="588">588</span>
+<span id="589">589</span>
+<span id="590">590</span>
+<span id="591">591</span>
+<span id="592">592</span>
+<span id="593">593</span>
+<span id="594">594</span>
+<span id="595">595</span>
+<span id="596">596</span>
+<span id="597">597</span>
+<span id="598">598</span>
+<span id="599">599</span>
+<span id="600">600</span>
+<span id="601">601</span>
+<span id="602">602</span>
+<span id="603">603</span>
+<span id="604">604</span>
+<span id="605">605</span>
+<span id="606">606</span>
+<span id="607">607</span>
+<span id="608">608</span>
+<span id="609">609</span>
+<span id="610">610</span>
+<span id="611">611</span>
+<span id="612">612</span>
+<span id="613">613</span>
+<span id="614">614</span>
+<span id="615">615</span>
+<span id="616">616</span>
+<span id="617">617</span>
+<span id="618">618</span>
+<span id="619">619</span>
+<span id="620">620</span>
+<span id="621">621</span>
+<span id="622">622</span>
+<span id="623">623</span>
+<span id="624">624</span>
+<span id="625">625</span>
+<span id="626">626</span>
+<span id="627">627</span>
+<span id="628">628</span>
+<span id="629">629</span>
+<span id="630">630</span>
+<span id="631">631</span>
+<span id="632">632</span>
+<span id="633">633</span>
+<span id="634">634</span>
+<span id="635">635</span>
+<span id="636">636</span>
+<span id="637">637</span>
+<span id="638">638</span>
+<span id="639">639</span>
+<span id="640">640</span>
+<span id="641">641</span>
+<span id="642">642</span>
+<span id="643">643</span>
+<span id="644">644</span>
+<span id="645">645</span>
+<span id="646">646</span>
+<span id="647">647</span>
+<span id="648">648</span>
+<span id="649">649</span>
+<span id="650">650</span>
+<span id="651">651</span>
+<span id="652">652</span>
+<span id="653">653</span>
+<span id="654">654</span>
+<span id="655">655</span>
+<span id="656">656</span>
+<span id="657">657</span>
+<span id="658">658</span>
+<span id="659">659</span>
+<span id="660">660</span>
+<span id="661">661</span>
+<span id="662">662</span>
+<span id="663">663</span>
+<span id="664">664</span>
+<span id="665">665</span>
+<span id="666">666</span>
+<span id="667">667</span>
+<span id="668">668</span>
+<span id="669">669</span>
+<span id="670">670</span>
+<span id="671">671</span>
+<span id="672">672</span>
+<span id="673">673</span>
+<span id="674">674</span>
+<span id="675">675</span>
+<span id="676">676</span>
+<span id="677">677</span>
+<span id="678">678</span>
+<span id="679">679</span>
+<span id="680">680</span>
+<span id="681">681</span>
+<span id="682">682</span>
+<span id="683">683</span>
+<span id="684">684</span>
+<span id="685">685</span>
+<span id="686">686</span>
+<span id="687">687</span>
+<span id="688">688</span>
+<span id="689">689</span>
+<span id="690">690</span>
+<span id="691">691</span>
+<span id="692">692</span>
+<span id="693">693</span>
+<span id="694">694</span>
+<span id="695">695</span>
+<span id="696">696</span>
+<span id="697">697</span>
+<span id="698">698</span>
+<span id="699">699</span>
+<span id="700">700</span>
+<span id="701">701</span>
+<span id="702">702</span>
+<span id="703">703</span>
+<span id="704">704</span>
+<span id="705">705</span>
+<span id="706">706</span>
+<span id="707">707</span>
+<span id="708">708</span>
+<span id="709">709</span>
+<span id="710">710</span>
+<span id="711">711</span>
+<span id="712">712</span>
+<span id="713">713</span>
+<span id="714">714</span>
+<span id="715">715</span>
+<span id="716">716</span>
+<span id="717">717</span>
+<span id="718">718</span>
+<span id="719">719</span>
+<span id="720">720</span>
+<span id="721">721</span>
+<span id="722">722</span>
+<span id="723">723</span>
+<span id="724">724</span>
+<span id="725">725</span>
+<span id="726">726</span>
+<span id="727">727</span>
+<span id="728">728</span>
+<span id="729">729</span>
+<span id="730">730</span>
+<span id="731">731</span>
+<span id="732">732</span>
+<span id="733">733</span>
+<span id="734">734</span>
+<span id="735">735</span>
+<span id="736">736</span>
+<span id="737">737</span>
+<span id="738">738</span>
+<span id="739">739</span>
+<span id="740">740</span>
+<span id="741">741</span>
+<span id="742">742</span>
+<span id="743">743</span>
+<span id="744">744</span>
+<span id="745">745</span>
+<span id="746">746</span>
+<span id="747">747</span>
+<span id="748">748</span>
+<span id="749">749</span>
+<span id="750">750</span>
+<span id="751">751</span>
+<span id="752">752</span>
+<span id="753">753</span>
+<span id="754">754</span>
+<span id="755">755</span>
+<span id="756">756</span>
+<span id="757">757</span>
+<span id="758">758</span>
+<span id="759">759</span>
+<span id="760">760</span>
+<span id="761">761</span>
+<span id="762">762</span>
+<span id="763">763</span>
+<span id="764">764</span>
+<span id="765">765</span>
+<span id="766">766</span>
+<span id="767">767</span>
+<span id="768">768</span>
+<span id="769">769</span>
+<span id="770">770</span>
+<span id="771">771</span>
+<span id="772">772</span>
+<span id="773">773</span>
+<span id="774">774</span>
+<span id="775">775</span>
+<span id="776">776</span>
+<span id="777">777</span>
+<span id="778">778</span>
+<span id="779">779</span>
+<span id="780">780</span>
+<span id="781">781</span>
+<span id="782">782</span>
+<span id="783">783</span>
+<span id="784">784</span>
+<span id="785">785</span>
+<span id="786">786</span>
+<span id="787">787</span>
+<span id="788">788</span>
+<span id="789">789</span>
+<span id="790">790</span>
+<span id="791">791</span>
+<span id="792">792</span>
+<span id="793">793</span>
+<span id="794">794</span>
+<span id="795">795</span>
+<span id="796">796</span>
+<span id="797">797</span>
+<span id="798">798</span>
+<span id="799">799</span>
+<span id="800">800</span>
+<span id="801">801</span>
+<span id="802">802</span>
+<span id="803">803</span>
+<span id="804">804</span>
+<span id="805">805</span>
+<span id="806">806</span>
+<span id="807">807</span>
+<span id="808">808</span>
+<span id="809">809</span>
+<span id="810">810</span>
+<span id="811">811</span>
+<span id="812">812</span>
+<span id="813">813</span>
+<span id="814">814</span>
+<span id="815">815</span>
+<span id="816">816</span>
+<span id="817">817</span>
+<span id="818">818</span>
+<span id="819">819</span>
+<span id="820">820</span>
+<span id="821">821</span>
+<span id="822">822</span>
+<span id="823">823</span>
+<span id="824">824</span>
+<span id="825">825</span>
+<span id="826">826</span>
+<span id="827">827</span>
+<span id="828">828</span>
+<span id="829">829</span>
+<span id="830">830</span>
+<span id="831">831</span>
+<span id="832">832</span>
+<span id="833">833</span>
+<span id="834">834</span>
+<span id="835">835</span>
+<span id="836">836</span>
+<span id="837">837</span>
+<span id="838">838</span>
+<span id="839">839</span>
+<span id="840">840</span>
+<span id="841">841</span>
+<span id="842">842</span>
+<span id="843">843</span>
+<span id="844">844</span>
+<span id="845">845</span>
+<span id="846">846</span>
+<span id="847">847</span>
+<span id="848">848</span>
+<span id="849">849</span>
+<span id="850">850</span>
+<span id="851">851</span>
+<span id="852">852</span>
+<span id="853">853</span>
+<span id="854">854</span>
+<span id="855">855</span>
+<span id="856">856</span>
+<span id="857">857</span>
+<span id="858">858</span>
+<span id="859">859</span>
+<span id="860">860</span>
+<span id="861">861</span>
+<span id="862">862</span>
+<span id="863">863</span>
+<span id="864">864</span>
+<span id="865">865</span>
+<span id="866">866</span>
+<span id="867">867</span>
+<span id="868">868</span>
+<span id="869">869</span>
+<span id="870">870</span>
+<span id="871">871</span>
+<span id="872">872</span>
+<span id="873">873</span>
+<span id="874">874</span>
+<span id="875">875</span>
+<span id="876">876</span>
+<span id="877">877</span>
+<span id="878">878</span>
+<span id="879">879</span>
+<span id="880">880</span>
+<span id="881">881</span>
+<span id="882">882</span>
+<span id="883">883</span>
+<span id="884">884</span>
+<span id="885">885</span>
+<span id="886">886</span>
+<span id="887">887</span>
+<span id="888">888</span>
+<span id="889">889</span>
+<span id="890">890</span>
+<span id="891">891</span>
+<span id="892">892</span>
+<span id="893">893</span>
+<span id="894">894</span>
+<span id="895">895</span>
+<span id="896">896</span>
+<span id="897">897</span>
+<span id="898">898</span>
+<span id="899">899</span>
+<span id="900">900</span>
+<span id="901">901</span>
+<span id="902">902</span>
+<span id="903">903</span>
+<span id="904">904</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">convert</span>::<span class="ident">TryInto</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::{<span class="ident">Read</span>, <span class="ident">Write</span>};
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">marker</span>::<span class="ident">PhantomData</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ops</span>::<span class="ident">Deref</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">RwLock</span>;
+
+<span class="kw">use</span> <span class="ident">rand</span>::<span class="ident">distributions</span>::<span class="ident">Alphanumeric</span>;
+<span class="kw">use</span> <span class="ident">rand</span>::{<span class="ident">thread_rng</span>, <span class="ident">Rng</span>};
+
+<span class="kw">use</span> <span class="ident">rocksdb</span>::{<span class="ident">Direction</span>, <span class="ident">IteratorMode</span>, <span class="ident">ReadOptions</span>, <span class="ident">WriteBatch</span>, <span class="ident">DB</span>};
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::{<span class="ident">deserialize</span>, <span class="ident">encode</span>::<span class="ident">VarInt</span>, <span class="ident">serialize</span>, <span class="ident">Decodable</span>, <span class="ident">Encodable</span>};
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hash_types</span>::<span class="ident">FilterHash</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">FromHex</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::{<span class="ident">sha256d</span>, <span class="ident">Hash</span>};
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip158</span>::<span class="ident">BlockFilter</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">uint</span>::<span class="ident">Uint256</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">Block</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">BlockHash</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">BlockHeader</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">Network</span>;
+
+<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">CompactFiltersError</span>;
+
+<span class="macro">lazy_static</span><span class="macro">!</span> {
+ <span class="kw">static</span> <span class="kw-2">ref</span> <span class="ident">MAINNET_GENESIS</span>: <span class="ident">Block</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"0100000000000000000000000000000000000000000000000000000000000000000000003BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A29AB5F49FFFF001D1DAC2B7C0101000000010000000000000000000000000000000000000000000000000000000000000000FFFFFFFF4D04FFFF001D0104455468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73FFFFFFFF0100F2052A01000000434104678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5FAC00000000"</span>).<span class="ident">unwrap</span>()).<span class="ident">unwrap</span>();
+ <span class="kw">static</span> <span class="kw-2">ref</span> <span class="ident">TESTNET_GENESIS</span>: <span class="ident">Block</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"0100000000000000000000000000000000000000000000000000000000000000000000003BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4ADAE5494DFFFF001D1AA4AE180101000000010000000000000000000000000000000000000000000000000000000000000000FFFFFFFF4D04FFFF001D0104455468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73FFFFFFFF0100F2052A01000000434104678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5FAC00000000"</span>).<span class="ident">unwrap</span>()).<span class="ident">unwrap</span>();
+ <span class="kw">static</span> <span class="kw-2">ref</span> <span class="ident">REGTEST_GENESIS</span>: <span class="ident">Block</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"0100000000000000000000000000000000000000000000000000000000000000000000003BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4ADAE5494DFFFF7F20020000000101000000010000000000000000000000000000000000000000000000000000000000000000FFFFFFFF4D04FFFF001D0104455468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73FFFFFFFF0100F2052A01000000434104678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5FAC00000000"</span>).<span class="ident">unwrap</span>()).<span class="ident">unwrap</span>();
+}
+
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">StoreType</span>: <span class="ident">Default</span> <span class="op">+</span> <span class="ident">fmt</span>::<span class="ident">Debug</span> {}
+
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Default</span>, <span class="ident">Debug</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Full</span>;
+<span class="kw">impl</span> <span class="ident">StoreType</span> <span class="kw">for</span> <span class="ident">Full</span> {}
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Default</span>, <span class="ident">Debug</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Snapshot</span>;
+<span class="kw">impl</span> <span class="ident">StoreType</span> <span class="kw">for</span> <span class="ident">Snapshot</span> {}
+
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">StoreEntry</span> {
+ <span class="ident">BlockHeader</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>),
+ <span class="ident">Block</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>),
+ <span class="ident">BlockHeaderIndex</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">BlockHash</span><span class="op">></span>),
+ <span class="ident">CFilterTable</span>((<span class="ident">u8</span>, <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>)),
+}
+
+<span class="kw">impl</span> <span class="ident">StoreEntry</span> {
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_prefix</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span> {
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="string">b"z"</span>,
+ <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="string">b"x"</span>,
+ <span class="ident">StoreEntry</span>::<span class="ident">BlockHeaderIndex</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="string">b"i"</span>,
+ <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="string">b"t"</span>,
+ }
+ .<span class="ident">to_vec</span>()
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_key</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">prefix</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_prefix</span>();
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">height</span>)) <span class="op">=</span><span class="op">></span> {
+ <span class="ident">prefix</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">height</span>.<span class="ident">to_be_bytes</span>())
+ }
+ <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="prelude-val">Some</span>(<span class="ident">height</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">prefix</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">height</span>.<span class="ident">to_be_bytes</span>()),
+ <span class="ident">StoreEntry</span>::<span class="ident">BlockHeaderIndex</span>(<span class="prelude-val">Some</span>(<span class="ident">hash</span>)) <span class="op">=</span><span class="op">></span> {
+ <span class="ident">prefix</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">hash</span>.<span class="ident">into_inner</span>())
+ }
+ <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="ident">filter_type</span>, <span class="ident">bundle_index</span>)) <span class="op">=</span><span class="op">></span> {
+ <span class="ident">prefix</span>.<span class="ident">push</span>(<span class="kw-2">*</span><span class="ident">filter_type</span>);
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">bundle_index</span>) <span class="op">=</span> <span class="ident">bundle_index</span> {
+ <span class="ident">prefix</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">bundle_index</span>.<span class="ident">to_be_bytes</span>());
+ }
+ }
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> {}
+ }
+
+ <span class="ident">prefix</span>
+ }
+}
+
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">SerializeDb</span>: <span class="ident">Sized</span> {
+ <span class="kw">fn</span> <span class="ident">serialize</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>;
+ <span class="kw">fn</span> <span class="ident">deserialize</span>(<span class="ident">data</span>: <span class="kw-2">&</span>[<span class="ident">u8</span>]) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>;
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">T</span><span class="op">></span> <span class="ident">SerializeDb</span> <span class="kw">for</span> <span class="ident">T</span>
+<span class="kw">where</span>
+ <span class="ident">T</span>: <span class="ident">Encodable</span> <span class="op">+</span> <span class="ident">Decodable</span>,
+{
+ <span class="kw">fn</span> <span class="ident">serialize</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span> {
+ <span class="ident">serialize</span>(<span class="self">self</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">deserialize</span>(<span class="ident">data</span>: <span class="kw-2">&</span>[<span class="ident">u8</span>]) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">deserialize</span>(<span class="ident">data</span>).<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">Encodable</span> <span class="kw">for</span> <span class="ident">FilterHeader</span> {
+ <span class="kw">fn</span> <span class="ident">consensus_encode</span><span class="op"><</span><span class="ident">W</span>: <span class="ident">Write</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="kw-2">mut</span> <span class="ident">e</span>: <span class="ident">W</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">usize</span>, <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">written</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">prev_header_hash</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
+ <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="self">self</span>.<span class="ident">filter_hash</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
+ <span class="prelude-val">Ok</span>(<span class="ident">written</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">Decodable</span> <span class="kw">for</span> <span class="ident">FilterHeader</span> {
+ <span class="kw">fn</span> <span class="ident">consensus_decode</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Read</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">d</span>: <span class="ident">D</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">prev_header_hash</span> <span class="op">=</span> <span class="ident">FilterHeaderHash</span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">filter_hash</span> <span class="op">=</span> <span class="ident">FilterHash</span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">FilterHeader</span> {
+ <span class="ident">prev_header_hash</span>,
+ <span class="ident">filter_hash</span>,
+ })
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">Encodable</span> <span class="kw">for</span> <span class="ident">BundleStatus</span> {
+ <span class="kw">fn</span> <span class="ident">consensus_encode</span><span class="op"><</span><span class="ident">W</span>: <span class="ident">Write</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="kw-2">mut</span> <span class="ident">e</span>: <span class="ident">W</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">usize</span>, <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">written</span> <span class="op">=</span> <span class="number">0</span>;
+
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">BundleStatus</span>::<span class="ident">Init</span> <span class="op">=</span><span class="op">></span> {
+ <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="number">0x00u8</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
+ }
+ <span class="ident">BundleStatus</span>::<span class="ident">CFHeaders</span> { <span class="ident">cf_headers</span> } <span class="op">=</span><span class="op">></span> {
+ <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="number">0x01u8</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
+ <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="ident">VarInt</span>(<span class="ident">cf_headers</span>.<span class="ident">len</span>() <span class="kw">as</span> <span class="ident">u64</span>).<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
+ <span class="kw">for</span> <span class="ident">header</span> <span class="kw">in</span> <span class="ident">cf_headers</span> {
+ <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="ident">header</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
+ }
+ }
+ <span class="ident">BundleStatus</span>::<span class="ident">CFilters</span> { <span class="ident">cf_filters</span> } <span class="op">=</span><span class="op">></span> {
+ <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="number">0x02u8</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
+ <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="ident">VarInt</span>(<span class="ident">cf_filters</span>.<span class="ident">len</span>() <span class="kw">as</span> <span class="ident">u64</span>).<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
+ <span class="kw">for</span> <span class="ident">filter</span> <span class="kw">in</span> <span class="ident">cf_filters</span> {
+ <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="ident">filter</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
+ }
+ }
+ <span class="ident">BundleStatus</span>::<span class="ident">Processed</span> { <span class="ident">cf_filters</span> } <span class="op">=</span><span class="op">></span> {
+ <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="number">0x03u8</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
+ <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="ident">VarInt</span>(<span class="ident">cf_filters</span>.<span class="ident">len</span>() <span class="kw">as</span> <span class="ident">u64</span>).<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
+ <span class="kw">for</span> <span class="ident">filter</span> <span class="kw">in</span> <span class="ident">cf_filters</span> {
+ <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="ident">filter</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
+ }
+ }
+ <span class="ident">BundleStatus</span>::<span class="ident">Pruned</span> <span class="op">=</span><span class="op">></span> {
+ <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="number">0x04u8</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
+ }
+ <span class="ident">BundleStatus</span>::<span class="ident">Tip</span> { <span class="ident">cf_filters</span> } <span class="op">=</span><span class="op">></span> {
+ <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="number">0x05u8</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
+ <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="ident">VarInt</span>(<span class="ident">cf_filters</span>.<span class="ident">len</span>() <span class="kw">as</span> <span class="ident">u64</span>).<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
+ <span class="kw">for</span> <span class="ident">filter</span> <span class="kw">in</span> <span class="ident">cf_filters</span> {
+ <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="ident">filter</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
+ }
+ }
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">written</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">Decodable</span> <span class="kw">for</span> <span class="ident">BundleStatus</span> {
+ <span class="kw">fn</span> <span class="ident">consensus_decode</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Read</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">d</span>: <span class="ident">D</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">byte_type</span> <span class="op">=</span> <span class="ident">u8</span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>;
+ <span class="kw">match</span> <span class="ident">byte_type</span> {
+ <span class="number">0x00</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">BundleStatus</span>::<span class="ident">Init</span>),
+ <span class="number">0x01</span> <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">VarInt</span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">num</span>.<span class="number">0</span> <span class="kw">as</span> <span class="ident">usize</span>;
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cf_headers</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">num</span>);
+ <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">num</span> {
+ <span class="ident">cf_headers</span>.<span class="ident">push</span>(<span class="ident">FilterHeader</span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>);
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">BundleStatus</span>::<span class="ident">CFHeaders</span> { <span class="ident">cf_headers</span> })
+ }
+ <span class="number">0x02</span> <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">VarInt</span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">num</span>.<span class="number">0</span> <span class="kw">as</span> <span class="ident">usize</span>;
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cf_filters</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">num</span>);
+ <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">num</span> {
+ <span class="ident">cf_filters</span>.<span class="ident">push</span>(<span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>);
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">BundleStatus</span>::<span class="ident">CFilters</span> { <span class="ident">cf_filters</span> })
+ }
+ <span class="number">0x03</span> <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">VarInt</span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">num</span>.<span class="number">0</span> <span class="kw">as</span> <span class="ident">usize</span>;
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cf_filters</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">num</span>);
+ <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">num</span> {
+ <span class="ident">cf_filters</span>.<span class="ident">push</span>(<span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>);
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">BundleStatus</span>::<span class="ident">Processed</span> { <span class="ident">cf_filters</span> })
+ }
+ <span class="number">0x04</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">BundleStatus</span>::<span class="ident">Pruned</span>),
+ <span class="number">0x05</span> <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">VarInt</span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">num</span>.<span class="number">0</span> <span class="kw">as</span> <span class="ident">usize</span>;
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cf_filters</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">num</span>);
+ <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">num</span> {
+ <span class="ident">cf_filters</span>.<span class="ident">push</span>(<span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>);
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">BundleStatus</span>::<span class="ident">Tip</span> { <span class="ident">cf_filters</span> })
+ }
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span>::<span class="ident">ParseFailed</span>(
+ <span class="string">"Invalid byte type"</span>,
+ )),
+ }
+ }
+}
+
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">ChainStore</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">StoreType</span><span class="op">></span> {
+ <span class="ident">store</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">RwLock</span><span class="op"><</span><span class="ident">DB</span><span class="op">></span><span class="op">></span>,
+ <span class="ident">cf_name</span>: <span class="ident">String</span>,
+ <span class="ident">min_height</span>: <span class="ident">usize</span>,
+ <span class="ident">network</span>: <span class="ident">Network</span>,
+ <span class="ident">phantom</span>: <span class="ident">PhantomData</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>,
+}
+
+<span class="kw">impl</span> <span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Full</span><span class="op">></span> {
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">store</span>: <span class="ident">DB</span>, <span class="ident">network</span>: <span class="ident">Network</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">genesis</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">network</span> {
+ <span class="ident">Network</span>::<span class="ident">Bitcoin</span> <span class="op">=</span><span class="op">></span> <span class="ident">MAINNET_GENESIS</span>.<span class="ident">deref</span>(),
+ <span class="ident">Network</span>::<span class="ident">Testnet</span> <span class="op">=</span><span class="op">></span> <span class="ident">TESTNET_GENESIS</span>.<span class="ident">deref</span>(),
+ <span class="ident">Network</span>::<span class="ident">Regtest</span> <span class="op">=</span><span class="op">></span> <span class="ident">REGTEST_GENESIS</span>.<span class="ident">deref</span>(),
+ };
+
+ <span class="kw">let</span> <span class="ident">cf_name</span> <span class="op">=</span> <span class="string">"default"</span>.<span class="ident">to_string</span>();
+ <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">genesis_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="number">0</span>)).<span class="ident">get_key</span>();
+
+ <span class="kw">if</span> <span class="ident">store</span>.<span class="ident">get_pinned_cf</span>(<span class="ident">cf_handle</span>, <span class="kw-2">&</span><span class="ident">genesis_key</span>)<span class="question-mark">?</span>.<span class="ident">is_none</span>() {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">WriteBatch</span>::<span class="ident">default</span>();
+ <span class="ident">batch</span>.<span class="ident">put_cf</span>(
+ <span class="ident">cf_handle</span>,
+ <span class="ident">genesis_key</span>,
+ (<span class="ident">genesis</span>.<span class="ident">header</span>, <span class="ident">genesis</span>.<span class="ident">header</span>.<span class="ident">work</span>()).<span class="ident">serialize</span>(),
+ );
+ <span class="ident">batch</span>.<span class="ident">put_cf</span>(
+ <span class="ident">cf_handle</span>,
+ <span class="ident">StoreEntry</span>::<span class="ident">BlockHeaderIndex</span>(<span class="prelude-val">Some</span>(<span class="ident">genesis</span>.<span class="ident">block_hash</span>())).<span class="ident">get_key</span>(),
+ <span class="kw-2">&</span><span class="number">0usize</span>.<span class="ident">to_be_bytes</span>(),
+ );
+ <span class="ident">store</span>.<span class="ident">write</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">ChainStore</span> {
+ <span class="ident">store</span>: <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">RwLock</span>::<span class="ident">new</span>(<span class="ident">store</span>)),
+ <span class="ident">cf_name</span>,
+ <span class="ident">min_height</span>: <span class="number">0</span>,
+ <span class="ident">network</span>,
+ <span class="ident">phantom</span>: <span class="ident">PhantomData</span>,
+ })
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_locators</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span>(<span class="ident">BlockHash</span>, <span class="ident">usize</span>)<span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">step</span> <span class="op">=</span> <span class="number">1</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">index</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_height</span>()<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">answer</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
+
+ <span class="kw">let</span> <span class="ident">store_read</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">store_read</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">loop</span> {
+ <span class="kw">if</span> <span class="ident">answer</span>.<span class="ident">len</span>() <span class="op">></span> <span class="number">10</span> {
+ <span class="ident">step</span> <span class="kw-2">*</span><span class="op">=</span> <span class="number">2</span>;
+ }
+
+ <span class="kw">let</span> (<span class="ident">header</span>, <span class="kw">_</span>): (<span class="ident">BlockHeader</span>, <span class="ident">Uint256</span>) <span class="op">=</span> <span class="ident">SerializeDb</span>::<span class="ident">deserialize</span>(
+ <span class="kw-2">&</span><span class="ident">store_read</span>
+ .<span class="ident">get_pinned_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">index</span>)).<span class="ident">get_key</span>())<span class="question-mark">?</span>
+ .<span class="ident">unwrap</span>(),
+ )<span class="question-mark">?</span>;
+ <span class="ident">answer</span>.<span class="ident">push</span>((<span class="ident">header</span>.<span class="ident">block_hash</span>(), <span class="ident">index</span>));
+
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">new_index</span>) <span class="op">=</span> <span class="ident">index</span>.<span class="ident">checked_sub</span>(<span class="ident">step</span>) {
+ <span class="ident">index</span> <span class="op">=</span> <span class="ident">new_index</span>;
+ } <span class="kw">else</span> {
+ <span class="kw">break</span>;
+ }
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">answer</span>)
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">start_snapshot</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">from</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Snapshot</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">new_cf_name</span>: <span class="ident">String</span> <span class="op">=</span> <span class="ident">thread_rng</span>().<span class="ident">sample_iter</span>(<span class="kw-2">&</span><span class="ident">Alphanumeric</span>).<span class="ident">take</span>(<span class="number">16</span>).<span class="ident">collect</span>();
+ <span class="kw">let</span> <span class="ident">new_cf_name</span> <span class="op">=</span> <span class="macro">format</span><span class="macro">!</span>(<span class="string">"_headers:{}"</span>, <span class="ident">new_cf_name</span>);
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">write_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">write</span>().<span class="ident">unwrap</span>();
+
+ <span class="ident">write_store</span>.<span class="ident">create_cf</span>(<span class="kw-2">&</span><span class="ident">new_cf_name</span>, <span class="kw-2">&</span><span class="ident">Default</span>::<span class="ident">default</span>())<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">write_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">new_cf_handle</span> <span class="op">=</span> <span class="ident">write_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="ident">new_cf_name</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> (<span class="ident">header</span>, <span class="ident">work</span>): (<span class="ident">BlockHeader</span>, <span class="ident">Uint256</span>) <span class="op">=</span> <span class="ident">SerializeDb</span>::<span class="ident">deserialize</span>(
+ <span class="kw-2">&</span><span class="ident">write_store</span>
+ .<span class="ident">get_pinned_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">from</span>)).<span class="ident">get_key</span>())<span class="question-mark">?</span>
+ .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>,
+ )<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">WriteBatch</span>::<span class="ident">default</span>();
+ <span class="ident">batch</span>.<span class="ident">put_cf</span>(
+ <span class="ident">new_cf_handle</span>,
+ <span class="ident">StoreEntry</span>::<span class="ident">BlockHeaderIndex</span>(<span class="prelude-val">Some</span>(<span class="ident">header</span>.<span class="ident">block_hash</span>())).<span class="ident">get_key</span>(),
+ <span class="kw-2">&</span><span class="ident">from</span>.<span class="ident">to_be_bytes</span>(),
+ );
+ <span class="ident">batch</span>.<span class="ident">put_cf</span>(
+ <span class="ident">new_cf_handle</span>,
+ <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">from</span>)).<span class="ident">get_key</span>(),
+ (<span class="ident">header</span>, <span class="ident">work</span>).<span class="ident">serialize</span>(),
+ );
+ <span class="ident">write_store</span>.<span class="ident">write</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="ident">store</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">store</span>);
+ <span class="prelude-val">Ok</span>(<span class="ident">ChainStore</span> {
+ <span class="ident">store</span>,
+ <span class="ident">cf_name</span>: <span class="ident">new_cf_name</span>,
+ <span class="ident">min_height</span>: <span class="ident">from</span>,
+ <span class="ident">network</span>: <span class="self">self</span>.<span class="ident">network</span>,
+ <span class="ident">phantom</span>: <span class="ident">PhantomData</span>,
+ })
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">recover_snapshot</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">cf_name</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">write_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">write</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">snapshot_cf_handle</span> <span class="op">=</span> <span class="ident">write_store</span>.<span class="ident">cf_handle</span>(<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">prefix</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">None</span>).<span class="ident">get_key</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iterator</span> <span class="op">=</span> <span class="ident">write_store</span>.<span class="ident">prefix_iterator_cf</span>(<span class="ident">snapshot_cf_handle</span>, <span class="ident">prefix</span>);
+
+ <span class="kw">let</span> <span class="ident">min_height</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">iterator</span>
+ .<span class="ident">next</span>()
+ .<span class="ident">and_then</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">k</span>[<span class="number">1</span>..].<span class="ident">try_into</span>().<span class="ident">ok</span>())
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">bytes</span><span class="op">|</span> <span class="ident">usize</span>::<span class="ident">from_be_bytes</span>(<span class="ident">bytes</span>))
+ {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> {
+ <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">iterator</span>);
+ <span class="ident">write_store</span>.<span class="ident">drop_cf</span>(<span class="ident">cf_name</span>).<span class="ident">ok</span>();
+
+ <span class="kw">return</span> <span class="prelude-val">Ok</span>(());
+ }
+ <span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="op">=</span><span class="op">></span> <span class="ident">x</span>,
+ };
+ <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">iterator</span>);
+ <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">write_store</span>);
+
+ <span class="kw">let</span> <span class="ident">snapshot</span> <span class="op">=</span> <span class="ident">ChainStore</span> {
+ <span class="ident">store</span>: <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">store</span>),
+ <span class="ident">cf_name</span>: <span class="ident">cf_name</span>.<span class="ident">into</span>(),
+ <span class="ident">min_height</span>,
+ <span class="ident">network</span>: <span class="self">self</span>.<span class="ident">network</span>,
+ <span class="ident">phantom</span>: <span class="ident">PhantomData</span>,
+ };
+ <span class="kw">if</span> <span class="ident">snapshot</span>.<span class="ident">work</span>()<span class="question-mark">?</span> <span class="op">></span> <span class="self">self</span>.<span class="ident">work</span>()<span class="question-mark">?</span> {
+ <span class="self">self</span>.<span class="ident">apply_snapshot</span>(<span class="ident">snapshot</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">apply_snapshot</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">snaphost</span>: <span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Snapshot</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">WriteBatch</span>::<span class="ident">default</span>();
+
+ <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">snapshot_cf_handle</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="ident">snaphost</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">from_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">snaphost</span>.<span class="ident">min_height</span>)).<span class="ident">get_key</span>();
+ <span class="kw">let</span> <span class="ident">to_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">usize</span>::<span class="ident">MAX</span>)).<span class="ident">get_key</span>();
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">opts</span> <span class="op">=</span> <span class="ident">ReadOptions</span>::<span class="ident">default</span>();
+ <span class="ident">opts</span>.<span class="ident">set_iterate_upper_bound</span>(<span class="ident">to_key</span>.<span class="ident">clone</span>());
+
+ <span class="ident">log</span>::<span class="macro">debug</span><span class="macro">!</span>(<span class="string">"Removing items"</span>);
+ <span class="ident">batch</span>.<span class="ident">delete_range_cf</span>(<span class="ident">cf_handle</span>, <span class="kw-2">&</span><span class="ident">from_key</span>, <span class="kw-2">&</span><span class="ident">to_key</span>);
+ <span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">v</span>) <span class="kw">in</span> <span class="ident">read_store</span>.<span class="ident">iterator_cf_opt</span>(
+ <span class="ident">cf_handle</span>,
+ <span class="ident">opts</span>,
+ <span class="ident">IteratorMode</span>::<span class="ident">From</span>(<span class="kw-2">&</span><span class="ident">from_key</span>, <span class="ident">Direction</span>::<span class="ident">Forward</span>),
+ ) {
+ <span class="kw">let</span> (<span class="ident">header</span>, <span class="kw">_</span>): (<span class="ident">BlockHeader</span>, <span class="ident">Uint256</span>) <span class="op">=</span> <span class="ident">SerializeDb</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">v</span>)<span class="question-mark">?</span>;
+
+ <span class="ident">batch</span>.<span class="ident">delete_cf</span>(
+ <span class="ident">cf_handle</span>,
+ <span class="ident">StoreEntry</span>::<span class="ident">BlockHeaderIndex</span>(<span class="prelude-val">Some</span>(<span class="ident">header</span>.<span class="ident">block_hash</span>())).<span class="ident">get_key</span>(),
+ );
+ }
+
+ <span class="comment">// Delete full blocks overriden by snapshot</span>
+ <span class="kw">let</span> <span class="ident">from_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="prelude-val">Some</span>(<span class="ident">snaphost</span>.<span class="ident">min_height</span>)).<span class="ident">get_key</span>();
+ <span class="kw">let</span> <span class="ident">to_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="prelude-val">Some</span>(<span class="ident">usize</span>::<span class="ident">MAX</span>)).<span class="ident">get_key</span>();
+ <span class="ident">batch</span>.<span class="ident">delete_range</span>(<span class="kw-2">&</span><span class="ident">from_key</span>, <span class="kw-2">&</span><span class="ident">to_key</span>);
+
+ <span class="ident">log</span>::<span class="macro">debug</span><span class="macro">!</span>(<span class="string">"Copying over new items"</span>);
+ <span class="kw">for</span> (<span class="ident">k</span>, <span class="ident">v</span>) <span class="kw">in</span> <span class="ident">read_store</span>.<span class="ident">iterator_cf</span>(<span class="ident">snapshot_cf_handle</span>, <span class="ident">IteratorMode</span>::<span class="ident">Start</span>) {
+ <span class="ident">batch</span>.<span class="ident">put_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">k</span>, <span class="ident">v</span>);
+ }
+
+ <span class="ident">read_store</span>.<span class="ident">write</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>;
+
+ <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">snapshot_cf_handle</span>);
+ <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">cf_handle</span>);
+ <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">read_store</span>);
+
+ <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">write</span>().<span class="ident">unwrap</span>().<span class="ident">drop_cf</span>(<span class="kw-2">&</span><span class="ident">snaphost</span>.<span class="ident">cf_name</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_height_for</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">block_hash</span>: <span class="kw-2">&</span><span class="ident">BlockHash</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeaderIndex</span>(<span class="prelude-val">Some</span>(<span class="ident">block_hash</span>.<span class="ident">clone</span>())).<span class="ident">get_key</span>();
+ <span class="kw">let</span> <span class="ident">data</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">get_pinned_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">key</span>)<span class="question-mark">?</span>;
+ <span class="prelude-val">Ok</span>(<span class="ident">data</span>
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">data</span><span class="op">|</span> {
+ <span class="prelude-val">Ok</span>::<span class="op"><</span><span class="kw">_</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>(<span class="ident">usize</span>::<span class="ident">from_be_bytes</span>(
+ <span class="ident">data</span>.<span class="ident">as_ref</span>()
+ .<span class="ident">try_into</span>()
+ .<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>,
+ ))
+ })
+ .<span class="ident">transpose</span>()<span class="question-mark">?</span>)
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_block_hash</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">height</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">BlockHash</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">height</span>)).<span class="ident">get_key</span>();
+ <span class="kw">let</span> <span class="ident">data</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">get_pinned_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">key</span>)<span class="question-mark">?</span>;
+ <span class="prelude-val">Ok</span>(<span class="ident">data</span>
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">data</span><span class="op">|</span> {
+ <span class="kw">let</span> (<span class="ident">header</span>, <span class="kw">_</span>): (<span class="ident">BlockHeader</span>, <span class="ident">Uint256</span>) <span class="op">=</span>
+ <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">data</span>).<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>;
+ <span class="prelude-val">Ok</span>::<span class="op"><</span><span class="kw">_</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>(<span class="ident">header</span>.<span class="ident">block_hash</span>())
+ })
+ .<span class="ident">transpose</span>()<span class="question-mark">?</span>)
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">save_full_block</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">block</span>: <span class="kw-2">&</span><span class="ident">Block</span>, <span class="ident">height</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="prelude-val">Some</span>(<span class="ident">height</span>)).<span class="ident">get_key</span>();
+ <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>().<span class="ident">put</span>(<span class="ident">key</span>, <span class="ident">block</span>.<span class="ident">serialize</span>())<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_full_block</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">height</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Block</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="prelude-val">Some</span>(<span class="ident">height</span>)).<span class="ident">get_key</span>();
+ <span class="kw">let</span> <span class="ident">opt_block</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">get_pinned</span>(<span class="ident">key</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">opt_block</span>
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">data</span><span class="op">|</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">data</span>))
+ .<span class="ident">transpose</span>()
+ .<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>)
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">delete_blocks_until</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">height</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">from_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="prelude-val">Some</span>(<span class="number">0</span>)).<span class="ident">get_key</span>();
+ <span class="kw">let</span> <span class="ident">to_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="prelude-val">Some</span>(<span class="ident">height</span>)).<span class="ident">get_key</span>();
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">WriteBatch</span>::<span class="ident">default</span>();
+ <span class="ident">batch</span>.<span class="ident">delete_range</span>(<span class="kw-2">&</span><span class="ident">from_key</span>, <span class="kw-2">&</span><span class="ident">to_key</span>);
+
+ <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>().<span class="ident">write</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">iter_full_blocks</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span>(<span class="ident">usize</span>, <span class="ident">Block</span>)<span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">prefix</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="prelude-val">None</span>).<span class="ident">get_key</span>();
+
+ <span class="kw">let</span> <span class="ident">iterator</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">prefix_iterator</span>(<span class="kw-2">&</span><span class="ident">prefix</span>);
+ <span class="comment">// FIXME: we have to filter manually because rocksdb sometimes returns stuff that doesn't</span>
+ <span class="comment">// have the right prefix</span>
+ <span class="ident">iterator</span>
+ .<span class="ident">filter</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">k</span>.<span class="ident">starts_with</span>(<span class="kw-2">&</span><span class="ident">prefix</span>))
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="ident">v</span>)<span class="op">|</span> {
+ <span class="kw">let</span> <span class="ident">height</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="ident">usize</span>::<span class="ident">from_be_bytes</span>(
+ <span class="ident">k</span>[<span class="number">1</span>..]
+ .<span class="ident">try_into</span>()
+ .<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>,
+ );
+ <span class="kw">let</span> <span class="ident">block</span> <span class="op">=</span> <span class="ident">SerializeDb</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">v</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>((<span class="ident">height</span>, <span class="ident">block</span>))
+ })
+ .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()
+ }
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">StoreType</span><span class="op">></span> <span class="ident">ChainStore</span><span class="op"><</span><span class="ident">T</span><span class="op">></span> {
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">work</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Uint256</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">prefix</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">None</span>).<span class="ident">get_key</span>();
+ <span class="kw">let</span> <span class="ident">iterator</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">prefix_iterator_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">prefix</span>);
+
+ <span class="prelude-val">Ok</span>(<span class="ident">iterator</span>
+ .<span class="ident">last</span>()
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">v</span>)<span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> (<span class="kw">_</span>, <span class="ident">work</span>): (<span class="ident">BlockHeader</span>, <span class="ident">Uint256</span>) <span class="op">=</span> <span class="ident">SerializeDb</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">v</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">work</span>)
+ })
+ .<span class="ident">transpose</span>()<span class="question-mark">?</span>
+ .<span class="ident">unwrap_or_default</span>())
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_height</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">usize</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">prefix</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">None</span>).<span class="ident">get_key</span>();
+ <span class="kw">let</span> <span class="ident">iterator</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">prefix_iterator_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">prefix</span>);
+
+ <span class="prelude-val">Ok</span>(<span class="ident">iterator</span>
+ .<span class="ident">last</span>()
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">height</span> <span class="op">=</span> <span class="ident">usize</span>::<span class="ident">from_be_bytes</span>(
+ <span class="ident">k</span>[<span class="number">1</span>..]
+ .<span class="ident">try_into</span>()
+ .<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>,
+ );
+
+ <span class="prelude-val">Ok</span>(<span class="ident">height</span>)
+ })
+ .<span class="ident">transpose</span>()<span class="question-mark">?</span>
+ .<span class="ident">unwrap_or_default</span>())
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_tip_hash</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">BlockHash</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">prefix</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">None</span>).<span class="ident">get_key</span>();
+ <span class="kw">let</span> <span class="ident">iterator</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">prefix_iterator_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">prefix</span>);
+
+ <span class="prelude-val">Ok</span>(<span class="ident">iterator</span>
+ .<span class="ident">last</span>()
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">v</span>)<span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> (<span class="ident">header</span>, <span class="kw">_</span>): (<span class="ident">BlockHeader</span>, <span class="ident">Uint256</span>) <span class="op">=</span> <span class="ident">SerializeDb</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">v</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">header</span>.<span class="ident">block_hash</span>())
+ })
+ .<span class="ident">transpose</span>()<span class="question-mark">?</span>)
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">apply</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
+ <span class="ident">from</span>: <span class="ident">usize</span>,
+ <span class="ident">headers</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">BlockHeader</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">BlockHash</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">WriteBatch</span>::<span class="ident">default</span>();
+
+ <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">last_hash</span>, <span class="kw-2">mut</span> <span class="ident">accumulated_work</span>) <span class="op">=</span> <span class="ident">read_store</span>
+ .<span class="ident">get_pinned_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">from</span>)).<span class="ident">get_key</span>())<span class="question-mark">?</span>
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">result</span><span class="op">|</span> {
+ <span class="kw">let</span> (<span class="ident">header</span>, <span class="ident">work</span>): (<span class="ident">BlockHeader</span>, <span class="ident">Uint256</span>) <span class="op">=</span> <span class="ident">SerializeDb</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">result</span>)<span class="question-mark">?</span>;
+ <span class="prelude-val">Ok</span>::<span class="op"><</span><span class="kw">_</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>((<span class="ident">header</span>.<span class="ident">block_hash</span>(), <span class="ident">work</span>))
+ })
+ .<span class="ident">transpose</span>()<span class="question-mark">?</span>
+ .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>;
+
+ <span class="kw">for</span> (<span class="ident">index</span>, <span class="ident">header</span>) <span class="kw">in</span> <span class="ident">headers</span>.<span class="ident">into_iter</span>().<span class="ident">enumerate</span>() {
+ <span class="kw">if</span> <span class="ident">header</span>.<span class="ident">prev_blockhash</span> <span class="op">!</span><span class="op">=</span> <span class="ident">last_hash</span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidHeaders</span>);
+ }
+
+ <span class="ident">last_hash</span> <span class="op">=</span> <span class="ident">header</span>.<span class="ident">block_hash</span>();
+ <span class="ident">accumulated_work</span> <span class="op">=</span> <span class="ident">accumulated_work</span> <span class="op">+</span> <span class="ident">header</span>.<span class="ident">work</span>();
+
+ <span class="kw">let</span> <span class="ident">height</span> <span class="op">=</span> <span class="ident">from</span> <span class="op">+</span> <span class="ident">index</span> <span class="op">+</span> <span class="number">1</span>;
+ <span class="ident">batch</span>.<span class="ident">put_cf</span>(
+ <span class="ident">cf_handle</span>,
+ <span class="ident">StoreEntry</span>::<span class="ident">BlockHeaderIndex</span>(<span class="prelude-val">Some</span>(<span class="ident">header</span>.<span class="ident">block_hash</span>())).<span class="ident">get_key</span>(),
+ <span class="kw-2">&</span>(<span class="ident">height</span>).<span class="ident">to_be_bytes</span>(),
+ );
+ <span class="ident">batch</span>.<span class="ident">put_cf</span>(
+ <span class="ident">cf_handle</span>,
+ <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">height</span>)).<span class="ident">get_key</span>(),
+ (<span class="ident">header</span>, <span class="ident">accumulated_work</span>).<span class="ident">serialize</span>(),
+ );
+ }
+
+ <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">cf_handle</span>);
+ <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">read_store</span>);
+
+ <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">write</span>().<span class="ident">unwrap</span>().<span class="ident">write</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>;
+ <span class="prelude-val">Ok</span>(<span class="ident">last_hash</span>)
+ }
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">StoreType</span><span class="op">></span> <span class="ident">fmt</span>::<span class="ident">Debug</span> <span class="kw">for</span> <span class="ident">ChainStore</span><span class="op"><</span><span class="ident">T</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
+ <span class="ident">f</span>.<span class="ident">debug_struct</span>(<span class="kw-2">&</span><span class="macro">format</span><span class="macro">!</span>(<span class="string">"ChainStore<{:?}>"</span>, <span class="ident">T</span>::<span class="ident">default</span>()))
+ .<span class="ident">field</span>(<span class="string">"cf_name"</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>)
+ .<span class="ident">field</span>(<span class="string">"min_height"</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">min_height</span>)
+ .<span class="ident">field</span>(<span class="string">"network"</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">network</span>)
+ .<span class="ident">field</span>(<span class="string">"headers_height"</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">get_height</span>())
+ .<span class="ident">field</span>(<span class="string">"tip_hash"</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">get_tip_hash</span>())
+ .<span class="ident">finish</span>()
+ }
+}
+
+<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">FilterHeaderHash</span> <span class="op">=</span> <span class="ident">FilterHash</span>;
+
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">FilterHeader</span> {
+ <span class="ident">prev_header_hash</span>: <span class="ident">FilterHeaderHash</span>,
+ <span class="ident">filter_hash</span>: <span class="ident">FilterHash</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">FilterHeader</span> {
+ <span class="kw">fn</span> <span class="ident">header_hash</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">FilterHeaderHash</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">hash_data</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">filter_hash</span>.<span class="ident">into_inner</span>().<span class="ident">to_vec</span>();
+ <span class="ident">hash_data</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">prev_header_hash</span>);
+ <span class="ident">sha256d</span>::<span class="ident">Hash</span>::<span class="ident">hash</span>(<span class="kw-2">&</span><span class="ident">hash_data</span>).<span class="ident">into</span>()
+ }
+}
+
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">BundleStatus</span> {
+ <span class="ident">Init</span>,
+ <span class="ident">CFHeaders</span> { <span class="ident">cf_headers</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">FilterHeader</span><span class="op">></span> },
+ <span class="ident">CFilters</span> { <span class="ident">cf_filters</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span><span class="op">></span> },
+ <span class="ident">Processed</span> { <span class="ident">cf_filters</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span><span class="op">></span> },
+ <span class="ident">Tip</span> { <span class="ident">cf_filters</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span><span class="op">></span> },
+ <span class="ident">Pruned</span>,
+}
+
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">CFStore</span> {
+ <span class="ident">store</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">RwLock</span><span class="op"><</span><span class="ident">DB</span><span class="op">></span><span class="op">></span>,
+ <span class="ident">filter_type</span>: <span class="ident">u8</span>,
+}
+
+<span class="kw">type</span> <span class="ident">BundleEntry</span> <span class="op">=</span> (<span class="ident">BundleStatus</span>, <span class="ident">FilterHeaderHash</span>);
+
+<span class="kw">impl</span> <span class="ident">CFStore</span> {
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(
+ <span class="ident">headers_store</span>: <span class="kw-2">&</span><span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Full</span><span class="op">></span>,
+ <span class="ident">filter_type</span>: <span class="ident">u8</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">cf_store</span> <span class="op">=</span> <span class="ident">CFStore</span> {
+ <span class="ident">store</span>: <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">headers_store</span>.<span class="ident">store</span>),
+ <span class="ident">filter_type</span>,
+ };
+
+ <span class="kw">let</span> <span class="ident">genesis</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">headers_store</span>.<span class="ident">network</span> {
+ <span class="ident">Network</span>::<span class="ident">Bitcoin</span> <span class="op">=</span><span class="op">></span> <span class="ident">MAINNET_GENESIS</span>.<span class="ident">deref</span>(),
+ <span class="ident">Network</span>::<span class="ident">Testnet</span> <span class="op">=</span><span class="op">></span> <span class="ident">TESTNET_GENESIS</span>.<span class="ident">deref</span>(),
+ <span class="ident">Network</span>::<span class="ident">Regtest</span> <span class="op">=</span><span class="op">></span> <span class="ident">REGTEST_GENESIS</span>.<span class="ident">deref</span>(),
+ };
+
+ <span class="kw">let</span> <span class="ident">filter</span> <span class="op">=</span> <span class="ident">BlockFilter</span>::<span class="ident">new_script_filter</span>(<span class="ident">genesis</span>, <span class="op">|</span><span class="ident">utxo</span><span class="op">|</span> {
+ <span class="prelude-val">Err</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip158</span>::<span class="ident">Error</span>::<span class="ident">UtxoMissing</span>(<span class="kw-2">*</span><span class="ident">utxo</span>))
+ })<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">first_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="ident">filter_type</span>, <span class="prelude-val">Some</span>(<span class="number">0</span>))).<span class="ident">get_key</span>();
+
+ <span class="comment">// Add the genesis' filter</span>
+ {
+ <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="ident">cf_store</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+ <span class="kw">if</span> <span class="ident">read_store</span>.<span class="ident">get_pinned</span>(<span class="kw-2">&</span><span class="ident">first_key</span>)<span class="question-mark">?</span>.<span class="ident">is_none</span>() {
+ <span class="ident">read_store</span>.<span class="ident">put</span>(
+ <span class="kw-2">&</span><span class="ident">first_key</span>,
+ (<span class="ident">BundleStatus</span>::<span class="ident">Init</span>, <span class="ident">filter</span>.<span class="ident">filter_id</span>(<span class="kw-2">&</span><span class="ident">FilterHash</span>::<span class="ident">default</span>())).<span class="ident">serialize</span>(),
+ )<span class="question-mark">?</span>;
+ }
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">cf_store</span>)
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_filter_type</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">u8</span> {
+ <span class="self">self</span>.<span class="ident">filter_type</span>
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_bundles</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">BundleEntry</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">prefix</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="self">self</span>.<span class="ident">filter_type</span>, <span class="prelude-val">None</span>)).<span class="ident">get_key</span>();
+ <span class="kw">let</span> <span class="ident">iterator</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">prefix_iterator</span>(<span class="kw-2">&</span><span class="ident">prefix</span>);
+
+ <span class="comment">// FIXME: we have to filter manually because rocksdb sometimes returns stuff that doesn't</span>
+ <span class="comment">// have the right prefix</span>
+ <span class="ident">iterator</span>
+ .<span class="ident">filter</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">k</span>.<span class="ident">starts_with</span>(<span class="kw-2">&</span><span class="ident">prefix</span>))
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">data</span>)<span class="op">|</span> <span class="ident">BundleEntry</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">data</span>))
+ .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_checkpoints</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">FilterHash</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">prefix</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="self">self</span>.<span class="ident">filter_type</span>, <span class="prelude-val">None</span>)).<span class="ident">get_key</span>();
+ <span class="kw">let</span> <span class="ident">iterator</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">prefix_iterator</span>(<span class="kw-2">&</span><span class="ident">prefix</span>);
+
+ <span class="comment">// FIXME: we have to filter manually because rocksdb sometimes returns stuff that doesn't</span>
+ <span class="comment">// have the right prefix</span>
+ <span class="prelude-val">Ok</span>(<span class="ident">iterator</span>
+ .<span class="ident">filter</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">k</span>.<span class="ident">starts_with</span>(<span class="kw-2">&</span><span class="ident">prefix</span>))
+ .<span class="ident">skip</span>(<span class="number">1</span>)
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">data</span>)<span class="op">|</span> <span class="prelude-val">Ok</span>::<span class="op"><</span><span class="kw">_</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>(<span class="ident">BundleEntry</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">data</span>)<span class="question-mark">?</span>.<span class="number">1</span>))
+ .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()<span class="question-mark">?</span>)
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">replace_checkpoints</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">checkpoints</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">FilterHash</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">current_checkpoints</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_checkpoints</span>()<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">equal_bundles</span> <span class="op">=</span> <span class="number">0</span>;
+ <span class="kw">for</span> (<span class="ident">index</span>, (<span class="ident">our</span>, <span class="ident">their</span>)) <span class="kw">in</span> <span class="ident">current_checkpoints</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">zip</span>(<span class="ident">checkpoints</span>.<span class="ident">iter</span>())
+ .<span class="ident">enumerate</span>()
+ {
+ <span class="ident">equal_bundles</span> <span class="op">=</span> <span class="ident">index</span>;
+
+ <span class="kw">if</span> <span class="ident">our</span> <span class="op">!</span><span class="op">=</span> <span class="ident">their</span> {
+ <span class="kw">break</span>;
+ }
+ }
+
+ <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">WriteBatch</span>::<span class="ident">default</span>();
+
+ <span class="kw">for</span> (<span class="ident">index</span>, <span class="ident">filter_hash</span>) <span class="kw">in</span> <span class="ident">checkpoints</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>().<span class="ident">skip</span>(<span class="ident">equal_bundles</span>) {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="self">self</span>.<span class="ident">filter_type</span>, <span class="prelude-val">Some</span>(<span class="ident">index</span> <span class="op">+</span> <span class="number">1</span>))).<span class="ident">get_key</span>(); <span class="comment">// +1 to skip the genesis' filter</span>
+
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">BundleStatus</span>::<span class="ident">Tip</span> { .. }, <span class="kw">_</span>)) <span class="op">=</span> <span class="ident">read_store</span>
+ .<span class="ident">get_pinned</span>(<span class="kw-2">&</span><span class="ident">key</span>)<span class="question-mark">?</span>
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">data</span><span class="op">|</span> <span class="ident">BundleEntry</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">data</span>))
+ .<span class="ident">transpose</span>()<span class="question-mark">?</span>
+ {
+ <span class="macro">println</span><span class="macro">!</span>(<span class="string">"Keeping bundle #{} as Tip"</span>, <span class="ident">index</span>);
+ } <span class="kw">else</span> {
+ <span class="ident">batch</span>.<span class="ident">put</span>(<span class="kw-2">&</span><span class="ident">key</span>, (<span class="ident">BundleStatus</span>::<span class="ident">Init</span>, <span class="kw-2">*</span><span class="ident">filter_hash</span>).<span class="ident">serialize</span>());
+ }
+ }
+
+ <span class="ident">read_store</span>.<span class="ident">write</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">advance_to_cf_headers</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">bundle</span>: <span class="ident">usize</span>,
+ <span class="ident">checkpoint_hash</span>: <span class="ident">FilterHeaderHash</span>,
+ <span class="ident">filter_headers</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">FilterHash</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">BundleStatus</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">last_hash</span> <span class="op">=</span> <span class="ident">checkpoint_hash</span>;
+ <span class="kw">let</span> <span class="ident">cf_headers</span> <span class="op">=</span> <span class="ident">filter_headers</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">filter_hash</span><span class="op">|</span> {
+ <span class="kw">let</span> <span class="ident">filter_header</span> <span class="op">=</span> <span class="ident">FilterHeader</span> {
+ <span class="ident">prev_header_hash</span>: <span class="ident">last_hash</span>,
+ <span class="ident">filter_hash</span>,
+ };
+ <span class="ident">last_hash</span> <span class="op">=</span> <span class="ident">filter_header</span>.<span class="ident">header_hash</span>();
+
+ <span class="ident">filter_header</span>
+ })
+ .<span class="ident">collect</span>();
+
+ <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">next_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="self">self</span>.<span class="ident">filter_type</span>, <span class="prelude-val">Some</span>(<span class="ident">bundle</span> <span class="op">+</span> <span class="number">1</span>))).<span class="ident">get_key</span>(); <span class="comment">// +1 to skip the genesis' filter</span>
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="kw">_</span>, <span class="ident">next_checkpoint</span>)) <span class="op">=</span> <span class="ident">read_store</span>
+ .<span class="ident">get_pinned</span>(<span class="kw-2">&</span><span class="ident">next_key</span>)<span class="question-mark">?</span>
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">data</span><span class="op">|</span> <span class="ident">BundleEntry</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">data</span>))
+ .<span class="ident">transpose</span>()<span class="question-mark">?</span>
+ {
+ <span class="comment">// check connection with the next bundle if present</span>
+ <span class="kw">if</span> <span class="ident">last_hash</span> <span class="op">!</span><span class="op">=</span> <span class="ident">next_checkpoint</span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidFilterHeader</span>);
+ }
+ }
+
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="self">self</span>.<span class="ident">filter_type</span>, <span class="prelude-val">Some</span>(<span class="ident">bundle</span>))).<span class="ident">get_key</span>();
+ <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> (<span class="ident">BundleStatus</span>::<span class="ident">CFHeaders</span> { <span class="ident">cf_headers</span> }, <span class="ident">checkpoint_hash</span>);
+
+ <span class="ident">read_store</span>.<span class="ident">put</span>(<span class="ident">key</span>, <span class="ident">value</span>.<span class="ident">serialize</span>())<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">value</span>.<span class="number">0</span>)
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">advance_to_cf_filters</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">bundle</span>: <span class="ident">usize</span>,
+ <span class="ident">checkpoint_hash</span>: <span class="ident">FilterHeaderHash</span>,
+ <span class="ident">headers</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">FilterHeader</span><span class="op">></span>,
+ <span class="ident">filters</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">usize</span>, <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>)<span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">BundleStatus</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">cf_filters</span> <span class="op">=</span> <span class="ident">filters</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">zip</span>(<span class="ident">headers</span>.<span class="ident">iter</span>())
+ .<span class="ident">map</span>(<span class="op">|</span>((<span class="kw">_</span>, <span class="ident">filter_content</span>), <span class="ident">header</span>)<span class="op">|</span> {
+ <span class="kw">if</span> <span class="ident">header</span>.<span class="ident">filter_hash</span> <span class="op">!</span><span class="op">=</span> <span class="ident">sha256d</span>::<span class="ident">Hash</span>::<span class="ident">hash</span>(<span class="kw-2">&</span><span class="ident">filter_content</span>).<span class="ident">into</span>() {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidFilter</span>);
+ }
+
+ <span class="prelude-val">Ok</span>::<span class="op"><</span><span class="kw">_</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>(<span class="ident">filter_content</span>)
+ })
+ .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="self">self</span>.<span class="ident">filter_type</span>, <span class="prelude-val">Some</span>(<span class="ident">bundle</span>))).<span class="ident">get_key</span>();
+ <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> (<span class="ident">BundleStatus</span>::<span class="ident">CFilters</span> { <span class="ident">cf_filters</span> }, <span class="ident">checkpoint_hash</span>);
+
+ <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+ <span class="ident">read_store</span>.<span class="ident">put</span>(<span class="ident">key</span>, <span class="ident">value</span>.<span class="ident">serialize</span>())<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">value</span>.<span class="number">0</span>)
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">prune_filters</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">bundle</span>: <span class="ident">usize</span>,
+ <span class="ident">checkpoint_hash</span>: <span class="ident">FilterHeaderHash</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">BundleStatus</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="self">self</span>.<span class="ident">filter_type</span>, <span class="prelude-val">Some</span>(<span class="ident">bundle</span>))).<span class="ident">get_key</span>();
+ <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> (<span class="ident">BundleStatus</span>::<span class="ident">Pruned</span>, <span class="ident">checkpoint_hash</span>);
+
+ <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+ <span class="ident">read_store</span>.<span class="ident">put</span>(<span class="ident">key</span>, <span class="ident">value</span>.<span class="ident">serialize</span>())<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">value</span>.<span class="number">0</span>)
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">mark_as_tip</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">bundle</span>: <span class="ident">usize</span>,
+ <span class="ident">cf_filters</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span><span class="op">></span>,
+ <span class="ident">checkpoint_hash</span>: <span class="ident">FilterHeaderHash</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">BundleStatus</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="self">self</span>.<span class="ident">filter_type</span>, <span class="prelude-val">Some</span>(<span class="ident">bundle</span>))).<span class="ident">get_key</span>();
+ <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> (<span class="ident">BundleStatus</span>::<span class="ident">Tip</span> { <span class="ident">cf_filters</span> }, <span class="ident">checkpoint_hash</span>);
+
+ <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
+ <span class="ident">read_store</span>.<span class="ident">put</span>(<span class="ident">key</span>, <span class="ident">value</span>.<span class="ident">serialize</span>())<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">value</span>.<span class="number">0</span>)
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "bdk";</script><script src="../../../../main.js"></script><script src="../../../../source-script.js"></script><script src="../../../../source-files.js"></script><script defer src="../../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/blockchain/compact_filters/sync.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>sync.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../../bdk/index.html'><div class='logo-container'><img src='../../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+<span id="163">163</span>
+<span id="164">164</span>
+<span id="165">165</span>
+<span id="166">166</span>
+<span id="167">167</span>
+<span id="168">168</span>
+<span id="169">169</span>
+<span id="170">170</span>
+<span id="171">171</span>
+<span id="172">172</span>
+<span id="173">173</span>
+<span id="174">174</span>
+<span id="175">175</span>
+<span id="176">176</span>
+<span id="177">177</span>
+<span id="178">178</span>
+<span id="179">179</span>
+<span id="180">180</span>
+<span id="181">181</span>
+<span id="182">182</span>
+<span id="183">183</span>
+<span id="184">184</span>
+<span id="185">185</span>
+<span id="186">186</span>
+<span id="187">187</span>
+<span id="188">188</span>
+<span id="189">189</span>
+<span id="190">190</span>
+<span id="191">191</span>
+<span id="192">192</span>
+<span id="193">193</span>
+<span id="194">194</span>
+<span id="195">195</span>
+<span id="196">196</span>
+<span id="197">197</span>
+<span id="198">198</span>
+<span id="199">199</span>
+<span id="200">200</span>
+<span id="201">201</span>
+<span id="202">202</span>
+<span id="203">203</span>
+<span id="204">204</span>
+<span id="205">205</span>
+<span id="206">206</span>
+<span id="207">207</span>
+<span id="208">208</span>
+<span id="209">209</span>
+<span id="210">210</span>
+<span id="211">211</span>
+<span id="212">212</span>
+<span id="213">213</span>
+<span id="214">214</span>
+<span id="215">215</span>
+<span id="216">216</span>
+<span id="217">217</span>
+<span id="218">218</span>
+<span id="219">219</span>
+<span id="220">220</span>
+<span id="221">221</span>
+<span id="222">222</span>
+<span id="223">223</span>
+<span id="224">224</span>
+<span id="225">225</span>
+<span id="226">226</span>
+<span id="227">227</span>
+<span id="228">228</span>
+<span id="229">229</span>
+<span id="230">230</span>
+<span id="231">231</span>
+<span id="232">232</span>
+<span id="233">233</span>
+<span id="234">234</span>
+<span id="235">235</span>
+<span id="236">236</span>
+<span id="237">237</span>
+<span id="238">238</span>
+<span id="239">239</span>
+<span id="240">240</span>
+<span id="241">241</span>
+<span id="242">242</span>
+<span id="243">243</span>
+<span id="244">244</span>
+<span id="245">245</span>
+<span id="246">246</span>
+<span id="247">247</span>
+<span id="248">248</span>
+<span id="249">249</span>
+<span id="250">250</span>
+<span id="251">251</span>
+<span id="252">252</span>
+<span id="253">253</span>
+<span id="254">254</span>
+<span id="255">255</span>
+<span id="256">256</span>
+<span id="257">257</span>
+<span id="258">258</span>
+<span id="259">259</span>
+<span id="260">260</span>
+<span id="261">261</span>
+<span id="262">262</span>
+<span id="263">263</span>
+<span id="264">264</span>
+<span id="265">265</span>
+<span id="266">266</span>
+<span id="267">267</span>
+<span id="268">268</span>
+<span id="269">269</span>
+<span id="270">270</span>
+<span id="271">271</span>
+<span id="272">272</span>
+<span id="273">273</span>
+<span id="274">274</span>
+<span id="275">275</span>
+<span id="276">276</span>
+<span id="277">277</span>
+<span id="278">278</span>
+<span id="279">279</span>
+<span id="280">280</span>
+<span id="281">281</span>
+<span id="282">282</span>
+<span id="283">283</span>
+<span id="284">284</span>
+<span id="285">285</span>
+<span id="286">286</span>
+<span id="287">287</span>
+<span id="288">288</span>
+<span id="289">289</span>
+<span id="290">290</span>
+<span id="291">291</span>
+<span id="292">292</span>
+<span id="293">293</span>
+<span id="294">294</span>
+<span id="295">295</span>
+<span id="296">296</span>
+<span id="297">297</span>
+<span id="298">298</span>
+<span id="299">299</span>
+<span id="300">300</span>
+<span id="301">301</span>
+<span id="302">302</span>
+<span id="303">303</span>
+<span id="304">304</span>
+<span id="305">305</span>
+<span id="306">306</span>
+<span id="307">307</span>
+<span id="308">308</span>
+<span id="309">309</span>
+<span id="310">310</span>
+<span id="311">311</span>
+<span id="312">312</span>
+<span id="313">313</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::{<span class="ident">BTreeMap</span>, <span class="ident">HashMap</span>, <span class="ident">VecDeque</span>};
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::{<span class="ident">Arc</span>, <span class="ident">Mutex</span>};
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">Duration</span>;
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hash_types</span>::{<span class="ident">BlockHash</span>, <span class="ident">FilterHash</span>};
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">message</span>::<span class="ident">NetworkMessage</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">message_blockdata</span>::<span class="ident">GetHeadersMessage</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip158</span>::<span class="ident">BlockFilter</span>;
+
+<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">peer</span>::<span class="kw-2">*</span>;
+<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">store</span>::<span class="kw-2">*</span>;
+<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">CompactFiltersError</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
+
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const</span> <span class="ident">BURIED_CONFIRMATIONS</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">100</span>;
+
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">CFSync</span> {
+ <span class="ident">headers_store</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Full</span><span class="op">></span><span class="op">></span>,
+ <span class="ident">cf_store</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">CFStore</span><span class="op">></span>,
+ <span class="ident">skip_blocks</span>: <span class="ident">usize</span>,
+ <span class="ident">bundles</span>: <span class="ident">Mutex</span><span class="op"><</span><span class="ident">VecDeque</span><span class="op"><</span>(<span class="ident">BundleStatus</span>, <span class="ident">FilterHash</span>, <span class="ident">usize</span>)<span class="op">></span><span class="op">></span>,
+}
+
+<span class="kw">impl</span> <span class="ident">CFSync</span> {
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(
+ <span class="ident">headers_store</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Full</span><span class="op">></span><span class="op">></span>,
+ <span class="ident">skip_blocks</span>: <span class="ident">usize</span>,
+ <span class="ident">filter_type</span>: <span class="ident">u8</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">cf_store</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">CFStore</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="ident">headers_store</span>, <span class="ident">filter_type</span>)<span class="question-mark">?</span>);
+
+ <span class="prelude-val">Ok</span>(<span class="ident">CFSync</span> {
+ <span class="ident">headers_store</span>,
+ <span class="ident">cf_store</span>,
+ <span class="ident">skip_blocks</span>,
+ <span class="ident">bundles</span>: <span class="ident">Mutex</span>::<span class="ident">new</span>(<span class="ident">VecDeque</span>::<span class="ident">new</span>()),
+ })
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">pruned_bundles</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">usize</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>
+ .<span class="ident">cf_store</span>
+ .<span class="ident">get_bundles</span>()<span class="question-mark">?</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">skip</span>(<span class="self">self</span>.<span class="ident">skip_blocks</span> <span class="op">/</span> <span class="number">1000</span>)
+ .<span class="ident">fold</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">acc</span>, (<span class="ident">status</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="kw">match</span> <span class="ident">status</span> {
+ <span class="ident">BundleStatus</span>::<span class="ident">Pruned</span> <span class="op">=</span><span class="op">></span> <span class="ident">acc</span> <span class="op">+</span> <span class="number">1</span>,
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="ident">acc</span>,
+ }))
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">prepare_sync</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">peer</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Peer</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">bundles_lock</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">bundles</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">resp</span> <span class="op">=</span> <span class="ident">peer</span>.<span class="ident">get_cf_checkpt</span>(
+ <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">get_filter_type</span>(),
+ <span class="self">self</span>.<span class="ident">headers_store</span>.<span class="ident">get_tip_hash</span>()<span class="question-mark">?</span>.<span class="ident">unwrap</span>(),
+ )<span class="question-mark">?</span>;
+ <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">replace_checkpoints</span>(<span class="ident">resp</span>.<span class="ident">filter_headers</span>)<span class="question-mark">?</span>;
+
+ <span class="ident">bundles_lock</span>.<span class="ident">clear</span>();
+ <span class="kw">for</span> (<span class="ident">index</span>, (<span class="ident">status</span>, <span class="ident">checkpoint</span>)) <span class="kw">in</span> <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">get_bundles</span>()<span class="question-mark">?</span>.<span class="ident">into_iter</span>().<span class="ident">enumerate</span>() {
+ <span class="ident">bundles_lock</span>.<span class="ident">push_back</span>((<span class="ident">status</span>, <span class="ident">checkpoint</span>, <span class="ident">index</span>));
+ }
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">capture_thread_for_sync</span><span class="op"><</span><span class="ident">F</span>, <span class="ident">Q</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">peer</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Peer</span><span class="op">></span>,
+ <span class="ident">process</span>: <span class="ident">F</span>,
+ <span class="ident">completed_bundle</span>: <span class="ident">Q</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span>
+ <span class="kw">where</span>
+ <span class="ident">F</span>: <span class="ident">Fn</span>(<span class="kw-2">&</span><span class="ident">BlockHash</span>, <span class="kw-2">&</span><span class="ident">BlockFilter</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">bool</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>,
+ <span class="ident">Q</span>: <span class="ident">Fn</span>(<span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>,
+ {
+ <span class="kw">let</span> <span class="ident">current_height</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">headers_store</span>.<span class="ident">get_height</span>()<span class="question-mark">?</span>; <span class="comment">// TODO: we should update it in case headers_store is also updated</span>
+
+ <span class="kw">loop</span> {
+ <span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">status</span>, <span class="ident">checkpoint</span>, <span class="ident">index</span>) <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span>.<span class="ident">bundles</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>().<span class="ident">pop_front</span>() {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">break</span>,
+ <span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="op">=</span><span class="op">></span> <span class="ident">x</span>,
+ };
+
+ <span class="ident">log</span>::<span class="macro">debug</span><span class="macro">!</span>(
+ <span class="string">"Processing bundle #{} - height {} to {}"</span>,
+ <span class="ident">index</span>,
+ <span class="ident">index</span> <span class="op">*</span> <span class="number">1000</span> <span class="op">+</span> <span class="number">1</span>,
+ (<span class="ident">index</span> <span class="op">+</span> <span class="number">1</span>) <span class="op">*</span> <span class="number">1000</span>
+ );
+
+ <span class="kw">let</span> <span class="ident">process_received_filters</span> <span class="op">=</span>
+ <span class="op">|</span><span class="ident">expected_filters</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">usize</span>, <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">filters_map</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
+ <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">expected_filters</span> {
+ <span class="kw">let</span> <span class="ident">filter</span> <span class="op">=</span> <span class="ident">peer</span>.<span class="ident">pop_cf_filter_resp</span>()<span class="question-mark">?</span>;
+ <span class="kw">if</span> <span class="ident">filter</span>.<span class="ident">filter_type</span> <span class="op">!</span><span class="op">=</span> <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">get_filter_type</span>() {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>);
+ }
+
+ <span class="kw">match</span> <span class="self">self</span>.<span class="ident">headers_store</span>.<span class="ident">get_height_for</span>(<span class="kw-2">&</span><span class="ident">filter</span>.<span class="ident">block_hash</span>)<span class="question-mark">?</span> {
+ <span class="prelude-val">Some</span>(<span class="ident">height</span>) <span class="op">=</span><span class="op">></span> <span class="ident">filters_map</span>.<span class="ident">insert</span>(<span class="ident">height</span>, <span class="ident">filter</span>.<span class="ident">filter</span>),
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidFilter</span>),
+ };
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">filters_map</span>)
+ };
+
+ <span class="kw">let</span> <span class="ident">start_height</span> <span class="op">=</span> <span class="ident">index</span> <span class="op">*</span> <span class="number">1000</span> <span class="op">+</span> <span class="number">1</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">already_processed</span> <span class="op">=</span> <span class="number">0</span>;
+
+ <span class="kw">if</span> <span class="ident">start_height</span> <span class="op"><</span> <span class="self">self</span>.<span class="ident">skip_blocks</span> {
+ <span class="ident">status</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">prune_filters</span>(<span class="ident">index</span>, <span class="ident">checkpoint</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="kw">let</span> <span class="ident">stop_height</span> <span class="op">=</span> <span class="ident">std</span>::<span class="ident">cmp</span>::<span class="ident">min</span>(<span class="ident">current_height</span>, <span class="ident">start_height</span> <span class="op">+</span> <span class="number">999</span>);
+ <span class="kw">let</span> <span class="ident">stop_hash</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">headers_store</span>.<span class="ident">get_block_hash</span>(<span class="ident">stop_height</span>)<span class="question-mark">?</span>.<span class="ident">unwrap</span>();
+
+ <span class="kw">if</span> <span class="kw">let</span> <span class="ident">BundleStatus</span>::<span class="ident">Init</span> <span class="op">=</span> <span class="ident">status</span> {
+ <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"status: Init"</span>);
+
+ <span class="kw">let</span> <span class="ident">resp</span> <span class="op">=</span> <span class="ident">peer</span>.<span class="ident">get_cf_headers</span>(<span class="number">0x00</span>, <span class="ident">start_height</span> <span class="kw">as</span> <span class="ident">u32</span>, <span class="ident">stop_hash</span>)<span class="question-mark">?</span>;
+
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">resp</span>.<span class="ident">previous_filter</span> <span class="op">=</span><span class="op">=</span> <span class="ident">checkpoint</span>);
+ <span class="ident">status</span> <span class="op">=</span>
+ <span class="self">self</span>.<span class="ident">cf_store</span>
+ .<span class="ident">advance_to_cf_headers</span>(<span class="ident">index</span>, <span class="ident">checkpoint</span>, <span class="ident">resp</span>.<span class="ident">filter_hashes</span>)<span class="question-mark">?</span>;
+ }
+ <span class="kw">if</span> <span class="kw">let</span> <span class="ident">BundleStatus</span>::<span class="ident">Tip</span> { <span class="ident">cf_filters</span> } <span class="op">=</span> <span class="ident">status</span> {
+ <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"status: Tip (beginning) "</span>);
+
+ <span class="ident">already_processed</span> <span class="op">=</span> <span class="ident">cf_filters</span>.<span class="ident">len</span>();
+ <span class="kw">let</span> <span class="ident">headers_resp</span> <span class="op">=</span> <span class="ident">peer</span>.<span class="ident">get_cf_headers</span>(<span class="number">0x00</span>, <span class="ident">start_height</span> <span class="kw">as</span> <span class="ident">u32</span>, <span class="ident">stop_hash</span>)<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="ident">cf_headers</span> <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">advance_to_cf_headers</span>(
+ <span class="ident">index</span>,
+ <span class="ident">checkpoint</span>,
+ <span class="ident">headers_resp</span>.<span class="ident">filter_hashes</span>,
+ )<span class="question-mark">?</span> {
+ <span class="ident">BundleStatus</span>::<span class="ident">CFHeaders</span> { <span class="ident">cf_headers</span> } <span class="op">=</span><span class="op">></span> <span class="ident">cf_headers</span>,
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>),
+ };
+
+ <span class="ident">peer</span>.<span class="ident">get_cf_filters</span>(
+ <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">get_filter_type</span>(),
+ (<span class="ident">start_height</span> <span class="op">+</span> <span class="ident">cf_filters</span>.<span class="ident">len</span>()) <span class="kw">as</span> <span class="ident">u32</span>,
+ <span class="ident">stop_hash</span>,
+ )<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">expected_filters</span> <span class="op">=</span> <span class="ident">stop_height</span> <span class="op">-</span> <span class="ident">start_height</span> <span class="op">+</span> <span class="number">1</span> <span class="op">-</span> <span class="ident">cf_filters</span>.<span class="ident">len</span>();
+ <span class="kw">let</span> <span class="ident">filters_map</span> <span class="op">=</span> <span class="ident">process_received_filters</span>(<span class="ident">expected_filters</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">filters</span> <span class="op">=</span> <span class="ident">cf_filters</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">enumerate</span>()
+ .<span class="ident">chain</span>(<span class="ident">filters_map</span>.<span class="ident">into_iter</span>())
+ .<span class="ident">collect</span>();
+ <span class="ident">status</span> <span class="op">=</span> <span class="self">self</span>
+ .<span class="ident">cf_store</span>
+ .<span class="ident">advance_to_cf_filters</span>(<span class="ident">index</span>, <span class="ident">checkpoint</span>, <span class="ident">cf_headers</span>, <span class="ident">filters</span>)<span class="question-mark">?</span>;
+ }
+ <span class="kw">if</span> <span class="kw">let</span> <span class="ident">BundleStatus</span>::<span class="ident">CFHeaders</span> { <span class="ident">cf_headers</span> } <span class="op">=</span> <span class="ident">status</span> {
+ <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"status: CFHeaders"</span>);
+
+ <span class="ident">peer</span>.<span class="ident">get_cf_filters</span>(
+ <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">get_filter_type</span>(),
+ <span class="ident">start_height</span> <span class="kw">as</span> <span class="ident">u32</span>,
+ <span class="ident">stop_hash</span>,
+ )<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">expected_filters</span> <span class="op">=</span> <span class="ident">stop_height</span> <span class="op">-</span> <span class="ident">start_height</span> <span class="op">+</span> <span class="number">1</span>;
+ <span class="kw">let</span> <span class="ident">filters_map</span> <span class="op">=</span> <span class="ident">process_received_filters</span>(<span class="ident">expected_filters</span>)<span class="question-mark">?</span>;
+ <span class="ident">status</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">advance_to_cf_filters</span>(
+ <span class="ident">index</span>,
+ <span class="ident">checkpoint</span>,
+ <span class="ident">cf_headers</span>,
+ <span class="ident">filters_map</span>.<span class="ident">into_iter</span>().<span class="ident">collect</span>(),
+ )<span class="question-mark">?</span>;
+ }
+ <span class="kw">if</span> <span class="kw">let</span> <span class="ident">BundleStatus</span>::<span class="ident">CFilters</span> { <span class="ident">cf_filters</span> } <span class="op">=</span> <span class="ident">status</span> {
+ <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"status: CFilters"</span>);
+
+ <span class="kw">let</span> <span class="ident">last_sync_buried_height</span> <span class="op">=</span> (<span class="ident">start_height</span> <span class="op">+</span> <span class="ident">already_processed</span>)
+ .<span class="ident">checked_sub</span>(<span class="ident">BURIED_CONFIRMATIONS</span>)
+ .<span class="ident">unwrap_or</span>(<span class="number">0</span>);
+
+ <span class="kw">for</span> (<span class="ident">filter_index</span>, <span class="ident">filter</span>) <span class="kw">in</span> <span class="ident">cf_filters</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
+ <span class="kw">let</span> <span class="ident">height</span> <span class="op">=</span> <span class="ident">filter_index</span> <span class="op">+</span> <span class="ident">start_height</span>;
+
+ <span class="comment">// do not download blocks that were already "buried" since the last sync</span>
+ <span class="kw">if</span> <span class="ident">height</span> <span class="op"><</span> <span class="ident">last_sync_buried_height</span> {
+ <span class="kw">continue</span>;
+ }
+
+ <span class="kw">let</span> <span class="ident">block_hash</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">headers_store</span>.<span class="ident">get_block_hash</span>(<span class="ident">height</span>)<span class="question-mark">?</span>.<span class="ident">unwrap</span>();
+
+ <span class="comment">// TODO: also download random blocks?</span>
+ <span class="kw">if</span> <span class="ident">process</span>(<span class="kw-2">&</span><span class="ident">block_hash</span>, <span class="kw-2">&</span><span class="ident">BlockFilter</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="ident">filter</span>))<span class="question-mark">?</span> {
+ <span class="ident">log</span>::<span class="macro">debug</span><span class="macro">!</span>(<span class="string">"Downloading block {}"</span>, <span class="ident">block_hash</span>);
+
+ <span class="kw">let</span> <span class="ident">block</span> <span class="op">=</span> <span class="ident">peer</span>
+ .<span class="ident">get_block</span>(<span class="ident">block_hash</span>)<span class="question-mark">?</span>
+ .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">MissingBlock</span>)<span class="question-mark">?</span>;
+ <span class="self">self</span>.<span class="ident">headers_store</span>.<span class="ident">save_full_block</span>(<span class="kw-2">&</span><span class="ident">block</span>, <span class="ident">height</span>)<span class="question-mark">?</span>;
+ }
+ }
+
+ <span class="ident">status</span> <span class="op">=</span> <span class="ident">BundleStatus</span>::<span class="ident">Processed</span> { <span class="ident">cf_filters</span> };
+ }
+ <span class="kw">if</span> <span class="kw">let</span> <span class="ident">BundleStatus</span>::<span class="ident">Processed</span> { <span class="ident">cf_filters</span> } <span class="op">=</span> <span class="ident">status</span> {
+ <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"status: Processed"</span>);
+
+ <span class="kw">if</span> <span class="ident">current_height</span> <span class="op">-</span> <span class="ident">stop_height</span> <span class="op">></span> <span class="number">1000</span> {
+ <span class="ident">status</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">prune_filters</span>(<span class="ident">index</span>, <span class="ident">checkpoint</span>)<span class="question-mark">?</span>;
+ } <span class="kw">else</span> {
+ <span class="ident">status</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">mark_as_tip</span>(<span class="ident">index</span>, <span class="ident">cf_filters</span>, <span class="ident">checkpoint</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="ident">completed_bundle</span>(<span class="ident">index</span>)<span class="question-mark">?</span>;
+ }
+ <span class="kw">if</span> <span class="kw">let</span> <span class="ident">BundleStatus</span>::<span class="ident">Pruned</span> <span class="op">=</span> <span class="ident">status</span> {
+ <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"status: Pruned"</span>);
+ }
+ <span class="kw">if</span> <span class="kw">let</span> <span class="ident">BundleStatus</span>::<span class="ident">Tip</span> { .. } <span class="op">=</span> <span class="ident">status</span> {
+ <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"status: Tip"</span>);
+ }
+ }
+
+ <span class="prelude-val">Ok</span>(())
+ }
+}
+
+<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">sync_headers</span><span class="op"><</span><span class="ident">F</span><span class="op">></span>(
+ <span class="ident">peer</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Peer</span><span class="op">></span>,
+ <span class="ident">store</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Full</span><span class="op">></span><span class="op">></span>,
+ <span class="ident">sync_fn</span>: <span class="ident">F</span>,
+) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Snapshot</span><span class="op">></span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span>
+<span class="kw">where</span>
+ <span class="ident">F</span>: <span class="ident">Fn</span>(<span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>,
+{
+ <span class="kw">let</span> <span class="ident">locators</span> <span class="op">=</span> <span class="ident">store</span>.<span class="ident">get_locators</span>()<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">locators_vec</span> <span class="op">=</span> <span class="ident">locators</span>.<span class="ident">iter</span>().<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">hash</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">hash</span>).<span class="ident">cloned</span>().<span class="ident">collect</span>();
+ <span class="kw">let</span> <span class="ident">locators_map</span>: <span class="ident">HashMap</span><span class="op"><</span><span class="kw">_</span>, <span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">locators</span>.<span class="ident">into_iter</span>().<span class="ident">collect</span>();
+
+ <span class="ident">peer</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">GetHeaders</span>(<span class="ident">GetHeadersMessage</span>::<span class="ident">new</span>(
+ <span class="ident">locators_vec</span>,
+ <span class="ident">Default</span>::<span class="ident">default</span>(),
+ )))<span class="question-mark">?</span>;
+ <span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">snapshot</span>, <span class="kw-2">mut</span> <span class="ident">last_hash</span>) <span class="op">=</span> <span class="kw">if</span> <span class="kw">let</span> <span class="ident">NetworkMessage</span>::<span class="ident">Headers</span>(<span class="ident">headers</span>) <span class="op">=</span> <span class="ident">peer</span>
+ .<span class="ident">recv</span>(<span class="string">"headers"</span>, <span class="prelude-val">Some</span>(<span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="ident">TIMEOUT_SECS</span>)))<span class="question-mark">?</span>
+ .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">Timeout</span>)<span class="question-mark">?</span>
+ {
+ <span class="kw">if</span> <span class="ident">headers</span>.<span class="ident">is_empty</span>() {
+ <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>);
+ }
+
+ <span class="kw">match</span> <span class="ident">locators_map</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">headers</span>[<span class="number">0</span>].<span class="ident">prev_blockhash</span>) {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidHeaders</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">from</span>) <span class="op">=</span><span class="op">></span> (
+ <span class="ident">store</span>.<span class="ident">start_snapshot</span>(<span class="kw-2">*</span><span class="ident">from</span>)<span class="question-mark">?</span>,
+ <span class="ident">headers</span>[<span class="number">0</span>].<span class="ident">prev_blockhash</span>.<span class="ident">clone</span>(),
+ ),
+ }
+ } <span class="kw">else</span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>);
+ };
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">sync_height</span> <span class="op">=</span> <span class="ident">store</span>.<span class="ident">get_height</span>()<span class="question-mark">?</span>;
+ <span class="kw">while</span> <span class="ident">sync_height</span> <span class="op"><</span> <span class="ident">peer</span>.<span class="ident">get_version</span>().<span class="ident">start_height</span> <span class="kw">as</span> <span class="ident">usize</span> {
+ <span class="ident">peer</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">GetHeaders</span>(<span class="ident">GetHeadersMessage</span>::<span class="ident">new</span>(
+ <span class="macro">vec</span><span class="macro">!</span>[<span class="ident">last_hash</span>],
+ <span class="ident">Default</span>::<span class="ident">default</span>(),
+ )))<span class="question-mark">?</span>;
+ <span class="kw">if</span> <span class="kw">let</span> <span class="ident">NetworkMessage</span>::<span class="ident">Headers</span>(<span class="ident">headers</span>) <span class="op">=</span> <span class="ident">peer</span>
+ .<span class="ident">recv</span>(<span class="string">"headers"</span>, <span class="prelude-val">Some</span>(<span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="ident">TIMEOUT_SECS</span>)))<span class="question-mark">?</span>
+ .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">Timeout</span>)<span class="question-mark">?</span>
+ {
+ <span class="kw">let</span> <span class="ident">batch_len</span> <span class="op">=</span> <span class="ident">headers</span>.<span class="ident">len</span>();
+ <span class="ident">last_hash</span> <span class="op">=</span> <span class="ident">snapshot</span>.<span class="ident">apply</span>(<span class="ident">sync_height</span>, <span class="ident">headers</span>)<span class="question-mark">?</span>;
+
+ <span class="ident">sync_height</span> <span class="op">+</span><span class="op">=</span> <span class="ident">batch_len</span>;
+ <span class="ident">sync_fn</span>(<span class="ident">sync_height</span>)<span class="question-mark">?</span>;
+ } <span class="kw">else</span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>);
+ }
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">snapshot</span>))
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "bdk";</script><script src="../../../../main.js"></script><script src="../../../../source-script.js"></script><script src="../../../../source-files.js"></script><script defer src="../../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/blockchain/electrum.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>electrum.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+<span id="163">163</span>
+<span id="164">164</span>
+<span id="165">165</span>
+<span id="166">166</span>
+<span id="167">167</span>
+<span id="168">168</span>
+<span id="169">169</span>
+<span id="170">170</span>
+<span id="171">171</span>
+<span id="172">172</span>
+<span id="173">173</span>
+<span id="174">174</span>
+<span id="175">175</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="doccomment">//! Electrum</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! This module defines a [`Blockchain`] struct that wraps an [`electrum_client::Client`]</span>
+<span class="doccomment">//! and implements the logic required to populate the wallet's [database](crate::database::Database) by</span>
+<span class="doccomment">//! querying the inner client.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ## Example</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ```no_run</span>
+<span class="doccomment">//! # use bdk::blockchain::electrum::ElectrumBlockchain;</span>
+<span class="doccomment">//! let client = electrum_client::Client::new("ssl://electrum.blockstream.info:50002", None)?;</span>
+<span class="doccomment">//! let blockchain = ElectrumBlockchain::from(client);</span>
+<span class="doccomment">//! # Ok::<(), bdk::Error>(())</span>
+<span class="doccomment">//! ```</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashSet</span>;
+
+<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_imports</span>)]</span>
+<span class="kw">use</span> <span class="ident">log</span>::{<span class="ident">debug</span>, <span class="ident">error</span>, <span class="ident">info</span>, <span class="ident">trace</span>};
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Script</span>, <span class="ident">Transaction</span>, <span class="ident">Txid</span>};
+
+<span class="kw">use</span> <span class="ident">electrum_client</span>::{<span class="ident">Client</span>, <span class="ident">ElectrumApi</span>};
+
+<span class="kw">use</span> <span class="self">self</span>::<span class="ident">utils</span>::{<span class="ident">ELSGetHistoryRes</span>, <span class="ident">ELSListUnspentRes</span>, <span class="ident">ElectrumLikeSync</span>};
+<span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">BatchDatabase</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">FeeRate</span>;
+
+<span class="doccomment">/// Wrapper over an Electrum Client that implements the required blockchain traits</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ## Example</span>
+<span class="doccomment">/// See the [`blockchain::electrum`](crate::blockchain::electrum) module for a usage example.</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">ElectrumBlockchain</span>(<span class="ident">Client</span>);
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"test-electrum"</span>)]</span>
+<span class="attribute">#[<span class="ident">bdk_blockchain_tests</span>(<span class="kw">crate</span>)]</span>
+<span class="kw">fn</span> <span class="ident">local_electrs</span>() <span class="op">-</span><span class="op">></span> <span class="ident">ElectrumBlockchain</span> {
+ <span class="ident">ElectrumBlockchain</span>::<span class="ident">from</span>(<span class="ident">Client</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="ident">testutils</span>::<span class="ident">get_electrum_url</span>(), <span class="prelude-val">None</span>).<span class="ident">unwrap</span>())
+}
+
+<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">convert</span>::<span class="ident">From</span><span class="op"><</span><span class="ident">Client</span><span class="op">></span> <span class="kw">for</span> <span class="ident">ElectrumBlockchain</span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">client</span>: <span class="ident">Client</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">ElectrumBlockchain</span>(<span class="ident">client</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">Blockchain</span> <span class="kw">for</span> <span class="ident">ElectrumBlockchain</span> {
+ <span class="kw">fn</span> <span class="ident">get_capabilities</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Capability</span><span class="op">></span> {
+ <span class="macro">vec</span><span class="macro">!</span>[
+ <span class="ident">Capability</span>::<span class="ident">FullHistory</span>,
+ <span class="ident">Capability</span>::<span class="ident">GetAnyTx</span>,
+ <span class="ident">Capability</span>::<span class="ident">AccurateFees</span>,
+ ]
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">collect</span>()
+ }
+
+ <span class="kw">fn</span> <span class="ident">setup</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span>, <span class="ident">P</span>: <span class="ident">Progress</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">stop_gap</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
+ <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
+ <span class="ident">progress_update</span>: <span class="ident">P</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="number">0</span>
+ .<span class="ident">electrum_like_setup</span>(<span class="ident">stop_gap</span>, <span class="ident">database</span>, <span class="ident">progress_update</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="number">0</span>.<span class="ident">transaction_get</span>(<span class="ident">txid</span>).<span class="ident">map</span>(<span class="prelude-ty">Option</span>::<span class="prelude-val">Some</span>)<span class="question-mark">?</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">broadcast</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="number">0</span>.<span class="ident">transaction_broadcast</span>(<span class="ident">tx</span>).<span class="ident">map</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> ())<span class="question-mark">?</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_height</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="comment">// TODO: unsubscribe when added to the client, or is there a better call to use here?</span>
+
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>
+ .<span class="number">0</span>
+ .<span class="ident">block_headers_subscribe</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">data</span><span class="op">|</span> <span class="ident">data</span>.<span class="ident">height</span> <span class="kw">as</span> <span class="ident">u32</span>)<span class="question-mark">?</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">estimate_fee</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">target</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">FeeRate</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">FeeRate</span>::<span class="ident">from_btc_per_kvb</span>(
+ <span class="self">self</span>.<span class="number">0</span>.<span class="ident">estimate_fee</span>(<span class="ident">target</span>)<span class="question-mark">?</span> <span class="kw">as</span> <span class="ident">f32</span>
+ ))
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">ElectrumLikeSync</span> <span class="kw">for</span> <span class="ident">Client</span> {
+ <span class="kw">fn</span> <span class="ident">els_batch_script_get_history</span><span class="op"><</span><span class="lifetime">'s</span>, <span class="ident">I</span>: <span class="ident">IntoIterator</span><span class="op"><</span><span class="ident">Item</span> <span class="op">=</span> <span class="kw-2">&</span><span class="lifetime">'s</span> <span class="ident">Script</span><span class="op">></span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">scripts</span>: <span class="ident">I</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSGetHistoryRes</span><span class="op">></span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">batch_script_get_history</span>(<span class="ident">scripts</span>)
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">v</span><span class="op">|</span> {
+ <span class="ident">v</span>.<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">v</span><span class="op">|</span> {
+ <span class="ident">v</span>.<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(
+ <span class="op">|</span><span class="ident">electrum_client</span>::<span class="ident">GetHistoryRes</span> {
+ <span class="ident">height</span>, <span class="ident">tx_hash</span>, ..
+ }<span class="op">|</span> <span class="ident">ELSGetHistoryRes</span> {
+ <span class="ident">height</span>,
+ <span class="ident">tx_hash</span>,
+ },
+ )
+ .<span class="ident">collect</span>()
+ })
+ .<span class="ident">collect</span>()
+ })
+ .<span class="ident">map_err</span>(<span class="ident">Error</span>::<span class="ident">Electrum</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">els_batch_script_list_unspent</span><span class="op"><</span><span class="lifetime">'s</span>, <span class="ident">I</span>: <span class="ident">IntoIterator</span><span class="op"><</span><span class="ident">Item</span> <span class="op">=</span> <span class="kw-2">&</span><span class="lifetime">'s</span> <span class="ident">Script</span><span class="op">></span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">scripts</span>: <span class="ident">I</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSListUnspentRes</span><span class="op">></span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">batch_script_list_unspent</span>(<span class="ident">scripts</span>)
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">v</span><span class="op">|</span> {
+ <span class="ident">v</span>.<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">v</span><span class="op">|</span> {
+ <span class="ident">v</span>.<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(
+ <span class="op">|</span><span class="ident">electrum_client</span>::<span class="ident">ListUnspentRes</span> {
+ <span class="ident">height</span>,
+ <span class="ident">tx_hash</span>,
+ <span class="ident">tx_pos</span>,
+ ..
+ }<span class="op">|</span> <span class="ident">ELSListUnspentRes</span> {
+ <span class="ident">height</span>,
+ <span class="ident">tx_hash</span>,
+ <span class="ident">tx_pos</span>,
+ },
+ )
+ .<span class="ident">collect</span>()
+ })
+ .<span class="ident">collect</span>()
+ })
+ .<span class="ident">map_err</span>(<span class="ident">Error</span>::<span class="ident">Electrum</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">els_transaction_get</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Transaction</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">transaction_get</span>(<span class="ident">txid</span>).<span class="ident">map_err</span>(<span class="ident">Error</span>::<span class="ident">Electrum</span>)
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/blockchain/esplora.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>esplora.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+<span id="163">163</span>
+<span id="164">164</span>
+<span id="165">165</span>
+<span id="166">166</span>
+<span id="167">167</span>
+<span id="168">168</span>
+<span id="169">169</span>
+<span id="170">170</span>
+<span id="171">171</span>
+<span id="172">172</span>
+<span id="173">173</span>
+<span id="174">174</span>
+<span id="175">175</span>
+<span id="176">176</span>
+<span id="177">177</span>
+<span id="178">178</span>
+<span id="179">179</span>
+<span id="180">180</span>
+<span id="181">181</span>
+<span id="182">182</span>
+<span id="183">183</span>
+<span id="184">184</span>
+<span id="185">185</span>
+<span id="186">186</span>
+<span id="187">187</span>
+<span id="188">188</span>
+<span id="189">189</span>
+<span id="190">190</span>
+<span id="191">191</span>
+<span id="192">192</span>
+<span id="193">193</span>
+<span id="194">194</span>
+<span id="195">195</span>
+<span id="196">196</span>
+<span id="197">197</span>
+<span id="198">198</span>
+<span id="199">199</span>
+<span id="200">200</span>
+<span id="201">201</span>
+<span id="202">202</span>
+<span id="203">203</span>
+<span id="204">204</span>
+<span id="205">205</span>
+<span id="206">206</span>
+<span id="207">207</span>
+<span id="208">208</span>
+<span id="209">209</span>
+<span id="210">210</span>
+<span id="211">211</span>
+<span id="212">212</span>
+<span id="213">213</span>
+<span id="214">214</span>
+<span id="215">215</span>
+<span id="216">216</span>
+<span id="217">217</span>
+<span id="218">218</span>
+<span id="219">219</span>
+<span id="220">220</span>
+<span id="221">221</span>
+<span id="222">222</span>
+<span id="223">223</span>
+<span id="224">224</span>
+<span id="225">225</span>
+<span id="226">226</span>
+<span id="227">227</span>
+<span id="228">228</span>
+<span id="229">229</span>
+<span id="230">230</span>
+<span id="231">231</span>
+<span id="232">232</span>
+<span id="233">233</span>
+<span id="234">234</span>
+<span id="235">235</span>
+<span id="236">236</span>
+<span id="237">237</span>
+<span id="238">238</span>
+<span id="239">239</span>
+<span id="240">240</span>
+<span id="241">241</span>
+<span id="242">242</span>
+<span id="243">243</span>
+<span id="244">244</span>
+<span id="245">245</span>
+<span id="246">246</span>
+<span id="247">247</span>
+<span id="248">248</span>
+<span id="249">249</span>
+<span id="250">250</span>
+<span id="251">251</span>
+<span id="252">252</span>
+<span id="253">253</span>
+<span id="254">254</span>
+<span id="255">255</span>
+<span id="256">256</span>
+<span id="257">257</span>
+<span id="258">258</span>
+<span id="259">259</span>
+<span id="260">260</span>
+<span id="261">261</span>
+<span id="262">262</span>
+<span id="263">263</span>
+<span id="264">264</span>
+<span id="265">265</span>
+<span id="266">266</span>
+<span id="267">267</span>
+<span id="268">268</span>
+<span id="269">269</span>
+<span id="270">270</span>
+<span id="271">271</span>
+<span id="272">272</span>
+<span id="273">273</span>
+<span id="274">274</span>
+<span id="275">275</span>
+<span id="276">276</span>
+<span id="277">277</span>
+<span id="278">278</span>
+<span id="279">279</span>
+<span id="280">280</span>
+<span id="281">281</span>
+<span id="282">282</span>
+<span id="283">283</span>
+<span id="284">284</span>
+<span id="285">285</span>
+<span id="286">286</span>
+<span id="287">287</span>
+<span id="288">288</span>
+<span id="289">289</span>
+<span id="290">290</span>
+<span id="291">291</span>
+<span id="292">292</span>
+<span id="293">293</span>
+<span id="294">294</span>
+<span id="295">295</span>
+<span id="296">296</span>
+<span id="297">297</span>
+<span id="298">298</span>
+<span id="299">299</span>
+<span id="300">300</span>
+<span id="301">301</span>
+<span id="302">302</span>
+<span id="303">303</span>
+<span id="304">304</span>
+<span id="305">305</span>
+<span id="306">306</span>
+<span id="307">307</span>
+<span id="308">308</span>
+<span id="309">309</span>
+<span id="310">310</span>
+<span id="311">311</span>
+<span id="312">312</span>
+<span id="313">313</span>
+<span id="314">314</span>
+<span id="315">315</span>
+<span id="316">316</span>
+<span id="317">317</span>
+<span id="318">318</span>
+<span id="319">319</span>
+<span id="320">320</span>
+<span id="321">321</span>
+<span id="322">322</span>
+<span id="323">323</span>
+<span id="324">324</span>
+<span id="325">325</span>
+<span id="326">326</span>
+<span id="327">327</span>
+<span id="328">328</span>
+<span id="329">329</span>
+<span id="330">330</span>
+<span id="331">331</span>
+<span id="332">332</span>
+<span id="333">333</span>
+<span id="334">334</span>
+<span id="335">335</span>
+<span id="336">336</span>
+<span id="337">337</span>
+<span id="338">338</span>
+<span id="339">339</span>
+<span id="340">340</span>
+<span id="341">341</span>
+<span id="342">342</span>
+<span id="343">343</span>
+<span id="344">344</span>
+<span id="345">345</span>
+<span id="346">346</span>
+<span id="347">347</span>
+<span id="348">348</span>
+<span id="349">349</span>
+<span id="350">350</span>
+<span id="351">351</span>
+<span id="352">352</span>
+<span id="353">353</span>
+<span id="354">354</span>
+<span id="355">355</span>
+<span id="356">356</span>
+<span id="357">357</span>
+<span id="358">358</span>
+<span id="359">359</span>
+<span id="360">360</span>
+<span id="361">361</span>
+<span id="362">362</span>
+<span id="363">363</span>
+<span id="364">364</span>
+<span id="365">365</span>
+<span id="366">366</span>
+<span id="367">367</span>
+<span id="368">368</span>
+<span id="369">369</span>
+<span id="370">370</span>
+<span id="371">371</span>
+<span id="372">372</span>
+<span id="373">373</span>
+<span id="374">374</span>
+<span id="375">375</span>
+<span id="376">376</span>
+<span id="377">377</span>
+<span id="378">378</span>
+<span id="379">379</span>
+<span id="380">380</span>
+<span id="381">381</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="doccomment">//! Esplora</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! This module defines a [`Blockchain`] struct that can query an Esplora backend</span>
+<span class="doccomment">//! populate the wallet's [database](crate::database::Database) by</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ## Example</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ```no_run</span>
+<span class="doccomment">//! # use bdk::blockchain::esplora::EsploraBlockchain;</span>
+<span class="doccomment">//! let blockchain = EsploraBlockchain::new("https://blockstream.info/testnet/api");</span>
+<span class="doccomment">//! # Ok::<(), bdk::Error>(())</span>
+<span class="doccomment">//! ```</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::{<span class="ident">HashMap</span>, <span class="ident">HashSet</span>};
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
+
+<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">stream</span>::{<span class="self">self</span>, <span class="ident">StreamExt</span>, <span class="ident">TryStreamExt</span>};
+
+<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_imports</span>)]</span>
+<span class="kw">use</span> <span class="ident">log</span>::{<span class="ident">debug</span>, <span class="ident">error</span>, <span class="ident">info</span>, <span class="ident">trace</span>};
+
+<span class="kw">use</span> <span class="ident">serde</span>::<span class="ident">Deserialize</span>;
+
+<span class="kw">use</span> <span class="ident">reqwest</span>::{<span class="ident">Client</span>, <span class="ident">StatusCode</span>};
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::{<span class="ident">deserialize</span>, <span class="ident">serialize</span>};
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">ToHex</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::{<span class="ident">sha256</span>, <span class="ident">Hash</span>};
+<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Script</span>, <span class="ident">Transaction</span>, <span class="ident">Txid</span>};
+
+<span class="kw">use</span> <span class="self">self</span>::<span class="ident">utils</span>::{<span class="ident">ELSGetHistoryRes</span>, <span class="ident">ELSListUnspentRes</span>, <span class="ident">ElectrumLikeSync</span>};
+<span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">BatchDatabase</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">FeeRate</span>;
+
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
+<span class="kw">struct</span> <span class="ident">UrlClient</span> {
+ <span class="ident">url</span>: <span class="ident">String</span>,
+ <span class="comment">// We use the async client instead of the blocking one because it automatically uses `fetch`</span>
+ <span class="comment">// when the target platform is wasm32.</span>
+ <span class="ident">client</span>: <span class="ident">Client</span>,
+}
+
+<span class="doccomment">/// Structure that implements the logic to sync with Esplora</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ## Example</span>
+<span class="doccomment">/// See the [`blockchain::esplora`](crate::blockchain::esplora) module for a usage example.</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">EsploraBlockchain</span>(<span class="ident">UrlClient</span>);
+
+<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">convert</span>::<span class="ident">From</span><span class="op"><</span><span class="ident">UrlClient</span><span class="op">></span> <span class="kw">for</span> <span class="ident">EsploraBlockchain</span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">url_client</span>: <span class="ident">UrlClient</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">EsploraBlockchain</span>(<span class="ident">url_client</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">EsploraBlockchain</span> {
+ <span class="doccomment">/// Create a new instance of the client from a base URL</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">base_url</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">EsploraBlockchain</span>(<span class="ident">UrlClient</span> {
+ <span class="ident">url</span>: <span class="ident">base_url</span>.<span class="ident">to_string</span>(),
+ <span class="ident">client</span>: <span class="ident">Client</span>::<span class="ident">new</span>(),
+ })
+ }
+}
+
+<span class="attribute">#[<span class="ident">maybe_async</span>]</span>
+<span class="kw">impl</span> <span class="ident">Blockchain</span> <span class="kw">for</span> <span class="ident">EsploraBlockchain</span> {
+ <span class="kw">fn</span> <span class="ident">get_capabilities</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Capability</span><span class="op">></span> {
+ <span class="macro">vec</span><span class="macro">!</span>[
+ <span class="ident">Capability</span>::<span class="ident">FullHistory</span>,
+ <span class="ident">Capability</span>::<span class="ident">GetAnyTx</span>,
+ <span class="ident">Capability</span>::<span class="ident">AccurateFees</span>,
+ ]
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">collect</span>()
+ }
+
+ <span class="kw">fn</span> <span class="ident">setup</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span>, <span class="ident">P</span>: <span class="ident">Progress</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">stop_gap</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
+ <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
+ <span class="ident">progress_update</span>: <span class="ident">P</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>
+ .<span class="number">0</span>
+ .<span class="ident">electrum_like_setup</span>(<span class="ident">stop_gap</span>, <span class="ident">database</span>, <span class="ident">progress_update</span>))
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="macro">await_or_block</span><span class="macro">!</span>(<span class="self">self</span>.<span class="number">0</span>.<span class="ident">_get_tx</span>(<span class="ident">txid</span>))<span class="question-mark">?</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">broadcast</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="macro">await_or_block</span><span class="macro">!</span>(<span class="self">self</span>.<span class="number">0</span>.<span class="ident">_broadcast</span>(<span class="ident">tx</span>))<span class="question-mark">?</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_height</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="macro">await_or_block</span><span class="macro">!</span>(<span class="self">self</span>.<span class="number">0</span>.<span class="ident">_get_height</span>())<span class="question-mark">?</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">estimate_fee</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">target</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">FeeRate</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">estimates</span> <span class="op">=</span> <span class="macro">await_or_block</span><span class="macro">!</span>(<span class="self">self</span>.<span class="number">0</span>.<span class="ident">_get_fee_estimates</span>())<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="ident">fee_val</span> <span class="op">=</span> <span class="ident">estimates</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="ident">v</span>)<span class="op">|</span> <span class="prelude-val">Ok</span>::<span class="op"><</span><span class="kw">_</span>, <span class="ident">std</span>::<span class="ident">num</span>::<span class="ident">ParseIntError</span><span class="op">></span>((<span class="ident">k</span>.<span class="ident">parse</span>::<span class="op"><</span><span class="ident">usize</span><span class="op">></span>()<span class="question-mark">?</span>, <span class="ident">v</span>)))
+ .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()
+ .<span class="ident">map_err</span>(<span class="op">|</span><span class="ident">e</span><span class="op">|</span> <span class="ident">Error</span>::<span class="ident">Generic</span>(<span class="ident">e</span>.<span class="ident">to_string</span>()))<span class="question-mark">?</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">take_while</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">k</span> <span class="op"><</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">target</span>)
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">v</span>)<span class="op">|</span> <span class="ident">v</span>)
+ .<span class="ident">last</span>()
+ .<span class="ident">unwrap_or</span>(<span class="number">1.0</span>);
+
+ <span class="prelude-val">Ok</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="ident">fee_val</span> <span class="kw">as</span> <span class="ident">f32</span>))
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">UrlClient</span> {
+ <span class="kw">fn</span> <span class="ident">script_to_scripthash</span>(<span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>) <span class="op">-</span><span class="op">></span> <span class="ident">String</span> {
+ <span class="ident">sha256</span>::<span class="ident">Hash</span>::<span class="ident">hash</span>(<span class="ident">script</span>.<span class="ident">as_bytes</span>()).<span class="ident">into_inner</span>().<span class="ident">to_hex</span>()
+ }
+
+ <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">_get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">EsploraError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">resp</span> <span class="op">=</span> <span class="self">self</span>
+ .<span class="ident">client</span>
+ .<span class="ident">get</span>(<span class="kw-2">&</span><span class="macro">format</span><span class="macro">!</span>(<span class="string">"{}/tx/{}/raw"</span>, <span class="self">self</span>.<span class="ident">url</span>, <span class="ident">txid</span>))
+ .<span class="ident">send</span>()
+ .<span class="kw">await</span><span class="question-mark">?</span>;
+
+ <span class="kw">if</span> <span class="kw">let</span> <span class="ident">StatusCode</span>::<span class="ident">NOT_FOUND</span> <span class="op">=</span> <span class="ident">resp</span>.<span class="ident">status</span>() {
+ <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>);
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">resp</span>.<span class="ident">error_for_status</span>()<span class="question-mark">?</span>.<span class="ident">bytes</span>().<span class="kw">await</span><span class="question-mark">?</span>)<span class="question-mark">?</span>))
+ }
+
+ <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">_broadcast</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">transaction</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">EsploraError</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">client</span>
+ .<span class="ident">post</span>(<span class="kw-2">&</span><span class="macro">format</span><span class="macro">!</span>(<span class="string">"{}/tx"</span>, <span class="self">self</span>.<span class="ident">url</span>))
+ .<span class="ident">body</span>(<span class="ident">serialize</span>(<span class="ident">transaction</span>).<span class="ident">to_hex</span>())
+ .<span class="ident">send</span>()
+ .<span class="kw">await</span><span class="question-mark">?</span>
+ .<span class="ident">error_for_status</span>()<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">_get_height</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">EsploraError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">req</span> <span class="op">=</span> <span class="self">self</span>
+ .<span class="ident">client</span>
+ .<span class="ident">get</span>(<span class="kw-2">&</span><span class="macro">format</span><span class="macro">!</span>(<span class="string">"{}/blocks/tip/height"</span>, <span class="self">self</span>.<span class="ident">url</span>))
+ .<span class="ident">send</span>()
+ .<span class="kw">await</span><span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">req</span>.<span class="ident">error_for_status</span>()<span class="question-mark">?</span>.<span class="ident">text</span>().<span class="kw">await</span><span class="question-mark">?</span>.<span class="ident">parse</span>()<span class="question-mark">?</span>)
+ }
+
+ <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">_script_get_history</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSGetHistoryRes</span><span class="op">></span>, <span class="ident">EsploraError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
+ <span class="kw">let</span> <span class="ident">scripthash</span> <span class="op">=</span> <span class="self">Self</span>::<span class="ident">script_to_scripthash</span>(<span class="ident">script</span>);
+
+ <span class="comment">// Add the unconfirmed transactions first</span>
+ <span class="ident">result</span>.<span class="ident">extend</span>(
+ <span class="self">self</span>.<span class="ident">client</span>
+ .<span class="ident">get</span>(<span class="kw-2">&</span><span class="macro">format</span><span class="macro">!</span>(
+ <span class="string">"{}/scripthash/{}/txs/mempool"</span>,
+ <span class="self">self</span>.<span class="ident">url</span>, <span class="ident">scripthash</span>
+ ))
+ .<span class="ident">send</span>()
+ .<span class="kw">await</span><span class="question-mark">?</span>
+ .<span class="ident">error_for_status</span>()<span class="question-mark">?</span>
+ .<span class="ident">json</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">EsploraGetHistory</span><span class="op">></span><span class="op">></span>()
+ .<span class="kw">await</span><span class="question-mark">?</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">ELSGetHistoryRes</span> {
+ <span class="ident">tx_hash</span>: <span class="ident">x</span>.<span class="ident">txid</span>,
+ <span class="ident">height</span>: <span class="ident">x</span>.<span class="ident">status</span>.<span class="ident">block_height</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>) <span class="kw">as</span> <span class="ident">i32</span>,
+ }),
+ );
+
+ <span class="macro">debug</span><span class="macro">!</span>(
+ <span class="string">"Found {} mempool txs for {} - {:?}"</span>,
+ <span class="ident">result</span>.<span class="ident">len</span>(),
+ <span class="ident">scripthash</span>,
+ <span class="ident">script</span>
+ );
+
+ <span class="comment">// Then go through all the pages of confirmed transactions</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">last_txid</span> <span class="op">=</span> <span class="ident">String</span>::<span class="ident">new</span>();
+ <span class="kw">loop</span> {
+ <span class="kw">let</span> <span class="ident">response</span> <span class="op">=</span> <span class="self">self</span>
+ .<span class="ident">client</span>
+ .<span class="ident">get</span>(<span class="kw-2">&</span><span class="macro">format</span><span class="macro">!</span>(
+ <span class="string">"{}/scripthash/{}/txs/chain/{}"</span>,
+ <span class="self">self</span>.<span class="ident">url</span>, <span class="ident">scripthash</span>, <span class="ident">last_txid</span>
+ ))
+ .<span class="ident">send</span>()
+ .<span class="kw">await</span><span class="question-mark">?</span>
+ .<span class="ident">error_for_status</span>()<span class="question-mark">?</span>
+ .<span class="ident">json</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">EsploraGetHistory</span><span class="op">></span><span class="op">></span>()
+ .<span class="kw">await</span><span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">len</span> <span class="op">=</span> <span class="ident">response</span>.<span class="ident">len</span>();
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">elem</span>) <span class="op">=</span> <span class="ident">response</span>.<span class="ident">last</span>() {
+ <span class="ident">last_txid</span> <span class="op">=</span> <span class="ident">elem</span>.<span class="ident">txid</span>.<span class="ident">to_hex</span>();
+ }
+
+ <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"... adding {} confirmed transactions"</span>, <span class="ident">len</span>);
+
+ <span class="ident">result</span>.<span class="ident">extend</span>(<span class="ident">response</span>.<span class="ident">into_iter</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">ELSGetHistoryRes</span> {
+ <span class="ident">tx_hash</span>: <span class="ident">x</span>.<span class="ident">txid</span>,
+ <span class="ident">height</span>: <span class="ident">x</span>.<span class="ident">status</span>.<span class="ident">block_height</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>) <span class="kw">as</span> <span class="ident">i32</span>,
+ }));
+
+ <span class="kw">if</span> <span class="ident">len</span> <span class="op"><</span> <span class="number">25</span> {
+ <span class="kw">break</span>;
+ }
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">result</span>)
+ }
+
+ <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">_script_list_unspent</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSListUnspentRes</span><span class="op">></span>, <span class="ident">EsploraError</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>
+ .<span class="ident">client</span>
+ .<span class="ident">get</span>(<span class="kw-2">&</span><span class="macro">format</span><span class="macro">!</span>(
+ <span class="string">"{}/scripthash/{}/utxo"</span>,
+ <span class="self">self</span>.<span class="ident">url</span>,
+ <span class="self">Self</span>::<span class="ident">script_to_scripthash</span>(<span class="ident">script</span>)
+ ))
+ .<span class="ident">send</span>()
+ .<span class="kw">await</span><span class="question-mark">?</span>
+ .<span class="ident">error_for_status</span>()<span class="question-mark">?</span>
+ .<span class="ident">json</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">EsploraListUnspent</span><span class="op">></span><span class="op">></span>()
+ .<span class="kw">await</span><span class="question-mark">?</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">ELSListUnspentRes</span> {
+ <span class="ident">tx_hash</span>: <span class="ident">x</span>.<span class="ident">txid</span>,
+ <span class="ident">height</span>: <span class="ident">x</span>.<span class="ident">status</span>.<span class="ident">block_height</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>),
+ <span class="ident">tx_pos</span>: <span class="ident">x</span>.<span class="ident">vout</span>,
+ })
+ .<span class="ident">collect</span>())
+ }
+
+ <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">_get_fee_estimates</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">HashMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">f64</span><span class="op">></span>, <span class="ident">EsploraError</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>
+ .<span class="ident">client</span>
+ .<span class="ident">get</span>(<span class="kw-2">&</span><span class="macro">format</span><span class="macro">!</span>(<span class="string">"{}/fee-estimates"</span>, <span class="self">self</span>.<span class="ident">url</span>,))
+ .<span class="ident">send</span>()
+ .<span class="kw">await</span><span class="question-mark">?</span>
+ .<span class="ident">error_for_status</span>()<span class="question-mark">?</span>
+ .<span class="ident">json</span>::<span class="op"><</span><span class="ident">HashMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">f64</span><span class="op">></span><span class="op">></span>()
+ .<span class="kw">await</span><span class="question-mark">?</span>)
+ }
+}
+
+<span class="attribute">#[<span class="ident">maybe_async</span>]</span>
+<span class="kw">impl</span> <span class="ident">ElectrumLikeSync</span> <span class="kw">for</span> <span class="ident">UrlClient</span> {
+ <span class="kw">fn</span> <span class="ident">els_batch_script_get_history</span><span class="op"><</span><span class="lifetime">'s</span>, <span class="ident">I</span>: <span class="ident">IntoIterator</span><span class="op"><</span><span class="ident">Item</span> <span class="op">=</span> <span class="kw-2">&</span><span class="lifetime">'s</span> <span class="ident">Script</span><span class="op">></span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">scripts</span>: <span class="ident">I</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSGetHistoryRes</span><span class="op">></span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">future</span> <span class="op">=</span> <span class="kw">async</span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">stream</span>::<span class="ident">iter</span>(<span class="ident">scripts</span>)
+ .<span class="ident">then</span>(<span class="op">|</span><span class="ident">script</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">_script_get_history</span>(<span class="kw-2">&</span><span class="ident">script</span>))
+ .<span class="ident">try_collect</span>()
+ .<span class="kw">await</span><span class="question-mark">?</span>)
+ };
+
+ <span class="macro">await_or_block</span><span class="macro">!</span>(<span class="ident">future</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">els_batch_script_list_unspent</span><span class="op"><</span><span class="lifetime">'s</span>, <span class="ident">I</span>: <span class="ident">IntoIterator</span><span class="op"><</span><span class="ident">Item</span> <span class="op">=</span> <span class="kw-2">&</span><span class="lifetime">'s</span> <span class="ident">Script</span><span class="op">></span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">scripts</span>: <span class="ident">I</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSListUnspentRes</span><span class="op">></span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">future</span> <span class="op">=</span> <span class="kw">async</span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">stream</span>::<span class="ident">iter</span>(<span class="ident">scripts</span>)
+ .<span class="ident">then</span>(<span class="op">|</span><span class="ident">script</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">_script_list_unspent</span>(<span class="kw-2">&</span><span class="ident">script</span>))
+ .<span class="ident">try_collect</span>()
+ .<span class="kw">await</span><span class="question-mark">?</span>)
+ };
+
+ <span class="macro">await_or_block</span><span class="macro">!</span>(<span class="ident">future</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">els_transaction_get</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Transaction</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="macro">await_or_block</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">_get_tx</span>(<span class="ident">txid</span>))<span class="question-mark">?</span>
+ .<span class="ident">ok_or_else</span>(<span class="op">|</span><span class="op">|</span> <span class="ident">EsploraError</span>::<span class="ident">TransactionNotFound</span>(<span class="kw-2">*</span><span class="ident">txid</span>))<span class="question-mark">?</span>)
+ }
+}
+
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Deserialize</span>)]</span>
+<span class="kw">struct</span> <span class="ident">EsploraGetHistoryStatus</span> {
+ <span class="ident">block_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
+}
+
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Deserialize</span>)]</span>
+<span class="kw">struct</span> <span class="ident">EsploraGetHistory</span> {
+ <span class="ident">txid</span>: <span class="ident">Txid</span>,
+ <span class="ident">status</span>: <span class="ident">EsploraGetHistoryStatus</span>,
+}
+
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Deserialize</span>)]</span>
+<span class="kw">struct</span> <span class="ident">EsploraListUnspent</span> {
+ <span class="ident">txid</span>: <span class="ident">Txid</span>,
+ <span class="ident">vout</span>: <span class="ident">usize</span>,
+ <span class="ident">status</span>: <span class="ident">EsploraGetHistoryStatus</span>,
+}
+
+<span class="doccomment">/// Errors that can happen during a sync with [`EsploraBlockchain`]</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">EsploraError</span> {
+ <span class="doccomment">/// Error with the HTTP call</span>
+ <span class="ident">Reqwest</span>(<span class="ident">reqwest</span>::<span class="ident">Error</span>),
+ <span class="doccomment">/// Invalid number returned</span>
+ <span class="ident">Parsing</span>(<span class="ident">std</span>::<span class="ident">num</span>::<span class="ident">ParseIntError</span>),
+ <span class="doccomment">/// Invalid Bitcoin data returned</span>
+ <span class="ident">BitcoinEncoding</span>(<span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span>),
+
+ <span class="doccomment">/// Transaction not found</span>
+ <span class="ident">TransactionNotFound</span>(<span class="ident">Txid</span>),
+}
+
+<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">EsploraError</span> {
+ <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
+ <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"{:?}"</span>, <span class="self">self</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span> <span class="kw">for</span> <span class="ident">EsploraError</span> {}
+
+<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">reqwest</span>::<span class="ident">Error</span><span class="op">></span> <span class="kw">for</span> <span class="ident">EsploraError</span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">other</span>: <span class="ident">reqwest</span>::<span class="ident">Error</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">EsploraError</span>::<span class="ident">Reqwest</span>(<span class="ident">other</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">std</span>::<span class="ident">num</span>::<span class="ident">ParseIntError</span><span class="op">></span> <span class="kw">for</span> <span class="ident">EsploraError</span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">other</span>: <span class="ident">std</span>::<span class="ident">num</span>::<span class="ident">ParseIntError</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">EsploraError</span>::<span class="ident">Parsing</span>(<span class="ident">other</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span><span class="op">></span> <span class="kw">for</span> <span class="ident">EsploraError</span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">other</span>: <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">EsploraError</span>::<span class="ident">BitcoinEncoding</span>(<span class="ident">other</span>)
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/blockchain/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+<span id="163">163</span>
+<span id="164">164</span>
+<span id="165">165</span>
+<span id="166">166</span>
+<span id="167">167</span>
+<span id="168">168</span>
+<span id="169">169</span>
+<span id="170">170</span>
+<span id="171">171</span>
+<span id="172">172</span>
+<span id="173">173</span>
+<span id="174">174</span>
+<span id="175">175</span>
+<span id="176">176</span>
+<span id="177">177</span>
+<span id="178">178</span>
+<span id="179">179</span>
+<span id="180">180</span>
+<span id="181">181</span>
+<span id="182">182</span>
+<span id="183">183</span>
+<span id="184">184</span>
+<span id="185">185</span>
+<span id="186">186</span>
+<span id="187">187</span>
+<span id="188">188</span>
+<span id="189">189</span>
+<span id="190">190</span>
+<span id="191">191</span>
+<span id="192">192</span>
+<span id="193">193</span>
+<span id="194">194</span>
+<span id="195">195</span>
+<span id="196">196</span>
+<span id="197">197</span>
+<span id="198">198</span>
+<span id="199">199</span>
+<span id="200">200</span>
+<span id="201">201</span>
+<span id="202">202</span>
+<span id="203">203</span>
+<span id="204">204</span>
+<span id="205">205</span>
+<span id="206">206</span>
+<span id="207">207</span>
+<span id="208">208</span>
+<span id="209">209</span>
+<span id="210">210</span>
+<span id="211">211</span>
+<span id="212">212</span>
+<span id="213">213</span>
+<span id="214">214</span>
+<span id="215">215</span>
+<span id="216">216</span>
+<span id="217">217</span>
+<span id="218">218</span>
+<span id="219">219</span>
+<span id="220">220</span>
+<span id="221">221</span>
+<span id="222">222</span>
+<span id="223">223</span>
+<span id="224">224</span>
+<span id="225">225</span>
+<span id="226">226</span>
+<span id="227">227</span>
+<span id="228">228</span>
+<span id="229">229</span>
+<span id="230">230</span>
+<span id="231">231</span>
+<span id="232">232</span>
+<span id="233">233</span>
+<span id="234">234</span>
+<span id="235">235</span>
+<span id="236">236</span>
+<span id="237">237</span>
+<span id="238">238</span>
+<span id="239">239</span>
+<span id="240">240</span>
+<span id="241">241</span>
+<span id="242">242</span>
+<span id="243">243</span>
+<span id="244">244</span>
+<span id="245">245</span>
+<span id="246">246</span>
+<span id="247">247</span>
+<span id="248">248</span>
+<span id="249">249</span>
+<span id="250">250</span>
+<span id="251">251</span>
+<span id="252">252</span>
+<span id="253">253</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="doccomment">//! Blockchain backends</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! This module provides the implementation of a few commonly-used backends like</span>
+<span class="doccomment">//! [Electrum](crate::blockchain::electrum), [Esplora](crate::blockchain::esplora) and</span>
+<span class="doccomment">//! [Compact Filters/Neutrino](crate::blockchain::compact_filters), along with a generalized trait</span>
+<span class="doccomment">//! [`Blockchain`] that can be implemented to build customized backends.</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashSet</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ops</span>::<span class="ident">Deref</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">mpsc</span>::{<span class="ident">channel</span>, <span class="ident">Receiver</span>, <span class="ident">Sender</span>};
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>;
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Transaction</span>, <span class="ident">Txid</span>};
+
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">BatchDatabase</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">FeeRate</span>;
+
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">mod</span> <span class="ident">utils</span>;
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"electrum"</span>)]</span>
+<span class="attribute">#[<span class="ident">cfg_attr</span>(<span class="ident">docsrs</span>, <span class="ident">doc</span>(<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"electrum"</span>)))]</span>
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">electrum</span>;
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"electrum"</span>)]</span>
+<span class="kw">pub</span> <span class="kw">use</span> <span class="self">self</span>::<span class="ident">electrum</span>::<span class="ident">ElectrumBlockchain</span>;
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"esplora"</span>)]</span>
+<span class="attribute">#[<span class="ident">cfg_attr</span>(<span class="ident">docsrs</span>, <span class="ident">doc</span>(<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"esplora"</span>)))]</span>
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">esplora</span>;
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"esplora"</span>)]</span>
+<span class="kw">pub</span> <span class="kw">use</span> <span class="self">self</span>::<span class="ident">esplora</span>::<span class="ident">EsploraBlockchain</span>;
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"compact_filters"</span>)]</span>
+<span class="attribute">#[<span class="ident">cfg_attr</span>(<span class="ident">docsrs</span>, <span class="ident">doc</span>(<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"compact_filters"</span>)))]</span>
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">compact_filters</span>;
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"compact_filters"</span>)]</span>
+<span class="kw">pub</span> <span class="kw">use</span> <span class="self">self</span>::<span class="ident">compact_filters</span>::<span class="ident">CompactFiltersBlockchain</span>;
+
+<span class="doccomment">/// Capabilities that can be supported by a [`Blockchain`] backend</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">Copy</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>, <span class="ident">Hash</span>)]</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">Capability</span> {
+ <span class="doccomment">/// Can recover the full history of a wallet and not only the set of currently spendable UTXOs</span>
+ <span class="ident">FullHistory</span>,
+ <span class="doccomment">/// Can fetch any historical transaction given its txid</span>
+ <span class="ident">GetAnyTx</span>,
+ <span class="doccomment">/// Can compute accurate fees for the transactions found during sync</span>
+ <span class="ident">AccurateFees</span>,
+}
+
+<span class="doccomment">/// Marker trait for a blockchain backend</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This is a marker trait for blockchain types. It is automatically implemented for types that</span>
+<span class="doccomment">/// implement [`Blockchain`], so as a user of the library you won't have to implement this</span>
+<span class="doccomment">/// manually.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Users of the library will probably never have to implement this trait manually, but they</span>
+<span class="doccomment">/// could still need to import it to define types and structs with generics;</span>
+<span class="doccomment">/// Implementing only the marker trait is pointless, since [`OfflineBlockchain`]</span>
+<span class="doccomment">/// already does that, and whenever [`Blockchain`] is implemented, the marker trait is also</span>
+<span class="doccomment">/// automatically implemented by the library.</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">BlockchainMarker</span> {}
+
+<span class="doccomment">/// The [`BlockchainMarker`] marker trait is automatically implemented for [`Blockchain`] types</span>
+<span class="kw">impl</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">Blockchain</span><span class="op">></span> <span class="ident">BlockchainMarker</span> <span class="kw">for</span> <span class="ident">T</span> {}
+
+<span class="doccomment">/// Type that only implements [`Blockchain`] and is always "offline"</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">OfflineBlockchain</span>;
+<span class="kw">impl</span> <span class="ident">BlockchainMarker</span> <span class="kw">for</span> <span class="ident">OfflineBlockchain</span> {}
+
+<span class="doccomment">/// Trait that defines the actions that must be supported by a blockchain backend</span>
+<span class="attribute">#[<span class="ident">maybe_async</span>]</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">Blockchain</span>: <span class="ident">BlockchainMarker</span> {
+ <span class="doccomment">/// Return the set of [`Capability`] supported by this backend</span>
+ <span class="kw">fn</span> <span class="ident">get_capabilities</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Capability</span><span class="op">></span>;
+
+ <span class="doccomment">/// Setup the backend and populate the internal database for the first time</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This method is the equivalent of [`Blockchain::sync`], but it's guaranteed to only be</span>
+ <span class="doccomment">/// called once, at the first [`Wallet::sync`](crate::wallet::Wallet::sync).</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// The rationale behind the distinction between `sync` and `setup` is that some custom backends</span>
+ <span class="doccomment">/// might need to perform specific actions only the first time they are synced.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// For types that do not have that distinction, only this method can be implemented, since</span>
+ <span class="doccomment">/// [`Blockchain::sync`] defaults to calling this internally if not overridden.</span>
+ <span class="kw">fn</span> <span class="ident">setup</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span>, <span class="ident">P</span>: <span class="lifetime">'static</span> <span class="op">+</span> <span class="ident">Progress</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">stop_gap</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
+ <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
+ <span class="ident">progress_update</span>: <span class="ident">P</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Populate the internal database with transactions and UTXOs</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// If not overridden, it defaults to calling [`Blockchain::setup`] internally.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This method should implement the logic required to iterate over the list of the wallet's</span>
+ <span class="doccomment">/// script_pubkeys using [`Database::iter_script_pubkeys`] and look for relevant transactions</span>
+ <span class="doccomment">/// in the blockchain to populate the database with [`BatchOperations::set_tx`] and</span>
+ <span class="doccomment">/// [`BatchOperations::set_utxo`].</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This method should also take care of removing UTXOs that are seen as spent in the</span>
+ <span class="doccomment">/// blockchain, using [`BatchOperations::del_utxo`].</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// The `progress_update` object can be used to give the caller updates about the progress by using</span>
+ <span class="doccomment">/// [`Progress::update`].</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// [`Database::iter_script_pubkeys`]: crate::database::Database::iter_script_pubkeys</span>
+ <span class="doccomment">/// [`BatchOperations::set_tx`]: crate::database::BatchOperations::set_tx</span>
+ <span class="doccomment">/// [`BatchOperations::set_utxo`]: crate::database::BatchOperations::set_utxo</span>
+ <span class="doccomment">/// [`BatchOperations::del_utxo`]: crate::database::BatchOperations::del_utxo</span>
+ <span class="kw">fn</span> <span class="ident">sync</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span>, <span class="ident">P</span>: <span class="lifetime">'static</span> <span class="op">+</span> <span class="ident">Progress</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">stop_gap</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
+ <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
+ <span class="ident">progress_update</span>: <span class="ident">P</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">setup</span>(<span class="ident">stop_gap</span>, <span class="ident">database</span>, <span class="ident">progress_update</span>))
+ }
+
+ <span class="doccomment">/// Fetch a transaction from the blockchain given its txid</span>
+ <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Broadcast a transaction</span>
+ <span class="kw">fn</span> <span class="ident">broadcast</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
+
+ <span class="doccomment">/// Return the current height</span>
+ <span class="kw">fn</span> <span class="ident">get_height</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Estimate the fee rate required to confirm a transaction in a given `target` of blocks</span>
+ <span class="kw">fn</span> <span class="ident">estimate_fee</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">target</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">FeeRate</span>, <span class="ident">Error</span><span class="op">></span>;
+}
+
+<span class="doccomment">/// Data sent with a progress update over a [`channel`]</span>
+<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">ProgressData</span> <span class="op">=</span> (<span class="ident">f32</span>, <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>);
+
+<span class="doccomment">/// Trait for types that can receive and process progress updates during [`Blockchain::sync`] and</span>
+<span class="doccomment">/// [`Blockchain::setup`]</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">Progress</span>: <span class="ident">Send</span> {
+ <span class="doccomment">/// Send a new progress update</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// The `progress` value should be in the range 0.0 - 100.0, and the `message` value is an</span>
+ <span class="doccomment">/// optional text message that can be displayed to the user.</span>
+ <span class="kw">fn</span> <span class="ident">update</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">progress</span>: <span class="ident">f32</span>, <span class="ident">message</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
+}
+
+<span class="doccomment">/// Shortcut to create a [`channel`] (pair of [`Sender`] and [`Receiver`]) that can transport [`ProgressData`]</span>
+<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">progress</span>() <span class="op">-</span><span class="op">></span> (<span class="ident">Sender</span><span class="op"><</span><span class="ident">ProgressData</span><span class="op">></span>, <span class="ident">Receiver</span><span class="op"><</span><span class="ident">ProgressData</span><span class="op">></span>) {
+ <span class="ident">channel</span>()
+}
+
+<span class="kw">impl</span> <span class="ident">Progress</span> <span class="kw">for</span> <span class="ident">Sender</span><span class="op"><</span><span class="ident">ProgressData</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">update</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">progress</span>: <span class="ident">f32</span>, <span class="ident">message</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="ident">progress</span> <span class="op"><</span> <span class="number">0.0</span> <span class="op">|</span><span class="op">|</span> <span class="ident">progress</span> <span class="op">></span> <span class="number">100.0</span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">InvalidProgressValue</span>(<span class="ident">progress</span>));
+ }
+
+ <span class="self">self</span>.<span class="ident">send</span>((<span class="ident">progress</span>, <span class="ident">message</span>))
+ .<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">Error</span>::<span class="ident">ProgressUpdateError</span>)
+ }
+}
+
+<span class="doccomment">/// Type that implements [`Progress`] and drops every update received</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">NoopProgress</span>;
+
+<span class="doccomment">/// Create a new instance of [`NoopProgress`]</span>
+<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">noop_progress</span>() <span class="op">-</span><span class="op">></span> <span class="ident">NoopProgress</span> {
+ <span class="ident">NoopProgress</span>
+}
+
+<span class="kw">impl</span> <span class="ident">Progress</span> <span class="kw">for</span> <span class="ident">NoopProgress</span> {
+ <span class="kw">fn</span> <span class="ident">update</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">_progress</span>: <span class="ident">f32</span>, <span class="ident">_message</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(())
+ }
+}
+
+<span class="doccomment">/// Type that implements [`Progress`] and logs at level `INFO` every update received</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">LogProgress</span>;
+
+<span class="doccomment">/// Create a nwe instance of [`LogProgress`]</span>
+<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">log_progress</span>() <span class="op">-</span><span class="op">></span> <span class="ident">LogProgress</span> {
+ <span class="ident">LogProgress</span>
+}
+
+<span class="kw">impl</span> <span class="ident">Progress</span> <span class="kw">for</span> <span class="ident">LogProgress</span> {
+ <span class="kw">fn</span> <span class="ident">update</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">progress</span>: <span class="ident">f32</span>, <span class="ident">message</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="ident">log</span>::<span class="macro">info</span><span class="macro">!</span>(<span class="string">"Sync {:.3}%: `{}`"</span>, <span class="ident">progress</span>, <span class="ident">message</span>.<span class="ident">unwrap_or</span>(<span class="string">""</span>.<span class="ident">into</span>()));
+
+ <span class="prelude-val">Ok</span>(())
+ }
+}
+
+<span class="attribute">#[<span class="ident">maybe_async</span>]</span>
+<span class="kw">impl</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">Blockchain</span><span class="op">></span> <span class="ident">Blockchain</span> <span class="kw">for</span> <span class="ident">Arc</span><span class="op"><</span><span class="ident">T</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">get_capabilities</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Capability</span><span class="op">></span> {
+ <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">deref</span>().<span class="ident">get_capabilities</span>())
+ }
+
+ <span class="kw">fn</span> <span class="ident">setup</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span>, <span class="ident">P</span>: <span class="lifetime">'static</span> <span class="op">+</span> <span class="ident">Progress</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">stop_gap</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
+ <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
+ <span class="ident">progress_update</span>: <span class="ident">P</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">deref</span>().<span class="ident">setup</span>(<span class="ident">stop_gap</span>, <span class="ident">database</span>, <span class="ident">progress_update</span>))
+ }
+
+ <span class="kw">fn</span> <span class="ident">sync</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span>, <span class="ident">P</span>: <span class="lifetime">'static</span> <span class="op">+</span> <span class="ident">Progress</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">stop_gap</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
+ <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
+ <span class="ident">progress_update</span>: <span class="ident">P</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">deref</span>().<span class="ident">sync</span>(<span class="ident">stop_gap</span>, <span class="ident">database</span>, <span class="ident">progress_update</span>))
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">deref</span>().<span class="ident">get_tx</span>(<span class="ident">txid</span>))
+ }
+ <span class="kw">fn</span> <span class="ident">broadcast</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">deref</span>().<span class="ident">broadcast</span>(<span class="ident">tx</span>))
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_height</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">deref</span>().<span class="ident">get_height</span>())
+ }
+ <span class="kw">fn</span> <span class="ident">estimate_fee</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">target</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">FeeRate</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">deref</span>().<span class="ident">estimate_fee</span>(<span class="ident">target</span>))
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/blockchain/utils.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>utils.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+<span id="163">163</span>
+<span id="164">164</span>
+<span id="165">165</span>
+<span id="166">166</span>
+<span id="167">167</span>
+<span id="168">168</span>
+<span id="169">169</span>
+<span id="170">170</span>
+<span id="171">171</span>
+<span id="172">172</span>
+<span id="173">173</span>
+<span id="174">174</span>
+<span id="175">175</span>
+<span id="176">176</span>
+<span id="177">177</span>
+<span id="178">178</span>
+<span id="179">179</span>
+<span id="180">180</span>
+<span id="181">181</span>
+<span id="182">182</span>
+<span id="183">183</span>
+<span id="184">184</span>
+<span id="185">185</span>
+<span id="186">186</span>
+<span id="187">187</span>
+<span id="188">188</span>
+<span id="189">189</span>
+<span id="190">190</span>
+<span id="191">191</span>
+<span id="192">192</span>
+<span id="193">193</span>
+<span id="194">194</span>
+<span id="195">195</span>
+<span id="196">196</span>
+<span id="197">197</span>
+<span id="198">198</span>
+<span id="199">199</span>
+<span id="200">200</span>
+<span id="201">201</span>
+<span id="202">202</span>
+<span id="203">203</span>
+<span id="204">204</span>
+<span id="205">205</span>
+<span id="206">206</span>
+<span id="207">207</span>
+<span id="208">208</span>
+<span id="209">209</span>
+<span id="210">210</span>
+<span id="211">211</span>
+<span id="212">212</span>
+<span id="213">213</span>
+<span id="214">214</span>
+<span id="215">215</span>
+<span id="216">216</span>
+<span id="217">217</span>
+<span id="218">218</span>
+<span id="219">219</span>
+<span id="220">220</span>
+<span id="221">221</span>
+<span id="222">222</span>
+<span id="223">223</span>
+<span id="224">224</span>
+<span id="225">225</span>
+<span id="226">226</span>
+<span id="227">227</span>
+<span id="228">228</span>
+<span id="229">229</span>
+<span id="230">230</span>
+<span id="231">231</span>
+<span id="232">232</span>
+<span id="233">233</span>
+<span id="234">234</span>
+<span id="235">235</span>
+<span id="236">236</span>
+<span id="237">237</span>
+<span id="238">238</span>
+<span id="239">239</span>
+<span id="240">240</span>
+<span id="241">241</span>
+<span id="242">242</span>
+<span id="243">243</span>
+<span id="244">244</span>
+<span id="245">245</span>
+<span id="246">246</span>
+<span id="247">247</span>
+<span id="248">248</span>
+<span id="249">249</span>
+<span id="250">250</span>
+<span id="251">251</span>
+<span id="252">252</span>
+<span id="253">253</span>
+<span id="254">254</span>
+<span id="255">255</span>
+<span id="256">256</span>
+<span id="257">257</span>
+<span id="258">258</span>
+<span id="259">259</span>
+<span id="260">260</span>
+<span id="261">261</span>
+<span id="262">262</span>
+<span id="263">263</span>
+<span id="264">264</span>
+<span id="265">265</span>
+<span id="266">266</span>
+<span id="267">267</span>
+<span id="268">268</span>
+<span id="269">269</span>
+<span id="270">270</span>
+<span id="271">271</span>
+<span id="272">272</span>
+<span id="273">273</span>
+<span id="274">274</span>
+<span id="275">275</span>
+<span id="276">276</span>
+<span id="277">277</span>
+<span id="278">278</span>
+<span id="279">279</span>
+<span id="280">280</span>
+<span id="281">281</span>
+<span id="282">282</span>
+<span id="283">283</span>
+<span id="284">284</span>
+<span id="285">285</span>
+<span id="286">286</span>
+<span id="287">287</span>
+<span id="288">288</span>
+<span id="289">289</span>
+<span id="290">290</span>
+<span id="291">291</span>
+<span id="292">292</span>
+<span id="293">293</span>
+<span id="294">294</span>
+<span id="295">295</span>
+<span id="296">296</span>
+<span id="297">297</span>
+<span id="298">298</span>
+<span id="299">299</span>
+<span id="300">300</span>
+<span id="301">301</span>
+<span id="302">302</span>
+<span id="303">303</span>
+<span id="304">304</span>
+<span id="305">305</span>
+<span id="306">306</span>
+<span id="307">307</span>
+<span id="308">308</span>
+<span id="309">309</span>
+<span id="310">310</span>
+<span id="311">311</span>
+<span id="312">312</span>
+<span id="313">313</span>
+<span id="314">314</span>
+<span id="315">315</span>
+<span id="316">316</span>
+<span id="317">317</span>
+<span id="318">318</span>
+<span id="319">319</span>
+<span id="320">320</span>
+<span id="321">321</span>
+<span id="322">322</span>
+<span id="323">323</span>
+<span id="324">324</span>
+<span id="325">325</span>
+<span id="326">326</span>
+<span id="327">327</span>
+<span id="328">328</span>
+<span id="329">329</span>
+<span id="330">330</span>
+<span id="331">331</span>
+<span id="332">332</span>
+<span id="333">333</span>
+<span id="334">334</span>
+<span id="335">335</span>
+<span id="336">336</span>
+<span id="337">337</span>
+<span id="338">338</span>
+<span id="339">339</span>
+<span id="340">340</span>
+<span id="341">341</span>
+<span id="342">342</span>
+<span id="343">343</span>
+<span id="344">344</span>
+<span id="345">345</span>
+<span id="346">346</span>
+<span id="347">347</span>
+<span id="348">348</span>
+<span id="349">349</span>
+<span id="350">350</span>
+<span id="351">351</span>
+<span id="352">352</span>
+<span id="353">353</span>
+<span id="354">354</span>
+<span id="355">355</span>
+<span id="356">356</span>
+<span id="357">357</span>
+<span id="358">358</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">cmp</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::{<span class="ident">HashSet</span>, <span class="ident">VecDeque</span>};
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">convert</span>::<span class="ident">TryFrom</span>;
+
+<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_imports</span>)]</span>
+<span class="kw">use</span> <span class="ident">log</span>::{<span class="ident">debug</span>, <span class="ident">error</span>, <span class="ident">info</span>, <span class="ident">trace</span>};
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Address</span>, <span class="ident">Network</span>, <span class="ident">OutPoint</span>, <span class="ident">Script</span>, <span class="ident">Transaction</span>, <span class="ident">Txid</span>};
+
+<span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::{<span class="ident">BatchDatabase</span>, <span class="ident">BatchOperations</span>, <span class="ident">DatabaseUtils</span>};
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::{<span class="ident">ScriptType</span>, <span class="ident">TransactionDetails</span>, <span class="ident">UTXO</span>};
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">utils</span>::<span class="ident">ChunksIterator</span>;
+
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">ELSGetHistoryRes</span> {
+ <span class="kw">pub</span> <span class="ident">height</span>: <span class="ident">i32</span>,
+ <span class="kw">pub</span> <span class="ident">tx_hash</span>: <span class="ident">Txid</span>,
+}
+
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">ELSListUnspentRes</span> {
+ <span class="kw">pub</span> <span class="ident">height</span>: <span class="ident">usize</span>,
+ <span class="kw">pub</span> <span class="ident">tx_hash</span>: <span class="ident">Txid</span>,
+ <span class="kw">pub</span> <span class="ident">tx_pos</span>: <span class="ident">usize</span>,
+}
+
+<span class="doccomment">/// Implements the synchronization logic for an Electrum-like client.</span>
+<span class="attribute">#[<span class="ident">maybe_async</span>]</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">ElectrumLikeSync</span> {
+ <span class="kw">fn</span> <span class="ident">els_batch_script_get_history</span><span class="op"><</span><span class="lifetime">'s</span>, <span class="ident">I</span>: <span class="ident">IntoIterator</span><span class="op"><</span><span class="ident">Item</span> <span class="op">=</span> <span class="kw-2">&</span><span class="lifetime">'s</span> <span class="ident">Script</span><span class="op">></span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">scripts</span>: <span class="ident">I</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSGetHistoryRes</span><span class="op">></span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+
+ <span class="kw">fn</span> <span class="ident">els_batch_script_list_unspent</span><span class="op"><</span><span class="lifetime">'s</span>, <span class="ident">I</span>: <span class="ident">IntoIterator</span><span class="op"><</span><span class="ident">Item</span> <span class="op">=</span> <span class="kw-2">&</span><span class="lifetime">'s</span> <span class="ident">Script</span><span class="op">></span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">scripts</span>: <span class="ident">I</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSListUnspentRes</span><span class="op">></span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+
+ <span class="kw">fn</span> <span class="ident">els_transaction_get</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Transaction</span>, <span class="ident">Error</span><span class="op">></span>;
+
+ <span class="comment">// Provided methods down here...</span>
+
+ <span class="kw">fn</span> <span class="ident">electrum_like_setup</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span>, <span class="ident">P</span>: <span class="ident">Progress</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">stop_gap</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
+ <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
+ <span class="ident">_progress_update</span>: <span class="ident">P</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="comment">// TODO: progress</span>
+
+ <span class="kw">let</span> <span class="ident">stop_gap</span> <span class="op">=</span> <span class="ident">stop_gap</span>.<span class="ident">unwrap_or</span>(<span class="number">20</span>);
+ <span class="kw">let</span> <span class="ident">batch_query_size</span> <span class="op">=</span> <span class="number">20</span>;
+
+ <span class="comment">// check unconfirmed tx, delete so they are retrieved later</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">del_batch</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">begin_batch</span>();
+ <span class="kw">for</span> <span class="ident">tx</span> <span class="kw">in</span> <span class="ident">database</span>.<span class="ident">iter_txs</span>(<span class="bool-val">false</span>)<span class="question-mark">?</span> {
+ <span class="kw">if</span> <span class="ident">tx</span>.<span class="ident">height</span>.<span class="ident">is_none</span>() {
+ <span class="ident">del_batch</span>.<span class="ident">del_tx</span>(<span class="kw-2">&</span><span class="ident">tx</span>.<span class="ident">txid</span>, <span class="bool-val">false</span>)<span class="question-mark">?</span>;
+ }
+ }
+ <span class="ident">database</span>.<span class="ident">commit_batch</span>(<span class="ident">del_batch</span>)<span class="question-mark">?</span>;
+
+ <span class="comment">// maximum derivation index for a change address that we've seen during sync</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">change_max_deriv</span> <span class="op">=</span> <span class="prelude-val">None</span>;
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">already_checked</span>: <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span> <span class="op">=</span> <span class="ident">HashSet</span>::<span class="ident">new</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">to_check_later</span> <span class="op">=</span> <span class="ident">VecDeque</span>::<span class="ident">with_capacity</span>(<span class="ident">batch_query_size</span>);
+
+ <span class="comment">// insert the first chunk</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iter_scriptpubkeys</span> <span class="op">=</span> <span class="ident">database</span>
+ .<span class="ident">iter_script_pubkeys</span>(<span class="prelude-val">Some</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>))<span class="question-mark">?</span>
+ .<span class="ident">into_iter</span>();
+ <span class="kw">let</span> <span class="ident">chunk</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span> <span class="op">=</span> <span class="ident">iter_scriptpubkeys</span>.<span class="ident">by_ref</span>().<span class="ident">take</span>(<span class="ident">batch_query_size</span>).<span class="ident">collect</span>();
+ <span class="kw">for</span> <span class="ident">item</span> <span class="kw">in</span> <span class="ident">chunk</span>.<span class="ident">into_iter</span>().<span class="ident">rev</span>() {
+ <span class="ident">to_check_later</span>.<span class="ident">push_front</span>(<span class="ident">item</span>);
+ }
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iterating_external</span> <span class="op">=</span> <span class="bool-val">true</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">index</span> <span class="op">=</span> <span class="number">0</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">last_found</span> <span class="op">=</span> <span class="prelude-val">None</span>;
+ <span class="kw">while</span> <span class="op">!</span><span class="ident">to_check_later</span>.<span class="ident">is_empty</span>() {
+ <span class="macro">trace</span><span class="macro">!</span>(<span class="string">"to_check_later size {}"</span>, <span class="ident">to_check_later</span>.<span class="ident">len</span>());
+
+ <span class="kw">let</span> <span class="ident">until</span> <span class="op">=</span> <span class="ident">cmp</span>::<span class="ident">min</span>(<span class="ident">to_check_later</span>.<span class="ident">len</span>(), <span class="ident">batch_query_size</span>);
+ <span class="kw">let</span> <span class="ident">chunk</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span> <span class="op">=</span> <span class="ident">to_check_later</span>.<span class="ident">drain</span>(..<span class="ident">until</span>).<span class="ident">collect</span>();
+ <span class="kw">let</span> <span class="ident">call_result</span> <span class="op">=</span> <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">els_batch_script_get_history</span>(<span class="ident">chunk</span>.<span class="ident">iter</span>()))<span class="question-mark">?</span>;
+
+ <span class="kw">for</span> (<span class="ident">script</span>, <span class="ident">history</span>) <span class="kw">in</span> <span class="ident">chunk</span>.<span class="ident">into_iter</span>().<span class="ident">zip</span>(<span class="ident">call_result</span>.<span class="ident">into_iter</span>()) {
+ <span class="macro">trace</span><span class="macro">!</span>(<span class="string">"received history for {:?}, size {}"</span>, <span class="ident">script</span>, <span class="ident">history</span>.<span class="ident">len</span>());
+
+ <span class="kw">if</span> <span class="op">!</span><span class="ident">history</span>.<span class="ident">is_empty</span>() {
+ <span class="ident">last_found</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">index</span>);
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">check_later_scripts</span> <span class="op">=</span> <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">check_history</span>(
+ <span class="ident">database</span>,
+ <span class="ident">script</span>,
+ <span class="ident">history</span>,
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">change_max_deriv</span>
+ ))<span class="question-mark">?</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">filter</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">already_checked</span>.<span class="ident">insert</span>(<span class="ident">x</span>.<span class="ident">clone</span>()))
+ .<span class="ident">collect</span>();
+ <span class="ident">to_check_later</span>.<span class="ident">append</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">check_later_scripts</span>);
+ }
+
+ <span class="ident">index</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
+ }
+
+ <span class="kw">match</span> <span class="ident">iterating_external</span> {
+ <span class="bool-val">true</span> <span class="kw">if</span> <span class="ident">index</span> <span class="op">-</span> <span class="ident">last_found</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>) <span class="op">></span><span class="op">=</span> <span class="ident">stop_gap</span> <span class="op">=</span><span class="op">></span> <span class="ident">iterating_external</span> <span class="op">=</span> <span class="bool-val">false</span>,
+ <span class="bool-val">true</span> <span class="op">=</span><span class="op">></span> {
+ <span class="macro">trace</span><span class="macro">!</span>(<span class="string">"pushing one more batch from `iter_scriptpubkeys`. index = {}, last_found = {:?}, stop_gap = {}"</span>, <span class="ident">index</span>, <span class="ident">last_found</span>, <span class="ident">stop_gap</span>);
+
+ <span class="kw">let</span> <span class="ident">chunk</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span> <span class="op">=</span>
+ <span class="ident">iter_scriptpubkeys</span>.<span class="ident">by_ref</span>().<span class="ident">take</span>(<span class="ident">batch_query_size</span>).<span class="ident">collect</span>();
+ <span class="kw">for</span> <span class="ident">item</span> <span class="kw">in</span> <span class="ident">chunk</span>.<span class="ident">into_iter</span>().<span class="ident">rev</span>() {
+ <span class="ident">to_check_later</span>.<span class="ident">push_front</span>(<span class="ident">item</span>);
+ }
+ }
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> {}
+ }
+ }
+
+ <span class="comment">// check utxo</span>
+ <span class="comment">// TODO: try to minimize network requests and re-use scripts if possible</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">begin_batch</span>();
+ <span class="kw">for</span> <span class="ident">chunk</span> <span class="kw">in</span> <span class="ident">ChunksIterator</span>::<span class="ident">new</span>(<span class="ident">database</span>.<span class="ident">iter_utxos</span>()<span class="question-mark">?</span>.<span class="ident">into_iter</span>(), <span class="ident">batch_query_size</span>) {
+ <span class="kw">let</span> <span class="ident">scripts</span>: <span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">chunk</span>.<span class="ident">iter</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="kw-2">&</span><span class="ident">u</span>.<span class="ident">txout</span>.<span class="ident">script_pubkey</span>).<span class="ident">collect</span>();
+ <span class="kw">let</span> <span class="ident">call_result</span> <span class="op">=</span> <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">els_batch_script_list_unspent</span>(<span class="ident">scripts</span>))<span class="question-mark">?</span>;
+
+ <span class="comment">// check which utxos are actually still unspent</span>
+ <span class="kw">for</span> (<span class="ident">utxo</span>, <span class="ident">list_unspent</span>) <span class="kw">in</span> <span class="ident">chunk</span>.<span class="ident">into_iter</span>().<span class="ident">zip</span>(<span class="ident">call_result</span>.<span class="ident">iter</span>()) {
+ <span class="macro">debug</span><span class="macro">!</span>(
+ <span class="string">"outpoint {:?} is unspent for me, list unspent is {:?}"</span>,
+ <span class="ident">utxo</span>.<span class="ident">outpoint</span>, <span class="ident">list_unspent</span>
+ );
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">spent</span> <span class="op">=</span> <span class="bool-val">true</span>;
+ <span class="kw">for</span> <span class="ident">unspent</span> <span class="kw">in</span> <span class="ident">list_unspent</span> {
+ <span class="kw">let</span> <span class="ident">res_outpoint</span> <span class="op">=</span> <span class="ident">OutPoint</span>::<span class="ident">new</span>(<span class="ident">unspent</span>.<span class="ident">tx_hash</span>, <span class="ident">unspent</span>.<span class="ident">tx_pos</span> <span class="kw">as</span> <span class="ident">u32</span>);
+ <span class="kw">if</span> <span class="ident">utxo</span>.<span class="ident">outpoint</span> <span class="op">=</span><span class="op">=</span> <span class="ident">res_outpoint</span> {
+ <span class="ident">spent</span> <span class="op">=</span> <span class="bool-val">false</span>;
+ <span class="kw">break</span>;
+ }
+ }
+ <span class="kw">if</span> <span class="ident">spent</span> {
+ <span class="macro">info</span><span class="macro">!</span>(<span class="string">"{} not anymore unspent, removing"</span>, <span class="ident">utxo</span>.<span class="ident">outpoint</span>);
+ <span class="ident">batch</span>.<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">utxo</span>.<span class="ident">outpoint</span>)<span class="question-mark">?</span>;
+ }
+ }
+ }
+
+ <span class="kw">let</span> <span class="ident">current_ext</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">get_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>)<span class="question-mark">?</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>);
+ <span class="kw">let</span> <span class="ident">first_ext_new</span> <span class="op">=</span> <span class="ident">last_found</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">+</span> <span class="number">1</span>).<span class="ident">unwrap_or</span>(<span class="number">0</span>) <span class="kw">as</span> <span class="ident">u32</span>;
+ <span class="kw">if</span> <span class="ident">first_ext_new</span> <span class="op">></span> <span class="ident">current_ext</span> {
+ <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Setting external index to {}"</span>, <span class="ident">first_ext_new</span>);
+ <span class="ident">database</span>.<span class="ident">set_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="ident">first_ext_new</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="kw">let</span> <span class="ident">current_int</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">get_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>)<span class="question-mark">?</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>);
+ <span class="kw">let</span> <span class="ident">first_int_new</span> <span class="op">=</span> <span class="ident">change_max_deriv</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">+</span> <span class="number">1</span>).<span class="ident">unwrap_or</span>(<span class="number">0</span>);
+ <span class="kw">if</span> <span class="ident">first_int_new</span> <span class="op">></span> <span class="ident">current_int</span> {
+ <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Setting internal index to {}"</span>, <span class="ident">first_int_new</span>);
+ <span class="ident">database</span>.<span class="ident">set_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>, <span class="ident">first_int_new</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="ident">database</span>.<span class="ident">commit_batch</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">fn</span> <span class="ident">check_tx_and_descendant</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
+ <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>,
+ <span class="ident">height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+ <span class="ident">cur_script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
+ <span class="ident">change_max_deriv</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="macro">debug</span><span class="macro">!</span>(
+ <span class="string">"check_tx_and_descendant of {}, height: {:?}, script: {}"</span>,
+ <span class="ident">txid</span>, <span class="ident">height</span>, <span class="ident">cur_script</span>
+ );
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">updates</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">begin_batch</span>();
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">database</span>.<span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="ident">txid</span>, <span class="bool-val">true</span>)<span class="question-mark">?</span> {
+ <span class="prelude-val">Some</span>(<span class="kw-2">mut</span> <span class="ident">saved_tx</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="comment">// update the height if it's different (in case of reorg)</span>
+ <span class="kw">if</span> <span class="ident">saved_tx</span>.<span class="ident">height</span> <span class="op">!</span><span class="op">=</span> <span class="ident">height</span> {
+ <span class="macro">info</span><span class="macro">!</span>(
+ <span class="string">"updating height from {:?} to {:?} for tx {}"</span>,
+ <span class="ident">saved_tx</span>.<span class="ident">height</span>, <span class="ident">height</span>, <span class="ident">txid</span>
+ );
+ <span class="ident">saved_tx</span>.<span class="ident">height</span> <span class="op">=</span> <span class="ident">height</span>;
+ <span class="ident">updates</span>.<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">saved_tx</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"already have {} in db, returning the cached version"</span>, <span class="ident">txid</span>);
+
+ <span class="comment">// unwrap since we explicitly ask for the raw_tx, if it's not present something</span>
+ <span class="comment">// went wrong</span>
+ <span class="ident">saved_tx</span>.<span class="ident">transaction</span>.<span class="ident">unwrap</span>()
+ }
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">fetched_tx</span> <span class="op">=</span> <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">els_transaction_get</span>(<span class="kw-2">&</span><span class="ident">txid</span>))<span class="question-mark">?</span>;
+ <span class="ident">database</span>.<span class="ident">set_raw_tx</span>(<span class="kw-2">&</span><span class="ident">fetched_tx</span>)<span class="question-mark">?</span>;
+
+ <span class="ident">fetched_tx</span>
+ }
+ };
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">incoming</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">outgoing</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">inputs_sum</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">outputs_sum</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
+
+ <span class="comment">// look for our own inputs</span>
+ <span class="kw">for</span> (<span class="ident">i</span>, <span class="ident">input</span>) <span class="kw">in</span> <span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
+ <span class="comment">// the fact that we visit addresses in a BFS fashion starting from the external addresses</span>
+ <span class="comment">// should ensure that this query is always consistent (i.e. when we get to call this all</span>
+ <span class="comment">// the transactions at a lower depth have already been indexed, so if an outpoint is ours</span>
+ <span class="comment">// we are guaranteed to have it in the db).</span>
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">previous_output</span>) <span class="op">=</span> <span class="ident">database</span>.<span class="ident">get_previous_output</span>(<span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">previous_output</span>)<span class="question-mark">?</span> {
+ <span class="ident">inputs_sum</span> <span class="op">+</span><span class="op">=</span> <span class="ident">previous_output</span>.<span class="ident">value</span>;
+
+ <span class="kw">if</span> <span class="ident">database</span>.<span class="ident">is_mine</span>(<span class="kw-2">&</span><span class="ident">previous_output</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span> {
+ <span class="ident">outgoing</span> <span class="op">+</span><span class="op">=</span> <span class="ident">previous_output</span>.<span class="ident">value</span>;
+
+ <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"{} input #{} is mine, removing from utxo"</span>, <span class="ident">txid</span>, <span class="ident">i</span>);
+ <span class="ident">updates</span>.<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">previous_output</span>)<span class="question-mark">?</span>;
+ }
+ } <span class="kw">else</span> {
+ <span class="comment">// The input is not ours, but we still need to count it for the fees. so fetch the</span>
+ <span class="comment">// tx (from the database or from network) and check it</span>
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">database</span>.<span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">previous_output</span>.<span class="ident">txid</span>, <span class="bool-val">true</span>)<span class="question-mark">?</span> {
+ <span class="prelude-val">Some</span>(<span class="ident">saved_tx</span>) <span class="op">=</span><span class="op">></span> <span class="ident">saved_tx</span>.<span class="ident">transaction</span>.<span class="ident">unwrap</span>(),
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">fetched_tx</span> <span class="op">=</span>
+ <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">els_transaction_get</span>(<span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">previous_output</span>.<span class="ident">txid</span>))<span class="question-mark">?</span>;
+ <span class="ident">database</span>.<span class="ident">set_raw_tx</span>(<span class="kw-2">&</span><span class="ident">fetched_tx</span>)<span class="question-mark">?</span>;
+
+ <span class="ident">fetched_tx</span>
+ }
+ };
+
+ <span class="ident">inputs_sum</span> <span class="op">+</span><span class="op">=</span> <span class="ident">tx</span>.<span class="ident">output</span>[<span class="ident">input</span>.<span class="ident">previous_output</span>.<span class="ident">vout</span> <span class="kw">as</span> <span class="ident">usize</span>].<span class="ident">value</span>;
+ }
+ }
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">to_check_later</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
+ <span class="kw">for</span> (<span class="ident">i</span>, <span class="ident">output</span>) <span class="kw">in</span> <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
+ <span class="comment">// to compute the fees later</span>
+ <span class="ident">outputs_sum</span> <span class="op">+</span><span class="op">=</span> <span class="ident">output</span>.<span class="ident">value</span>;
+
+ <span class="comment">// this output is ours, we have a path to derive it</span>
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">script_type</span>, <span class="ident">child</span>)) <span class="op">=</span>
+ <span class="ident">database</span>.<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">output</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span>
+ {
+ <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"{} output #{} is mine, adding utxo"</span>, <span class="ident">txid</span>, <span class="ident">i</span>);
+ <span class="ident">updates</span>.<span class="ident">set_utxo</span>(<span class="kw-2">&</span><span class="ident">UTXO</span> {
+ <span class="ident">outpoint</span>: <span class="ident">OutPoint</span>::<span class="ident">new</span>(<span class="ident">tx</span>.<span class="ident">txid</span>(), <span class="ident">i</span> <span class="kw">as</span> <span class="ident">u32</span>),
+ <span class="ident">txout</span>: <span class="ident">output</span>.<span class="ident">clone</span>(),
+ <span class="ident">is_internal</span>: <span class="ident">script_type</span>.<span class="ident">is_internal</span>(),
+ })<span class="question-mark">?</span>;
+ <span class="ident">incoming</span> <span class="op">+</span><span class="op">=</span> <span class="ident">output</span>.<span class="ident">value</span>;
+
+ <span class="kw">if</span> <span class="ident">output</span>.<span class="ident">script_pubkey</span> <span class="op">!</span><span class="op">=</span> <span class="kw-2">*</span><span class="ident">cur_script</span> {
+ <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"{} output #{} script {} was not current script, adding script to be checked later"</span>, <span class="ident">txid</span>, <span class="ident">i</span>, <span class="ident">output</span>.<span class="ident">script_pubkey</span>);
+ <span class="ident">to_check_later</span>.<span class="ident">push</span>(<span class="ident">output</span>.<span class="ident">script_pubkey</span>.<span class="ident">clone</span>())
+ }
+
+ <span class="comment">// derive as many change addrs as external addresses that we've seen</span>
+ <span class="kw">if</span> <span class="ident">script_type</span> <span class="op">=</span><span class="op">=</span> <span class="ident">ScriptType</span>::<span class="ident">Internal</span>
+ <span class="kw-2">&</span><span class="op">&</span> (<span class="ident">change_max_deriv</span>.<span class="ident">is_none</span>() <span class="op">|</span><span class="op">|</span> <span class="ident">child</span> <span class="op">></span> <span class="ident">change_max_deriv</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>))
+ {
+ <span class="kw-2">*</span><span class="ident">change_max_deriv</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">child</span>);
+ }
+ }
+ }
+
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">TransactionDetails</span> {
+ <span class="ident">txid</span>: <span class="ident">tx</span>.<span class="ident">txid</span>(),
+ <span class="ident">transaction</span>: <span class="prelude-val">Some</span>(<span class="ident">tx</span>),
+ <span class="ident">received</span>: <span class="ident">incoming</span>,
+ <span class="ident">sent</span>: <span class="ident">outgoing</span>,
+ <span class="ident">height</span>,
+ <span class="ident">timestamp</span>: <span class="number">0</span>,
+ <span class="ident">fees</span>: <span class="ident">inputs_sum</span> <span class="op">-</span> <span class="ident">outputs_sum</span>,
+ };
+ <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Saving tx {}"</span>, <span class="ident">txid</span>);
+ <span class="ident">updates</span>.<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">tx</span>)<span class="question-mark">?</span>;
+
+ <span class="ident">database</span>.<span class="ident">commit_batch</span>(<span class="ident">updates</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">to_check_later</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">check_history</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
+ <span class="ident">script_pubkey</span>: <span class="ident">Script</span>,
+ <span class="ident">txs</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSGetHistoryRes</span><span class="op">></span>,
+ <span class="ident">change_max_deriv</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">to_check_later</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
+
+ <span class="macro">debug</span><span class="macro">!</span>(
+ <span class="string">"history of {} script {} has {} tx"</span>,
+ <span class="ident">Address</span>::<span class="ident">from_script</span>(<span class="kw-2">&</span><span class="ident">script_pubkey</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>).<span class="ident">unwrap</span>(),
+ <span class="ident">script_pubkey</span>,
+ <span class="ident">txs</span>.<span class="ident">len</span>()
+ );
+
+ <span class="kw">for</span> <span class="ident">tx</span> <span class="kw">in</span> <span class="ident">txs</span> {
+ <span class="kw">let</span> <span class="ident">height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">tx</span>.<span class="ident">height</span> {
+ <span class="number">0</span> <span class="op">|</span> <span class="op">-</span><span class="number">1</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
+ <span class="ident">x</span> <span class="op">=</span><span class="op">></span> <span class="ident">u32</span>::<span class="ident">try_from</span>(<span class="ident">x</span>).<span class="ident">ok</span>(),
+ };
+
+ <span class="ident">to_check_later</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">check_tx_and_descendant</span>(
+ <span class="ident">database</span>,
+ <span class="kw-2">&</span><span class="ident">tx</span>.<span class="ident">tx_hash</span>,
+ <span class="ident">height</span>,
+ <span class="kw-2">&</span><span class="ident">script_pubkey</span>,
+ <span class="ident">change_max_deriv</span>,
+ ))<span class="question-mark">?</span>);
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">to_check_later</span>)
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/database/keyvalue.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>keyvalue.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+<span id="163">163</span>
+<span id="164">164</span>
+<span id="165">165</span>
+<span id="166">166</span>
+<span id="167">167</span>
+<span id="168">168</span>
+<span id="169">169</span>
+<span id="170">170</span>
+<span id="171">171</span>
+<span id="172">172</span>
+<span id="173">173</span>
+<span id="174">174</span>
+<span id="175">175</span>
+<span id="176">176</span>
+<span id="177">177</span>
+<span id="178">178</span>
+<span id="179">179</span>
+<span id="180">180</span>
+<span id="181">181</span>
+<span id="182">182</span>
+<span id="183">183</span>
+<span id="184">184</span>
+<span id="185">185</span>
+<span id="186">186</span>
+<span id="187">187</span>
+<span id="188">188</span>
+<span id="189">189</span>
+<span id="190">190</span>
+<span id="191">191</span>
+<span id="192">192</span>
+<span id="193">193</span>
+<span id="194">194</span>
+<span id="195">195</span>
+<span id="196">196</span>
+<span id="197">197</span>
+<span id="198">198</span>
+<span id="199">199</span>
+<span id="200">200</span>
+<span id="201">201</span>
+<span id="202">202</span>
+<span id="203">203</span>
+<span id="204">204</span>
+<span id="205">205</span>
+<span id="206">206</span>
+<span id="207">207</span>
+<span id="208">208</span>
+<span id="209">209</span>
+<span id="210">210</span>
+<span id="211">211</span>
+<span id="212">212</span>
+<span id="213">213</span>
+<span id="214">214</span>
+<span id="215">215</span>
+<span id="216">216</span>
+<span id="217">217</span>
+<span id="218">218</span>
+<span id="219">219</span>
+<span id="220">220</span>
+<span id="221">221</span>
+<span id="222">222</span>
+<span id="223">223</span>
+<span id="224">224</span>
+<span id="225">225</span>
+<span id="226">226</span>
+<span id="227">227</span>
+<span id="228">228</span>
+<span id="229">229</span>
+<span id="230">230</span>
+<span id="231">231</span>
+<span id="232">232</span>
+<span id="233">233</span>
+<span id="234">234</span>
+<span id="235">235</span>
+<span id="236">236</span>
+<span id="237">237</span>
+<span id="238">238</span>
+<span id="239">239</span>
+<span id="240">240</span>
+<span id="241">241</span>
+<span id="242">242</span>
+<span id="243">243</span>
+<span id="244">244</span>
+<span id="245">245</span>
+<span id="246">246</span>
+<span id="247">247</span>
+<span id="248">248</span>
+<span id="249">249</span>
+<span id="250">250</span>
+<span id="251">251</span>
+<span id="252">252</span>
+<span id="253">253</span>
+<span id="254">254</span>
+<span id="255">255</span>
+<span id="256">256</span>
+<span id="257">257</span>
+<span id="258">258</span>
+<span id="259">259</span>
+<span id="260">260</span>
+<span id="261">261</span>
+<span id="262">262</span>
+<span id="263">263</span>
+<span id="264">264</span>
+<span id="265">265</span>
+<span id="266">266</span>
+<span id="267">267</span>
+<span id="268">268</span>
+<span id="269">269</span>
+<span id="270">270</span>
+<span id="271">271</span>
+<span id="272">272</span>
+<span id="273">273</span>
+<span id="274">274</span>
+<span id="275">275</span>
+<span id="276">276</span>
+<span id="277">277</span>
+<span id="278">278</span>
+<span id="279">279</span>
+<span id="280">280</span>
+<span id="281">281</span>
+<span id="282">282</span>
+<span id="283">283</span>
+<span id="284">284</span>
+<span id="285">285</span>
+<span id="286">286</span>
+<span id="287">287</span>
+<span id="288">288</span>
+<span id="289">289</span>
+<span id="290">290</span>
+<span id="291">291</span>
+<span id="292">292</span>
+<span id="293">293</span>
+<span id="294">294</span>
+<span id="295">295</span>
+<span id="296">296</span>
+<span id="297">297</span>
+<span id="298">298</span>
+<span id="299">299</span>
+<span id="300">300</span>
+<span id="301">301</span>
+<span id="302">302</span>
+<span id="303">303</span>
+<span id="304">304</span>
+<span id="305">305</span>
+<span id="306">306</span>
+<span id="307">307</span>
+<span id="308">308</span>
+<span id="309">309</span>
+<span id="310">310</span>
+<span id="311">311</span>
+<span id="312">312</span>
+<span id="313">313</span>
+<span id="314">314</span>
+<span id="315">315</span>
+<span id="316">316</span>
+<span id="317">317</span>
+<span id="318">318</span>
+<span id="319">319</span>
+<span id="320">320</span>
+<span id="321">321</span>
+<span id="322">322</span>
+<span id="323">323</span>
+<span id="324">324</span>
+<span id="325">325</span>
+<span id="326">326</span>
+<span id="327">327</span>
+<span id="328">328</span>
+<span id="329">329</span>
+<span id="330">330</span>
+<span id="331">331</span>
+<span id="332">332</span>
+<span id="333">333</span>
+<span id="334">334</span>
+<span id="335">335</span>
+<span id="336">336</span>
+<span id="337">337</span>
+<span id="338">338</span>
+<span id="339">339</span>
+<span id="340">340</span>
+<span id="341">341</span>
+<span id="342">342</span>
+<span id="343">343</span>
+<span id="344">344</span>
+<span id="345">345</span>
+<span id="346">346</span>
+<span id="347">347</span>
+<span id="348">348</span>
+<span id="349">349</span>
+<span id="350">350</span>
+<span id="351">351</span>
+<span id="352">352</span>
+<span id="353">353</span>
+<span id="354">354</span>
+<span id="355">355</span>
+<span id="356">356</span>
+<span id="357">357</span>
+<span id="358">358</span>
+<span id="359">359</span>
+<span id="360">360</span>
+<span id="361">361</span>
+<span id="362">362</span>
+<span id="363">363</span>
+<span id="364">364</span>
+<span id="365">365</span>
+<span id="366">366</span>
+<span id="367">367</span>
+<span id="368">368</span>
+<span id="369">369</span>
+<span id="370">370</span>
+<span id="371">371</span>
+<span id="372">372</span>
+<span id="373">373</span>
+<span id="374">374</span>
+<span id="375">375</span>
+<span id="376">376</span>
+<span id="377">377</span>
+<span id="378">378</span>
+<span id="379">379</span>
+<span id="380">380</span>
+<span id="381">381</span>
+<span id="382">382</span>
+<span id="383">383</span>
+<span id="384">384</span>
+<span id="385">385</span>
+<span id="386">386</span>
+<span id="387">387</span>
+<span id="388">388</span>
+<span id="389">389</span>
+<span id="390">390</span>
+<span id="391">391</span>
+<span id="392">392</span>
+<span id="393">393</span>
+<span id="394">394</span>
+<span id="395">395</span>
+<span id="396">396</span>
+<span id="397">397</span>
+<span id="398">398</span>
+<span id="399">399</span>
+<span id="400">400</span>
+<span id="401">401</span>
+<span id="402">402</span>
+<span id="403">403</span>
+<span id="404">404</span>
+<span id="405">405</span>
+<span id="406">406</span>
+<span id="407">407</span>
+<span id="408">408</span>
+<span id="409">409</span>
+<span id="410">410</span>
+<span id="411">411</span>
+<span id="412">412</span>
+<span id="413">413</span>
+<span id="414">414</span>
+<span id="415">415</span>
+<span id="416">416</span>
+<span id="417">417</span>
+<span id="418">418</span>
+<span id="419">419</span>
+<span id="420">420</span>
+<span id="421">421</span>
+<span id="422">422</span>
+<span id="423">423</span>
+<span id="424">424</span>
+<span id="425">425</span>
+<span id="426">426</span>
+<span id="427">427</span>
+<span id="428">428</span>
+<span id="429">429</span>
+<span id="430">430</span>
+<span id="431">431</span>
+<span id="432">432</span>
+<span id="433">433</span>
+<span id="434">434</span>
+<span id="435">435</span>
+<span id="436">436</span>
+<span id="437">437</span>
+<span id="438">438</span>
+<span id="439">439</span>
+<span id="440">440</span>
+<span id="441">441</span>
+<span id="442">442</span>
+<span id="443">443</span>
+<span id="444">444</span>
+<span id="445">445</span>
+<span id="446">446</span>
+<span id="447">447</span>
+<span id="448">448</span>
+<span id="449">449</span>
+<span id="450">450</span>
+<span id="451">451</span>
+<span id="452">452</span>
+<span id="453">453</span>
+<span id="454">454</span>
+<span id="455">455</span>
+<span id="456">456</span>
+<span id="457">457</span>
+<span id="458">458</span>
+<span id="459">459</span>
+<span id="460">460</span>
+<span id="461">461</span>
+<span id="462">462</span>
+<span id="463">463</span>
+<span id="464">464</span>
+<span id="465">465</span>
+<span id="466">466</span>
+<span id="467">467</span>
+<span id="468">468</span>
+<span id="469">469</span>
+<span id="470">470</span>
+<span id="471">471</span>
+<span id="472">472</span>
+<span id="473">473</span>
+<span id="474">474</span>
+<span id="475">475</span>
+<span id="476">476</span>
+<span id="477">477</span>
+<span id="478">478</span>
+<span id="479">479</span>
+<span id="480">480</span>
+<span id="481">481</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">convert</span>::<span class="ident">TryInto</span>;
+
+<span class="kw">use</span> <span class="ident">sled</span>::{<span class="ident">Batch</span>, <span class="ident">Tree</span>};
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::{<span class="ident">deserialize</span>, <span class="ident">serialize</span>};
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hash_types</span>::<span class="ident">Txid</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">OutPoint</span>, <span class="ident">Script</span>, <span class="ident">Transaction</span>};
+
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">memory</span>::<span class="ident">MapKey</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::{<span class="ident">BatchDatabase</span>, <span class="ident">BatchOperations</span>, <span class="ident">Database</span>};
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="kw-2">*</span>;
+
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_batch_operations</span> {
+ ( { $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">after_insert</span>:<span class="ident">tt</span>)<span class="op">*</span> }, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">process_delete</span>:<span class="ident">ident</span> ) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">set_script_pubkey</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>, <span class="ident">path</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="prelude-val">Some</span>(<span class="ident">script_type</span>), <span class="prelude-val">Some</span>(<span class="ident">path</span>))).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">serialize</span>(<span class="ident">script</span>))$(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">after_insert</span>)<span class="kw-2">*</span>;
+
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Script</span>(<span class="prelude-val">Some</span>(<span class="ident">script</span>)).<span class="ident">as_map_key</span>();
+ <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="macro">json</span><span class="macro">!</span>({
+ <span class="string">"t"</span>: <span class="ident">script_type</span>,
+ <span class="string">"p"</span>: <span class="ident">path</span>,
+ });
+ <span class="self">self</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">serde_json</span>::<span class="ident">to_vec</span>(<span class="kw-2">&</span><span class="ident">value</span>)<span class="question-mark">?</span>)$(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">after_insert</span>)<span class="kw-2">*</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">fn</span> <span class="ident">set_utxo</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">utxo</span>: <span class="kw-2">&</span><span class="ident">UTXO</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="ident">utxo</span>.<span class="ident">outpoint</span>)).<span class="ident">as_map_key</span>();
+ <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="macro">json</span><span class="macro">!</span>({
+ <span class="string">"t"</span>: <span class="ident">utxo</span>.<span class="ident">txout</span>,
+ <span class="string">"i"</span>: <span class="ident">utxo</span>.<span class="ident">is_internal</span>,
+ });
+ <span class="self">self</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">serde_json</span>::<span class="ident">to_vec</span>(<span class="kw-2">&</span><span class="ident">value</span>)<span class="question-mark">?</span>)$(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">after_insert</span>)<span class="kw-2">*</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">fn</span> <span class="ident">set_raw_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">transaction</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="ident">transaction</span>.<span class="ident">txid</span>())).<span class="ident">as_map_key</span>();
+ <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="ident">serialize</span>(<span class="ident">transaction</span>);
+ <span class="self">self</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">value</span>)$(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">after_insert</span>)<span class="kw-2">*</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">fn</span> <span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">transaction</span>: <span class="kw-2">&</span><span class="ident">TransactionDetails</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="ident">transaction</span>.<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
+
+ <span class="comment">// remove the raw tx from the serialized version</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">value</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">to_value</span>(<span class="ident">transaction</span>)<span class="question-mark">?</span>;
+ <span class="ident">value</span>[<span class="string">"transaction"</span>] <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">Value</span>::<span class="ident">Null</span>;
+ <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">to_vec</span>(<span class="kw-2">&</span><span class="ident">value</span>)<span class="question-mark">?</span>;
+
+ <span class="self">self</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">value</span>)$(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">after_insert</span>)<span class="kw-2">*</span>;
+
+ <span class="comment">// insert the raw_tx if present</span>
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">tx</span>) <span class="op">=</span> <span class="ident">transaction</span>.<span class="ident">transaction</span> {
+ <span class="self">self</span>.<span class="ident">set_raw_tx</span>(<span class="ident">tx</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">fn</span> <span class="ident">set_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>, <span class="ident">value</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="kw-2">&</span><span class="ident">value</span>.<span class="ident">to_be_bytes</span>())$(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">after_insert</span>)<span class="kw-2">*</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">fn</span> <span class="ident">del_script_pubkey_from_path</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>, <span class="ident">path</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="prelude-val">Some</span>(<span class="ident">script_type</span>), <span class="prelude-val">Some</span>(<span class="ident">path</span>))).<span class="ident">as_map_key</span>();
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">remove</span>(<span class="ident">key</span>);
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">process_delete</span><span class="op">!</span>(<span class="ident">res</span>);
+
+ <span class="prelude-val">Ok</span>(<span class="ident">res</span>.<span class="ident">map_or</span>(<span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>), <span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="prelude-val">Some</span>(<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">x</span>)).<span class="ident">transpose</span>())<span class="question-mark">?</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">del_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span>(<span class="ident">ScriptType</span>, <span class="ident">u32</span>)<span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Script</span>(<span class="prelude-val">Some</span>(<span class="ident">script</span>)).<span class="ident">as_map_key</span>();
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">remove</span>(<span class="ident">key</span>);
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">process_delete</span><span class="op">!</span>(<span class="ident">res</span>);
+
+ <span class="kw">match</span> <span class="ident">res</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">serde_json</span>::<span class="ident">Value</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">b</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">st</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"t"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"p"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>((<span class="ident">st</span>, <span class="ident">path</span>)))
+ }
+ }
+ }
+
+ <span class="kw">fn</span> <span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">outpoint</span>: <span class="kw-2">&</span><span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">Some</span>(<span class="ident">outpoint</span>)).<span class="ident">as_map_key</span>();
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">remove</span>(<span class="ident">key</span>);
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">process_delete</span><span class="op">!</span>(<span class="ident">res</span>);
+
+ <span class="kw">match</span> <span class="ident">res</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">serde_json</span>::<span class="ident">Value</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">b</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">txout</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"t"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">is_internal</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"i"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">UTXO</span> { <span class="ident">outpoint</span>: <span class="ident">outpoint</span>.<span class="ident">clone</span>(), <span class="ident">txout</span>, <span class="ident">is_internal</span> }))
+ }
+ }
+ }
+
+ <span class="kw">fn</span> <span class="ident">del_raw_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">Some</span>(<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">remove</span>(<span class="ident">key</span>);
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">process_delete</span><span class="op">!</span>(<span class="ident">res</span>);
+
+ <span class="prelude-val">Ok</span>(<span class="ident">res</span>.<span class="ident">map_or</span>(<span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>), <span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="prelude-val">Some</span>(<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">x</span>)).<span class="ident">transpose</span>())<span class="question-mark">?</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">del_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>, <span class="ident">include_raw</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">raw_tx</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">include_raw</span> {
+ <span class="self">self</span>.<span class="ident">del_raw_tx</span>(<span class="ident">txid</span>)<span class="question-mark">?</span>
+ } <span class="kw">else</span> {
+ <span class="prelude-val">None</span>
+ };
+
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">Some</span>(<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">remove</span>(<span class="ident">key</span>);
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">process_delete</span><span class="op">!</span>(<span class="ident">res</span>);
+
+ <span class="kw">match</span> <span class="ident">res</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">TransactionDetails</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">b</span>)<span class="question-mark">?</span>;
+ <span class="ident">val</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="ident">raw_tx</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">val</span>))
+ }
+ }
+ }
+
+ <span class="kw">fn</span> <span class="ident">del_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">remove</span>(<span class="ident">key</span>);
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">process_delete</span><span class="op">!</span>(<span class="ident">res</span>);
+
+ <span class="kw">match</span> <span class="ident">res</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">array</span>: [<span class="ident">u8</span>; <span class="number">4</span>] <span class="op">=</span> <span class="ident">b</span>.<span class="ident">as_ref</span>().<span class="ident">try_into</span>().<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">Error</span>::<span class="ident">InvalidU32Bytes</span>(<span class="ident">b</span>.<span class="ident">to_vec</span>()))<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">val</span> <span class="op">=</span> <span class="ident">u32</span>::<span class="ident">from_be_bytes</span>(<span class="ident">array</span>);
+ <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">val</span>))
+ }
+ }
+ }
+ }
+}
+
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">process_delete_tree</span> {
+ (<span class="macro-nonterminal">$</span><span class="macro-nonterminal">res</span>:<span class="ident">expr</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="macro-nonterminal">$</span><span class="macro-nonterminal">res</span><span class="question-mark">?</span>
+ };
+}
+<span class="kw">impl</span> <span class="ident">BatchOperations</span> <span class="kw">for</span> <span class="ident">Tree</span> {
+ <span class="macro">impl_batch_operations</span><span class="macro">!</span>({<span class="question-mark">?</span>}, <span class="ident">process_delete_tree</span>);
+}
+
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">process_delete_batch</span> {
+ (<span class="macro-nonterminal">$</span><span class="macro-nonterminal">res</span>:<span class="ident">expr</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="prelude-val">None</span> <span class="kw">as</span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">sled</span>::<span class="ident">IVec</span><span class="op">></span>
+ };
+}
+<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_variables</span>)]</span>
+<span class="kw">impl</span> <span class="ident">BatchOperations</span> <span class="kw">for</span> <span class="ident">Batch</span> {
+ <span class="macro">impl_batch_operations</span><span class="macro">!</span>({}, <span class="ident">process_delete_batch</span>);
+}
+
+<span class="kw">impl</span> <span class="ident">Database</span> <span class="kw">for</span> <span class="ident">Tree</span> {
+ <span class="kw">fn</span> <span class="ident">check_descriptor_checksum</span><span class="op"><</span><span class="ident">B</span>: <span class="ident">AsRef</span><span class="op"><</span>[<span class="ident">u8</span>]<span class="op">></span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
+ <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
+ <span class="ident">bytes</span>: <span class="ident">B</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">DescriptorChecksum</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
+
+ <span class="kw">let</span> <span class="ident">prev</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key</span>)<span class="question-mark">?</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span>.<span class="ident">to_vec</span>());
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">val</span>) <span class="op">=</span> <span class="ident">prev</span> {
+ <span class="kw">if</span> <span class="ident">val</span> <span class="op">=</span><span class="op">=</span> <span class="ident">bytes</span>.<span class="ident">as_ref</span>() {
+ <span class="prelude-val">Ok</span>(())
+ } <span class="kw">else</span> {
+ <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">ChecksumMismatch</span>)
+ }
+ } <span class="kw">else</span> {
+ <span class="self">self</span>.<span class="ident">insert</span>(<span class="kw-2">&</span><span class="ident">key</span>, <span class="ident">bytes</span>.<span class="ident">as_ref</span>())<span class="question-mark">?</span>;
+ <span class="prelude-val">Ok</span>(())
+ }
+ }
+
+ <span class="kw">fn</span> <span class="ident">iter_script_pubkeys</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script_type</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">ScriptType</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="ident">script_type</span>, <span class="prelude-val">None</span>)).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">scan_prefix</span>(<span class="ident">key</span>)
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> (<span class="kw">_</span>, <span class="ident">v</span>) <span class="op">=</span> <span class="ident">x</span><span class="question-mark">?</span>;
+ <span class="prelude-val">Ok</span>(<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">v</span>)<span class="question-mark">?</span>)
+ })
+ .<span class="ident">collect</span>()
+ }
+
+ <span class="kw">fn</span> <span class="ident">iter_utxos</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">None</span>).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">scan_prefix</span>(<span class="ident">key</span>)
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> (<span class="ident">k</span>, <span class="ident">v</span>) <span class="op">=</span> <span class="ident">x</span><span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">outpoint</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">k</span>[<span class="number">1</span>..])<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">serde_json</span>::<span class="ident">Value</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">v</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">txout</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"t"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">is_internal</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"i"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">UTXO</span> {
+ <span class="ident">outpoint</span>,
+ <span class="ident">txout</span>,
+ <span class="ident">is_internal</span>,
+ })
+ })
+ .<span class="ident">collect</span>()
+ }
+
+ <span class="kw">fn</span> <span class="ident">iter_raw_txs</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">None</span>).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">scan_prefix</span>(<span class="ident">key</span>)
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> (<span class="kw">_</span>, <span class="ident">v</span>) <span class="op">=</span> <span class="ident">x</span><span class="question-mark">?</span>;
+ <span class="prelude-val">Ok</span>(<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">v</span>)<span class="question-mark">?</span>)
+ })
+ .<span class="ident">collect</span>()
+ }
+
+ <span class="kw">fn</span> <span class="ident">iter_txs</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">include_raw</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">None</span>).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">scan_prefix</span>(<span class="ident">key</span>)
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> (<span class="ident">k</span>, <span class="ident">v</span>) <span class="op">=</span> <span class="ident">x</span><span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">txdetails</span>: <span class="ident">TransactionDetails</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">v</span>)<span class="question-mark">?</span>;
+ <span class="kw">if</span> <span class="ident">include_raw</span> {
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">k</span>[<span class="number">1</span>..])<span class="question-mark">?</span>;
+ <span class="ident">txdetails</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="ident">txid</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">txdetails</span>)
+ })
+ .<span class="ident">collect</span>()
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_script_pubkey_from_path</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
+ <span class="ident">path</span>: <span class="ident">u32</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="prelude-val">Some</span>(<span class="ident">script_type</span>), <span class="prelude-val">Some</span>(<span class="ident">path</span>))).<span class="ident">as_map_key</span>();
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">get</span>(<span class="ident">key</span>)<span class="question-mark">?</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">b</span>)).<span class="ident">transpose</span>()<span class="question-mark">?</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_path_from_script_pubkey</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span>(<span class="ident">ScriptType</span>, <span class="ident">u32</span>)<span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Script</span>(<span class="prelude-val">Some</span>(<span class="ident">script</span>)).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">get</span>(<span class="ident">key</span>)<span class="question-mark">?</span>
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">serde_json</span>::<span class="ident">Value</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">b</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">st</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"t"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"p"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>((<span class="ident">st</span>, <span class="ident">path</span>))
+ })
+ .<span class="ident">transpose</span>()
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_utxo</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">outpoint</span>: <span class="kw-2">&</span><span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">Some</span>(<span class="ident">outpoint</span>)).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">get</span>(<span class="ident">key</span>)<span class="question-mark">?</span>
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">serde_json</span>::<span class="ident">Value</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">b</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">txout</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"t"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">is_internal</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"i"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">UTXO</span> {
+ <span class="ident">outpoint</span>: <span class="ident">outpoint</span>.<span class="ident">clone</span>(),
+ <span class="ident">txout</span>,
+ <span class="ident">is_internal</span>,
+ })
+ })
+ .<span class="ident">transpose</span>()
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">Some</span>(<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">get</span>(<span class="ident">key</span>)<span class="question-mark">?</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">b</span>)).<span class="ident">transpose</span>()<span class="question-mark">?</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>, <span class="ident">include_raw</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">Some</span>(<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">get</span>(<span class="ident">key</span>)<span class="question-mark">?</span>
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">txdetails</span>: <span class="ident">TransactionDetails</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">b</span>)<span class="question-mark">?</span>;
+ <span class="kw">if</span> <span class="ident">include_raw</span> {
+ <span class="ident">txdetails</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="ident">txid</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">txdetails</span>)
+ })
+ .<span class="ident">transpose</span>()
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_last_index</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">get</span>(<span class="ident">key</span>)<span class="question-mark">?</span>
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">array</span>: [<span class="ident">u8</span>; <span class="number">4</span>] <span class="op">=</span> <span class="ident">b</span>
+ .<span class="ident">as_ref</span>()
+ .<span class="ident">try_into</span>()
+ .<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">Error</span>::<span class="ident">InvalidU32Bytes</span>(<span class="ident">b</span>.<span class="ident">to_vec</span>()))<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">val</span> <span class="op">=</span> <span class="ident">u32</span>::<span class="ident">from_be_bytes</span>(<span class="ident">array</span>);
+ <span class="prelude-val">Ok</span>(<span class="ident">val</span>)
+ })
+ .<span class="ident">transpose</span>()
+ }
+
+ <span class="comment">// inserts 0 if not present</span>
+ <span class="kw">fn</span> <span class="ident">increment_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">update_and_fetch</span>(<span class="ident">key</span>, <span class="op">|</span><span class="ident">prev</span><span class="op">|</span> {
+ <span class="kw">let</span> <span class="ident">new</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">prev</span> {
+ <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">array</span>: [<span class="ident">u8</span>; <span class="number">4</span>] <span class="op">=</span> <span class="ident">b</span>.<span class="ident">try_into</span>().<span class="ident">unwrap_or</span>([<span class="number">0</span>; <span class="number">4</span>]);
+ <span class="kw">let</span> <span class="ident">val</span> <span class="op">=</span> <span class="ident">u32</span>::<span class="ident">from_be_bytes</span>(<span class="ident">array</span>);
+
+ <span class="ident">val</span> <span class="op">+</span> <span class="number">1</span>
+ }
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="number">0</span>,
+ };
+
+ <span class="prelude-val">Some</span>(<span class="ident">new</span>.<span class="ident">to_be_bytes</span>().<span class="ident">to_vec</span>())
+ })<span class="question-mark">?</span>
+ .<span class="ident">map_or</span>(<span class="prelude-val">Ok</span>(<span class="number">0</span>), <span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">array</span>: [<span class="ident">u8</span>; <span class="number">4</span>] <span class="op">=</span> <span class="ident">b</span>
+ .<span class="ident">as_ref</span>()
+ .<span class="ident">try_into</span>()
+ .<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">Error</span>::<span class="ident">InvalidU32Bytes</span>(<span class="ident">b</span>.<span class="ident">to_vec</span>()))<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">val</span> <span class="op">=</span> <span class="ident">u32</span>::<span class="ident">from_be_bytes</span>(<span class="ident">array</span>);
+ <span class="prelude-val">Ok</span>(<span class="ident">val</span>)
+ })
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">BatchDatabase</span> <span class="kw">for</span> <span class="ident">Tree</span> {
+ <span class="kw">type</span> <span class="ident">Batch</span> <span class="op">=</span> <span class="ident">sled</span>::<span class="ident">Batch</span>;
+
+ <span class="kw">fn</span> <span class="ident">begin_batch</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span>::<span class="ident">Batch</span> {
+ <span class="ident">sled</span>::<span class="ident">Batch</span>::<span class="ident">default</span>()
+ }
+
+ <span class="kw">fn</span> <span class="ident">commit_batch</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">batch</span>: <span class="self">Self</span>::<span class="ident">Batch</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">apply_batch</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>)
+ }
+}
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="kw">mod</span> <span class="ident">test</span> {
+ <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::{<span class="ident">Arc</span>, <span class="ident">Condvar</span>, <span class="ident">Mutex</span>, <span class="ident">Once</span>};
+ <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::{<span class="ident">SystemTime</span>, <span class="ident">UNIX_EPOCH</span>};
+
+ <span class="kw">use</span> <span class="ident">sled</span>::{<span class="ident">Db</span>, <span class="ident">Tree</span>};
+
+ <span class="kw">static</span> <span class="kw-2">mut</span> <span class="ident">COUNT</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">0</span>;
+
+ <span class="macro">lazy_static</span><span class="macro">!</span> {
+ <span class="kw">static</span> <span class="kw-2">ref</span> <span class="ident">DB</span>: <span class="ident">Arc</span><span class="op"><</span>(<span class="ident">Mutex</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Db</span><span class="op">></span><span class="op">></span>, <span class="ident">Condvar</span>)<span class="op">></span> <span class="op">=</span>
+ <span class="ident">Arc</span>::<span class="ident">new</span>((<span class="ident">Mutex</span>::<span class="ident">new</span>(<span class="prelude-val">None</span>), <span class="ident">Condvar</span>::<span class="ident">new</span>()));
+ <span class="kw">static</span> <span class="kw-2">ref</span> <span class="ident">INIT</span>: <span class="ident">Once</span> <span class="op">=</span> <span class="ident">Once</span>::<span class="ident">new</span>();
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_tree</span>() <span class="op">-</span><span class="op">></span> <span class="ident">Tree</span> {
+ <span class="kw">unsafe</span> {
+ <span class="kw">let</span> <span class="ident">cloned</span> <span class="op">=</span> <span class="ident">DB</span>.<span class="ident">clone</span>();
+ <span class="kw">let</span> (<span class="ident">mutex</span>, <span class="ident">cvar</span>) <span class="op">=</span> <span class="kw-2">&</span><span class="kw-2">*</span><span class="ident">cloned</span>;
+
+ <span class="ident">INIT</span>.<span class="ident">call_once</span>(<span class="op">|</span><span class="op">|</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">db</span> <span class="op">=</span> <span class="ident">mutex</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">time</span> <span class="op">=</span> <span class="ident">SystemTime</span>::<span class="ident">now</span>().<span class="ident">duration_since</span>(<span class="ident">UNIX_EPOCH</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">dir</span> <span class="op">=</span> <span class="ident">std</span>::<span class="ident">env</span>::<span class="ident">temp_dir</span>();
+ <span class="ident">dir</span>.<span class="ident">push</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"mbw_{}"</span>, <span class="ident">time</span>.<span class="ident">as_nanos</span>()));
+
+ <span class="kw-2">*</span><span class="ident">db</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">sled</span>::<span class="ident">open</span>(<span class="ident">dir</span>).<span class="ident">unwrap</span>());
+ <span class="ident">cvar</span>.<span class="ident">notify_all</span>();
+ });
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">db</span> <span class="op">=</span> <span class="ident">mutex</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
+ <span class="kw">while</span> <span class="op">!</span><span class="ident">db</span>.<span class="ident">is_some</span>() {
+ <span class="ident">db</span> <span class="op">=</span> <span class="ident">cvar</span>.<span class="ident">wait</span>(<span class="ident">db</span>).<span class="ident">unwrap</span>();
+ }
+
+ <span class="ident">COUNT</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
+
+ <span class="ident">db</span>.<span class="ident">as_ref</span>()
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">open_tree</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"tree_{}"</span>, <span class="ident">COUNT</span>))
+ .<span class="ident">unwrap</span>()
+ }
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_script_pubkey</span>() {
+ <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_script_pubkey</span>(<span class="ident">get_tree</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_batch_script_pubkey</span>() {
+ <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_batch_script_pubkey</span>(<span class="ident">get_tree</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_iter_script_pubkey</span>() {
+ <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_iter_script_pubkey</span>(<span class="ident">get_tree</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_del_script_pubkey</span>() {
+ <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_del_script_pubkey</span>(<span class="ident">get_tree</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_utxo</span>() {
+ <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_utxo</span>(<span class="ident">get_tree</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_raw_tx</span>() {
+ <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_raw_tx</span>(<span class="ident">get_tree</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_tx</span>() {
+ <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_tx</span>(<span class="ident">get_tree</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_last_index</span>() {
+ <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_last_index</span>(<span class="ident">get_tree</span>());
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/database/memory.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>memory.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+<span id="163">163</span>
+<span id="164">164</span>
+<span id="165">165</span>
+<span id="166">166</span>
+<span id="167">167</span>
+<span id="168">168</span>
+<span id="169">169</span>
+<span id="170">170</span>
+<span id="171">171</span>
+<span id="172">172</span>
+<span id="173">173</span>
+<span id="174">174</span>
+<span id="175">175</span>
+<span id="176">176</span>
+<span id="177">177</span>
+<span id="178">178</span>
+<span id="179">179</span>
+<span id="180">180</span>
+<span id="181">181</span>
+<span id="182">182</span>
+<span id="183">183</span>
+<span id="184">184</span>
+<span id="185">185</span>
+<span id="186">186</span>
+<span id="187">187</span>
+<span id="188">188</span>
+<span id="189">189</span>
+<span id="190">190</span>
+<span id="191">191</span>
+<span id="192">192</span>
+<span id="193">193</span>
+<span id="194">194</span>
+<span id="195">195</span>
+<span id="196">196</span>
+<span id="197">197</span>
+<span id="198">198</span>
+<span id="199">199</span>
+<span id="200">200</span>
+<span id="201">201</span>
+<span id="202">202</span>
+<span id="203">203</span>
+<span id="204">204</span>
+<span id="205">205</span>
+<span id="206">206</span>
+<span id="207">207</span>
+<span id="208">208</span>
+<span id="209">209</span>
+<span id="210">210</span>
+<span id="211">211</span>
+<span id="212">212</span>
+<span id="213">213</span>
+<span id="214">214</span>
+<span id="215">215</span>
+<span id="216">216</span>
+<span id="217">217</span>
+<span id="218">218</span>
+<span id="219">219</span>
+<span id="220">220</span>
+<span id="221">221</span>
+<span id="222">222</span>
+<span id="223">223</span>
+<span id="224">224</span>
+<span id="225">225</span>
+<span id="226">226</span>
+<span id="227">227</span>
+<span id="228">228</span>
+<span id="229">229</span>
+<span id="230">230</span>
+<span id="231">231</span>
+<span id="232">232</span>
+<span id="233">233</span>
+<span id="234">234</span>
+<span id="235">235</span>
+<span id="236">236</span>
+<span id="237">237</span>
+<span id="238">238</span>
+<span id="239">239</span>
+<span id="240">240</span>
+<span id="241">241</span>
+<span id="242">242</span>
+<span id="243">243</span>
+<span id="244">244</span>
+<span id="245">245</span>
+<span id="246">246</span>
+<span id="247">247</span>
+<span id="248">248</span>
+<span id="249">249</span>
+<span id="250">250</span>
+<span id="251">251</span>
+<span id="252">252</span>
+<span id="253">253</span>
+<span id="254">254</span>
+<span id="255">255</span>
+<span id="256">256</span>
+<span id="257">257</span>
+<span id="258">258</span>
+<span id="259">259</span>
+<span id="260">260</span>
+<span id="261">261</span>
+<span id="262">262</span>
+<span id="263">263</span>
+<span id="264">264</span>
+<span id="265">265</span>
+<span id="266">266</span>
+<span id="267">267</span>
+<span id="268">268</span>
+<span id="269">269</span>
+<span id="270">270</span>
+<span id="271">271</span>
+<span id="272">272</span>
+<span id="273">273</span>
+<span id="274">274</span>
+<span id="275">275</span>
+<span id="276">276</span>
+<span id="277">277</span>
+<span id="278">278</span>
+<span id="279">279</span>
+<span id="280">280</span>
+<span id="281">281</span>
+<span id="282">282</span>
+<span id="283">283</span>
+<span id="284">284</span>
+<span id="285">285</span>
+<span id="286">286</span>
+<span id="287">287</span>
+<span id="288">288</span>
+<span id="289">289</span>
+<span id="290">290</span>
+<span id="291">291</span>
+<span id="292">292</span>
+<span id="293">293</span>
+<span id="294">294</span>
+<span id="295">295</span>
+<span id="296">296</span>
+<span id="297">297</span>
+<span id="298">298</span>
+<span id="299">299</span>
+<span id="300">300</span>
+<span id="301">301</span>
+<span id="302">302</span>
+<span id="303">303</span>
+<span id="304">304</span>
+<span id="305">305</span>
+<span id="306">306</span>
+<span id="307">307</span>
+<span id="308">308</span>
+<span id="309">309</span>
+<span id="310">310</span>
+<span id="311">311</span>
+<span id="312">312</span>
+<span id="313">313</span>
+<span id="314">314</span>
+<span id="315">315</span>
+<span id="316">316</span>
+<span id="317">317</span>
+<span id="318">318</span>
+<span id="319">319</span>
+<span id="320">320</span>
+<span id="321">321</span>
+<span id="322">322</span>
+<span id="323">323</span>
+<span id="324">324</span>
+<span id="325">325</span>
+<span id="326">326</span>
+<span id="327">327</span>
+<span id="328">328</span>
+<span id="329">329</span>
+<span id="330">330</span>
+<span id="331">331</span>
+<span id="332">332</span>
+<span id="333">333</span>
+<span id="334">334</span>
+<span id="335">335</span>
+<span id="336">336</span>
+<span id="337">337</span>
+<span id="338">338</span>
+<span id="339">339</span>
+<span id="340">340</span>
+<span id="341">341</span>
+<span id="342">342</span>
+<span id="343">343</span>
+<span id="344">344</span>
+<span id="345">345</span>
+<span id="346">346</span>
+<span id="347">347</span>
+<span id="348">348</span>
+<span id="349">349</span>
+<span id="350">350</span>
+<span id="351">351</span>
+<span id="352">352</span>
+<span id="353">353</span>
+<span id="354">354</span>
+<span id="355">355</span>
+<span id="356">356</span>
+<span id="357">357</span>
+<span id="358">358</span>
+<span id="359">359</span>
+<span id="360">360</span>
+<span id="361">361</span>
+<span id="362">362</span>
+<span id="363">363</span>
+<span id="364">364</span>
+<span id="365">365</span>
+<span id="366">366</span>
+<span id="367">367</span>
+<span id="368">368</span>
+<span id="369">369</span>
+<span id="370">370</span>
+<span id="371">371</span>
+<span id="372">372</span>
+<span id="373">373</span>
+<span id="374">374</span>
+<span id="375">375</span>
+<span id="376">376</span>
+<span id="377">377</span>
+<span id="378">378</span>
+<span id="379">379</span>
+<span id="380">380</span>
+<span id="381">381</span>
+<span id="382">382</span>
+<span id="383">383</span>
+<span id="384">384</span>
+<span id="385">385</span>
+<span id="386">386</span>
+<span id="387">387</span>
+<span id="388">388</span>
+<span id="389">389</span>
+<span id="390">390</span>
+<span id="391">391</span>
+<span id="392">392</span>
+<span id="393">393</span>
+<span id="394">394</span>
+<span id="395">395</span>
+<span id="396">396</span>
+<span id="397">397</span>
+<span id="398">398</span>
+<span id="399">399</span>
+<span id="400">400</span>
+<span id="401">401</span>
+<span id="402">402</span>
+<span id="403">403</span>
+<span id="404">404</span>
+<span id="405">405</span>
+<span id="406">406</span>
+<span id="407">407</span>
+<span id="408">408</span>
+<span id="409">409</span>
+<span id="410">410</span>
+<span id="411">411</span>
+<span id="412">412</span>
+<span id="413">413</span>
+<span id="414">414</span>
+<span id="415">415</span>
+<span id="416">416</span>
+<span id="417">417</span>
+<span id="418">418</span>
+<span id="419">419</span>
+<span id="420">420</span>
+<span id="421">421</span>
+<span id="422">422</span>
+<span id="423">423</span>
+<span id="424">424</span>
+<span id="425">425</span>
+<span id="426">426</span>
+<span id="427">427</span>
+<span id="428">428</span>
+<span id="429">429</span>
+<span id="430">430</span>
+<span id="431">431</span>
+<span id="432">432</span>
+<span id="433">433</span>
+<span id="434">434</span>
+<span id="435">435</span>
+<span id="436">436</span>
+<span id="437">437</span>
+<span id="438">438</span>
+<span id="439">439</span>
+<span id="440">440</span>
+<span id="441">441</span>
+<span id="442">442</span>
+<span id="443">443</span>
+<span id="444">444</span>
+<span id="445">445</span>
+<span id="446">446</span>
+<span id="447">447</span>
+<span id="448">448</span>
+<span id="449">449</span>
+<span id="450">450</span>
+<span id="451">451</span>
+<span id="452">452</span>
+<span id="453">453</span>
+<span id="454">454</span>
+<span id="455">455</span>
+<span id="456">456</span>
+<span id="457">457</span>
+<span id="458">458</span>
+<span id="459">459</span>
+<span id="460">460</span>
+<span id="461">461</span>
+<span id="462">462</span>
+<span id="463">463</span>
+<span id="464">464</span>
+<span id="465">465</span>
+<span id="466">466</span>
+<span id="467">467</span>
+<span id="468">468</span>
+<span id="469">469</span>
+<span id="470">470</span>
+<span id="471">471</span>
+<span id="472">472</span>
+<span id="473">473</span>
+<span id="474">474</span>
+<span id="475">475</span>
+<span id="476">476</span>
+<span id="477">477</span>
+<span id="478">478</span>
+<span id="479">479</span>
+<span id="480">480</span>
+<span id="481">481</span>
+<span id="482">482</span>
+<span id="483">483</span>
+<span id="484">484</span>
+<span id="485">485</span>
+<span id="486">486</span>
+<span id="487">487</span>
+<span id="488">488</span>
+<span id="489">489</span>
+<span id="490">490</span>
+<span id="491">491</span>
+<span id="492">492</span>
+<span id="493">493</span>
+<span id="494">494</span>
+<span id="495">495</span>
+<span id="496">496</span>
+<span id="497">497</span>
+<span id="498">498</span>
+<span id="499">499</span>
+<span id="500">500</span>
+<span id="501">501</span>
+<span id="502">502</span>
+<span id="503">503</span>
+<span id="504">504</span>
+<span id="505">505</span>
+<span id="506">506</span>
+<span id="507">507</span>
+<span id="508">508</span>
+<span id="509">509</span>
+<span id="510">510</span>
+<span id="511">511</span>
+<span id="512">512</span>
+<span id="513">513</span>
+<span id="514">514</span>
+<span id="515">515</span>
+<span id="516">516</span>
+<span id="517">517</span>
+<span id="518">518</span>
+<span id="519">519</span>
+<span id="520">520</span>
+<span id="521">521</span>
+<span id="522">522</span>
+<span id="523">523</span>
+<span id="524">524</span>
+<span id="525">525</span>
+<span id="526">526</span>
+<span id="527">527</span>
+<span id="528">528</span>
+<span id="529">529</span>
+<span id="530">530</span>
+<span id="531">531</span>
+<span id="532">532</span>
+<span id="533">533</span>
+<span id="534">534</span>
+<span id="535">535</span>
+<span id="536">536</span>
+<span id="537">537</span>
+<span id="538">538</span>
+<span id="539">539</span>
+<span id="540">540</span>
+<span id="541">541</span>
+<span id="542">542</span>
+<span id="543">543</span>
+<span id="544">544</span>
+<span id="545">545</span>
+<span id="546">546</span>
+<span id="547">547</span>
+<span id="548">548</span>
+<span id="549">549</span>
+<span id="550">550</span>
+<span id="551">551</span>
+<span id="552">552</span>
+<span id="553">553</span>
+<span id="554">554</span>
+<span id="555">555</span>
+<span id="556">556</span>
+<span id="557">557</span>
+<span id="558">558</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="doccomment">//! In-memory ephemeral database</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! This module defines an in-memory database type called [`MemoryDatabase`] that is based on a</span>
+<span class="doccomment">//! [`BTreeMap`].</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ops</span>::<span class="ident">Bound</span>::{<span class="ident">Excluded</span>, <span class="ident">Included</span>};
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::{<span class="ident">deserialize</span>, <span class="ident">serialize</span>};
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hash_types</span>::<span class="ident">Txid</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">OutPoint</span>, <span class="ident">Script</span>, <span class="ident">Transaction</span>};
+
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::{<span class="ident">BatchDatabase</span>, <span class="ident">BatchOperations</span>, <span class="ident">Database</span>};
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="kw-2">*</span>;
+
+<span class="comment">// path -> script p{i,e}<path> -> script</span>
+<span class="comment">// script -> path s<script> -> {i,e}<path></span>
+<span class="comment">// outpoint u<outpoint> -> txout</span>
+<span class="comment">// rawtx r<txid> -> tx</span>
+<span class="comment">// transactions t<txid> -> tx details</span>
+<span class="comment">// deriv indexes c{i,e} -> u32</span>
+<span class="comment">// descriptor checksum d{i,e} -> vec<u8></span>
+
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">enum</span> <span class="ident">MapKey</span><span class="op"><</span><span class="lifetime">'a</span><span class="op">></span> {
+ <span class="ident">Path</span>((<span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">ScriptType</span><span class="op">></span>, <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>)),
+ <span class="ident">Script</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">Script</span><span class="op">></span>),
+ <span class="ident">UTXO</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">OutPoint</span><span class="op">></span>),
+ <span class="ident">RawTx</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">Txid</span><span class="op">></span>),
+ <span class="ident">Transaction</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">Txid</span><span class="op">></span>),
+ <span class="ident">LastIndex</span>(<span class="ident">ScriptType</span>),
+ <span class="ident">DescriptorChecksum</span>(<span class="ident">ScriptType</span>),
+}
+
+<span class="kw">impl</span> <span class="ident">MapKey</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span> {
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">as_prefix</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span> {
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="ident">st</span>, <span class="kw">_</span>)) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">v</span> <span class="op">=</span> <span class="string">b"p"</span>.<span class="ident">to_vec</span>();
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">st</span>) <span class="op">=</span> <span class="ident">st</span> {
+ <span class="ident">v</span>.<span class="ident">push</span>(<span class="ident">st</span>.<span class="ident">as_byte</span>());
+ }
+ <span class="ident">v</span>
+ }
+ <span class="ident">MapKey</span>::<span class="ident">Script</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="string">b"s"</span>.<span class="ident">to_vec</span>(),
+ <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="string">b"u"</span>.<span class="ident">to_vec</span>(),
+ <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="string">b"r"</span>.<span class="ident">to_vec</span>(),
+ <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="string">b"t"</span>.<span class="ident">to_vec</span>(),
+ <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">st</span>) <span class="op">=</span><span class="op">></span> [<span class="string">b"c"</span>, <span class="ident">st</span>.<span class="ident">as_ref</span>()].<span class="ident">concat</span>(),
+ <span class="ident">MapKey</span>::<span class="ident">DescriptorChecksum</span>(<span class="ident">st</span>) <span class="op">=</span><span class="op">></span> [<span class="string">b"d"</span>, <span class="ident">st</span>.<span class="ident">as_ref</span>()].<span class="ident">concat</span>(),
+ }
+ }
+
+ <span class="kw">fn</span> <span class="ident">serialize_content</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span> {
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="kw">_</span>, <span class="prelude-val">Some</span>(<span class="ident">child</span>))) <span class="op">=</span><span class="op">></span> <span class="ident">u32</span>::<span class="ident">from</span>(<span class="kw-2">*</span><span class="ident">child</span>).<span class="ident">to_be_bytes</span>().<span class="ident">to_vec</span>(),
+ <span class="ident">MapKey</span>::<span class="ident">Script</span>(<span class="prelude-val">Some</span>(<span class="ident">s</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">serialize</span>(<span class="kw-2">*</span><span class="ident">s</span>),
+ <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">Some</span>(<span class="ident">s</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">serialize</span>(<span class="kw-2">*</span><span class="ident">s</span>),
+ <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">Some</span>(<span class="ident">s</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">serialize</span>(<span class="kw-2">*</span><span class="ident">s</span>),
+ <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">Some</span>(<span class="ident">s</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">serialize</span>(<span class="kw-2">*</span><span class="ident">s</span>),
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="macro">vec</span><span class="macro">!</span>[],
+ }
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">as_map_key</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">v</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">as_prefix</span>();
+ <span class="ident">v</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">serialize_content</span>());
+
+ <span class="ident">v</span>
+ }
+}
+
+<span class="kw">fn</span> <span class="ident">after</span>(<span class="ident">key</span>: <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">key</span>.<span class="ident">clone</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">idx</span> <span class="op">=</span> <span class="ident">key</span>.<span class="ident">len</span>();
+ <span class="kw">while</span> <span class="ident">idx</span> <span class="op">></span> <span class="number">0</span> {
+ <span class="kw">if</span> <span class="ident">key</span>[<span class="ident">idx</span> <span class="op">-</span> <span class="number">1</span>] <span class="op">=</span><span class="op">=</span> <span class="number">0xFF</span> {
+ <span class="ident">idx</span> <span class="op">-</span><span class="op">=</span> <span class="number">1</span>;
+ <span class="kw">continue</span>;
+ } <span class="kw">else</span> {
+ <span class="ident">key</span>[<span class="ident">idx</span> <span class="op">-</span> <span class="number">1</span>] <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
+ <span class="kw">break</span>;
+ }
+ }
+
+ <span class="ident">key</span>
+}
+
+<span class="doccomment">/// In-memory ephemeral database</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This database can be used as a temporary storage for wallets that are not kept permanently on</span>
+<span class="doccomment">/// a device, or on platforms that don't provide a filesystem, like `wasm32`.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Once it's dropped its content will be lost.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// If you are looking for a permanent storage solution, you can try with the default key-value</span>
+<span class="doccomment">/// database called [`sled`]. See the [`database`] module documentation for more defailts.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// [`database`]: crate::database</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Default</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">MemoryDatabase</span> {
+ <span class="ident">map</span>: <span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>, <span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">std</span>::<span class="ident">any</span>::<span class="ident">Any</span><span class="op">></span><span class="op">></span>,
+ <span class="ident">deleted_keys</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span><span class="op">></span>,
+}
+
+<span class="kw">impl</span> <span class="ident">MemoryDatabase</span> {
+ <span class="doccomment">/// Create a new empty database</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">MemoryDatabase</span> {
+ <span class="ident">map</span>: <span class="ident">BTreeMap</span>::<span class="ident">new</span>(),
+ <span class="ident">deleted_keys</span>: <span class="ident">Vec</span>::<span class="ident">new</span>(),
+ }
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">BatchOperations</span> <span class="kw">for</span> <span class="ident">MemoryDatabase</span> {
+ <span class="kw">fn</span> <span class="ident">set_script_pubkey</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
+ <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
+ <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
+ <span class="ident">path</span>: <span class="ident">u32</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="prelude-val">Some</span>(<span class="ident">script_type</span>), <span class="prelude-val">Some</span>(<span class="ident">path</span>))).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">script</span>.<span class="ident">clone</span>()));
+
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Script</span>(<span class="prelude-val">Some</span>(<span class="ident">script</span>)).<span class="ident">as_map_key</span>();
+ <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="macro">json</span><span class="macro">!</span>({
+ <span class="string">"t"</span>: <span class="ident">script_type</span>,
+ <span class="string">"p"</span>: <span class="ident">path</span>,
+ });
+ <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">value</span>));
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">fn</span> <span class="ident">set_utxo</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">utxo</span>: <span class="kw-2">&</span><span class="ident">UTXO</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="ident">utxo</span>.<span class="ident">outpoint</span>)).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">map</span>
+ .<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">Box</span>::<span class="ident">new</span>((<span class="ident">utxo</span>.<span class="ident">txout</span>.<span class="ident">clone</span>(), <span class="ident">utxo</span>.<span class="ident">is_internal</span>)));
+
+ <span class="prelude-val">Ok</span>(())
+ }
+ <span class="kw">fn</span> <span class="ident">set_raw_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">transaction</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="ident">transaction</span>.<span class="ident">txid</span>())).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">transaction</span>.<span class="ident">clone</span>()));
+
+ <span class="prelude-val">Ok</span>(())
+ }
+ <span class="kw">fn</span> <span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">transaction</span>: <span class="kw-2">&</span><span class="ident">TransactionDetails</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="ident">transaction</span>.<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
+
+ <span class="comment">// insert the raw_tx if present</span>
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">tx</span>) <span class="op">=</span> <span class="ident">transaction</span>.<span class="ident">transaction</span> {
+ <span class="self">self</span>.<span class="ident">set_raw_tx</span>(<span class="ident">tx</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="comment">// remove the raw tx from the serialized version</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">transaction</span> <span class="op">=</span> <span class="ident">transaction</span>.<span class="ident">clone</span>();
+ <span class="ident">transaction</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">None</span>;
+
+ <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">transaction</span>));
+
+ <span class="prelude-val">Ok</span>(())
+ }
+ <span class="kw">fn</span> <span class="ident">set_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>, <span class="ident">value</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">value</span>));
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">fn</span> <span class="ident">del_script_pubkey_from_path</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
+ <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
+ <span class="ident">path</span>: <span class="ident">u32</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="prelude-val">Some</span>(<span class="ident">script_type</span>), <span class="prelude-val">Some</span>(<span class="ident">path</span>))).<span class="ident">as_map_key</span>();
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">key</span>);
+ <span class="self">self</span>.<span class="ident">deleted_keys</span>.<span class="ident">push</span>(<span class="ident">key</span>);
+
+ <span class="prelude-val">Ok</span>(<span class="ident">res</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>()))
+ }
+ <span class="kw">fn</span> <span class="ident">del_path_from_script_pubkey</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
+ <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span>(<span class="ident">ScriptType</span>, <span class="ident">u32</span>)<span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Script</span>(<span class="prelude-val">Some</span>(<span class="ident">script</span>)).<span class="ident">as_map_key</span>();
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">key</span>);
+ <span class="self">self</span>.<span class="ident">deleted_keys</span>.<span class="ident">push</span>(<span class="ident">key</span>);
+
+ <span class="kw">match</span> <span class="ident">res</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">serde_json</span>::<span class="ident">Value</span> <span class="op">=</span> <span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">st</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"t"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"p"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>((<span class="ident">st</span>, <span class="ident">path</span>)))
+ }
+ }
+ }
+ <span class="kw">fn</span> <span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">outpoint</span>: <span class="kw-2">&</span><span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">Some</span>(<span class="ident">outpoint</span>)).<span class="ident">as_map_key</span>();
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">key</span>);
+ <span class="self">self</span>.<span class="ident">deleted_keys</span>.<span class="ident">push</span>(<span class="ident">key</span>);
+
+ <span class="kw">match</span> <span class="ident">res</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> (<span class="ident">txout</span>, <span class="ident">is_internal</span>) <span class="op">=</span> <span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>();
+ <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">UTXO</span> {
+ <span class="ident">outpoint</span>: <span class="ident">outpoint</span>.<span class="ident">clone</span>(),
+ <span class="ident">txout</span>,
+ <span class="ident">is_internal</span>,
+ }))
+ }
+ }
+ }
+ <span class="kw">fn</span> <span class="ident">del_raw_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">Some</span>(<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">key</span>);
+ <span class="self">self</span>.<span class="ident">deleted_keys</span>.<span class="ident">push</span>(<span class="ident">key</span>);
+
+ <span class="prelude-val">Ok</span>(<span class="ident">res</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>()))
+ }
+ <span class="kw">fn</span> <span class="ident">del_tx</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
+ <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>,
+ <span class="ident">include_raw</span>: <span class="ident">bool</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">raw_tx</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">include_raw</span> {
+ <span class="self">self</span>.<span class="ident">del_raw_tx</span>(<span class="ident">txid</span>)<span class="question-mark">?</span>
+ } <span class="kw">else</span> {
+ <span class="prelude-val">None</span>
+ };
+
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">Some</span>(<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">key</span>);
+ <span class="self">self</span>.<span class="ident">deleted_keys</span>.<span class="ident">push</span>(<span class="ident">key</span>);
+
+ <span class="kw">match</span> <span class="ident">res</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">TransactionDetails</span> <span class="op">=</span> <span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>();
+ <span class="ident">val</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="ident">raw_tx</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">val</span>))
+ }
+ }
+ }
+ <span class="kw">fn</span> <span class="ident">del_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">key</span>);
+ <span class="self">self</span>.<span class="ident">deleted_keys</span>.<span class="ident">push</span>(<span class="ident">key</span>);
+
+ <span class="kw">match</span> <span class="ident">res</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="kw-2">*</span><span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">unwrap</span>())),
+ }
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">Database</span> <span class="kw">for</span> <span class="ident">MemoryDatabase</span> {
+ <span class="kw">fn</span> <span class="ident">check_descriptor_checksum</span><span class="op"><</span><span class="ident">B</span>: <span class="ident">AsRef</span><span class="op"><</span>[<span class="ident">u8</span>]<span class="op">></span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
+ <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
+ <span class="ident">bytes</span>: <span class="ident">B</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">DescriptorChecksum</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
+
+ <span class="kw">let</span> <span class="ident">prev</span> <span class="op">=</span> <span class="self">self</span>
+ .<span class="ident">map</span>
+ .<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key</span>)
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span>.<span class="ident">downcast_ref</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span><span class="op">></span>().<span class="ident">unwrap</span>());
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">val</span>) <span class="op">=</span> <span class="ident">prev</span> {
+ <span class="kw">if</span> <span class="ident">val</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">bytes</span>.<span class="ident">as_ref</span>().<span class="ident">to_vec</span>() {
+ <span class="prelude-val">Ok</span>(())
+ } <span class="kw">else</span> {
+ <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">ChecksumMismatch</span>)
+ }
+ } <span class="kw">else</span> {
+ <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">bytes</span>.<span class="ident">as_ref</span>().<span class="ident">to_vec</span>()));
+ <span class="prelude-val">Ok</span>(())
+ }
+ }
+
+ <span class="kw">fn</span> <span class="ident">iter_script_pubkeys</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script_type</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">ScriptType</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="ident">script_type</span>, <span class="prelude-val">None</span>)).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">map</span>
+ .<span class="ident">range</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>, <span class="kw">_</span><span class="op">></span>((<span class="ident">Included</span>(<span class="kw-2">&</span><span class="ident">key</span>), <span class="ident">Excluded</span>(<span class="kw-2">&</span><span class="ident">after</span>(<span class="kw-2">&</span><span class="ident">key</span>))))
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">v</span>)<span class="op">|</span> <span class="prelude-val">Ok</span>(<span class="ident">v</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>()))
+ .<span class="ident">collect</span>()
+ }
+
+ <span class="kw">fn</span> <span class="ident">iter_utxos</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">None</span>).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">map</span>
+ .<span class="ident">range</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>, <span class="kw">_</span><span class="op">></span>((<span class="ident">Included</span>(<span class="kw-2">&</span><span class="ident">key</span>), <span class="ident">Excluded</span>(<span class="kw-2">&</span><span class="ident">after</span>(<span class="kw-2">&</span><span class="ident">key</span>))))
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="ident">v</span>)<span class="op">|</span> {
+ <span class="kw">let</span> <span class="ident">outpoint</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">k</span>[<span class="number">1</span>..]).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">txout</span>, <span class="ident">is_internal</span>) <span class="op">=</span> <span class="ident">v</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>();
+ <span class="prelude-val">Ok</span>(<span class="ident">UTXO</span> {
+ <span class="ident">outpoint</span>,
+ <span class="ident">txout</span>,
+ <span class="ident">is_internal</span>,
+ })
+ })
+ .<span class="ident">collect</span>()
+ }
+
+ <span class="kw">fn</span> <span class="ident">iter_raw_txs</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">None</span>).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">map</span>
+ .<span class="ident">range</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>, <span class="kw">_</span><span class="op">></span>((<span class="ident">Included</span>(<span class="kw-2">&</span><span class="ident">key</span>), <span class="ident">Excluded</span>(<span class="kw-2">&</span><span class="ident">after</span>(<span class="kw-2">&</span><span class="ident">key</span>))))
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">v</span>)<span class="op">|</span> <span class="prelude-val">Ok</span>(<span class="ident">v</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>()))
+ .<span class="ident">collect</span>()
+ }
+
+ <span class="kw">fn</span> <span class="ident">iter_txs</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">include_raw</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">None</span>).<span class="ident">as_map_key</span>();
+ <span class="self">self</span>.<span class="ident">map</span>
+ .<span class="ident">range</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>, <span class="kw">_</span><span class="op">></span>((<span class="ident">Included</span>(<span class="kw-2">&</span><span class="ident">key</span>), <span class="ident">Excluded</span>(<span class="kw-2">&</span><span class="ident">after</span>(<span class="kw-2">&</span><span class="ident">key</span>))))
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="ident">v</span>)<span class="op">|</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">txdetails</span>: <span class="ident">TransactionDetails</span> <span class="op">=</span> <span class="ident">v</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>();
+ <span class="kw">if</span> <span class="ident">include_raw</span> {
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">k</span>[<span class="number">1</span>..])<span class="question-mark">?</span>;
+ <span class="ident">txdetails</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="ident">txid</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">txdetails</span>)
+ })
+ .<span class="ident">collect</span>()
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_script_pubkey_from_path</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
+ <span class="ident">path</span>: <span class="ident">u32</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="prelude-val">Some</span>(<span class="ident">script_type</span>), <span class="prelude-val">Some</span>(<span class="ident">path</span>))).<span class="ident">as_map_key</span>();
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>
+ .<span class="ident">map</span>
+ .<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key</span>)
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>()))
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_path_from_script_pubkey</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span>(<span class="ident">ScriptType</span>, <span class="ident">u32</span>)<span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Script</span>(<span class="prelude-val">Some</span>(<span class="ident">script</span>)).<span class="ident">as_map_key</span>();
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">map</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key</span>).<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">serde_json</span>::<span class="ident">Value</span> <span class="op">=</span> <span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">st</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"t"</span>].<span class="ident">take</span>()).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"p"</span>].<span class="ident">take</span>()).<span class="ident">unwrap</span>();
+
+ (<span class="ident">st</span>, <span class="ident">path</span>)
+ }))
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_utxo</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">outpoint</span>: <span class="kw-2">&</span><span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">Some</span>(<span class="ident">outpoint</span>)).<span class="ident">as_map_key</span>();
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">map</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key</span>).<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> {
+ <span class="kw">let</span> (<span class="ident">txout</span>, <span class="ident">is_internal</span>) <span class="op">=</span> <span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>();
+ <span class="ident">UTXO</span> {
+ <span class="ident">outpoint</span>: <span class="ident">outpoint</span>.<span class="ident">clone</span>(),
+ <span class="ident">txout</span>,
+ <span class="ident">is_internal</span>,
+ }
+ }))
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">Some</span>(<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>
+ .<span class="ident">map</span>
+ .<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key</span>)
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>()))
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>, <span class="ident">include_raw</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">Some</span>(<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">map</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key</span>).<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">txdetails</span>: <span class="ident">TransactionDetails</span> <span class="op">=</span> <span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>();
+ <span class="kw">if</span> <span class="ident">include_raw</span> {
+ <span class="ident">txdetails</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="ident">txid</span>).<span class="ident">unwrap</span>();
+ }
+
+ <span class="ident">txdetails</span>
+ }))
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_last_index</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">map</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key</span>).<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="kw-2">*</span><span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">unwrap</span>()))
+ }
+
+ <span class="comment">// inserts 0 if not present</span>
+ <span class="kw">fn</span> <span class="ident">increment_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
+ <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="self">self</span>
+ .<span class="ident">map</span>
+ .<span class="ident">entry</span>(<span class="ident">key</span>.<span class="ident">clone</span>())
+ .<span class="ident">and_modify</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="kw-2">*</span><span class="ident">x</span>.<span class="ident">downcast_mut</span>::<span class="op"><</span><span class="ident">u32</span><span class="op">></span>().<span class="ident">unwrap</span>() <span class="op">+</span><span class="op">=</span> <span class="number">1</span>)
+ .<span class="ident">or_insert</span>(<span class="ident">Box</span>::<span class="op"><</span><span class="ident">u32</span><span class="op">></span>::<span class="ident">new</span>(<span class="number">0</span>))
+ .<span class="ident">downcast_mut</span>()
+ .<span class="ident">unwrap</span>();
+
+ <span class="prelude-val">Ok</span>(<span class="kw-2">*</span><span class="ident">value</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">BatchDatabase</span> <span class="kw">for</span> <span class="ident">MemoryDatabase</span> {
+ <span class="kw">type</span> <span class="ident">Batch</span> <span class="op">=</span> <span class="self">Self</span>;
+
+ <span class="kw">fn</span> <span class="ident">begin_batch</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span>::<span class="ident">Batch</span> {
+ <span class="ident">MemoryDatabase</span>::<span class="ident">new</span>()
+ }
+
+ <span class="kw">fn</span> <span class="ident">commit_batch</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="kw-2">mut</span> <span class="ident">batch</span>: <span class="self">Self</span>::<span class="ident">Batch</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">for</span> <span class="ident">key</span> <span class="kw">in</span> <span class="ident">batch</span>.<span class="ident">deleted_keys</span> {
+ <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">key</span>);
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">map</span>.<span class="ident">append</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">batch</span>.<span class="ident">map</span>))
+ }
+}
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="kw">impl</span> <span class="ident">MemoryDatabase</span> {
+ <span class="comment">// Artificially insert a tx in the database, as if we had found it with a `sync`</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">received_tx</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
+ <span class="ident">tx_meta</span>: <span class="ident">testutils</span>::<span class="ident">TestIncomingTx</span>,
+ <span class="ident">current_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="ident">bitcoin</span>::<span class="ident">Txid</span> {
+ <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
+
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">Transaction</span> {
+ <span class="ident">version</span>: <span class="number">1</span>,
+ <span class="ident">lock_time</span>: <span class="number">0</span>,
+ <span class="ident">input</span>: <span class="macro">vec</span><span class="macro">!</span>[],
+ <span class="ident">output</span>: <span class="ident">tx_meta</span>
+ .<span class="ident">output</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">out_meta</span><span class="op">|</span> <span class="ident">bitcoin</span>::<span class="ident">TxOut</span> {
+ <span class="ident">value</span>: <span class="ident">out_meta</span>.<span class="ident">value</span>,
+ <span class="ident">script_pubkey</span>: <span class="ident">bitcoin</span>::<span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="kw-2">&</span><span class="ident">out_meta</span>.<span class="ident">to_address</span>)
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">script_pubkey</span>(),
+ })
+ .<span class="ident">collect</span>(),
+ };
+
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
+ <span class="kw">let</span> <span class="ident">height</span> <span class="op">=</span> <span class="ident">tx_meta</span>
+ .<span class="ident">min_confirmations</span>
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">conf</span><span class="op">|</span> <span class="ident">current_height</span>.<span class="ident">unwrap</span>().<span class="ident">checked_sub</span>(<span class="ident">conf</span> <span class="kw">as</span> <span class="ident">u32</span>).<span class="ident">unwrap</span>());
+
+ <span class="kw">let</span> <span class="ident">tx_details</span> <span class="op">=</span> <span class="ident">TransactionDetails</span> {
+ <span class="ident">transaction</span>: <span class="prelude-val">Some</span>(<span class="ident">tx</span>.<span class="ident">clone</span>()),
+ <span class="ident">txid</span>,
+ <span class="ident">timestamp</span>: <span class="number">0</span>,
+ <span class="ident">height</span>,
+ <span class="ident">received</span>: <span class="number">0</span>,
+ <span class="ident">sent</span>: <span class="number">0</span>,
+ <span class="ident">fees</span>: <span class="number">0</span>,
+ };
+
+ <span class="self">self</span>.<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">tx_details</span>).<span class="ident">unwrap</span>();
+ <span class="kw">for</span> (<span class="ident">vout</span>, <span class="ident">out</span>) <span class="kw">in</span> <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
+ <span class="self">self</span>.<span class="ident">set_utxo</span>(<span class="kw-2">&</span><span class="ident">UTXO</span> {
+ <span class="ident">txout</span>: <span class="ident">out</span>.<span class="ident">clone</span>(),
+ <span class="ident">outpoint</span>: <span class="ident">OutPoint</span> {
+ <span class="ident">txid</span>,
+ <span class="ident">vout</span>: <span class="ident">vout</span> <span class="kw">as</span> <span class="ident">u32</span>,
+ },
+ <span class="ident">is_internal</span>: <span class="bool-val">false</span>,
+ })
+ .<span class="ident">unwrap</span>();
+ }
+
+ <span class="ident">txid</span>
+ }
+}
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="kw">mod</span> <span class="ident">test</span> {
+ <span class="kw">use</span> <span class="kw">super</span>::<span class="ident">MemoryDatabase</span>;
+
+ <span class="kw">fn</span> <span class="ident">get_tree</span>() <span class="op">-</span><span class="op">></span> <span class="ident">MemoryDatabase</span> {
+ <span class="ident">MemoryDatabase</span>::<span class="ident">new</span>()
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_script_pubkey</span>() {
+ <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_script_pubkey</span>(<span class="ident">get_tree</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_batch_script_pubkey</span>() {
+ <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_batch_script_pubkey</span>(<span class="ident">get_tree</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_iter_script_pubkey</span>() {
+ <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_iter_script_pubkey</span>(<span class="ident">get_tree</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_del_script_pubkey</span>() {
+ <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_del_script_pubkey</span>(<span class="ident">get_tree</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_utxo</span>() {
+ <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_utxo</span>(<span class="ident">get_tree</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_raw_tx</span>() {
+ <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_raw_tx</span>(<span class="ident">get_tree</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_tx</span>() {
+ <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_tx</span>(<span class="ident">get_tree</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_last_index</span>() {
+ <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_last_index</span>(<span class="ident">get_tree</span>());
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/database/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+<span id="163">163</span>
+<span id="164">164</span>
+<span id="165">165</span>
+<span id="166">166</span>
+<span id="167">167</span>
+<span id="168">168</span>
+<span id="169">169</span>
+<span id="170">170</span>
+<span id="171">171</span>
+<span id="172">172</span>
+<span id="173">173</span>
+<span id="174">174</span>
+<span id="175">175</span>
+<span id="176">176</span>
+<span id="177">177</span>
+<span id="178">178</span>
+<span id="179">179</span>
+<span id="180">180</span>
+<span id="181">181</span>
+<span id="182">182</span>
+<span id="183">183</span>
+<span id="184">184</span>
+<span id="185">185</span>
+<span id="186">186</span>
+<span id="187">187</span>
+<span id="188">188</span>
+<span id="189">189</span>
+<span id="190">190</span>
+<span id="191">191</span>
+<span id="192">192</span>
+<span id="193">193</span>
+<span id="194">194</span>
+<span id="195">195</span>
+<span id="196">196</span>
+<span id="197">197</span>
+<span id="198">198</span>
+<span id="199">199</span>
+<span id="200">200</span>
+<span id="201">201</span>
+<span id="202">202</span>
+<span id="203">203</span>
+<span id="204">204</span>
+<span id="205">205</span>
+<span id="206">206</span>
+<span id="207">207</span>
+<span id="208">208</span>
+<span id="209">209</span>
+<span id="210">210</span>
+<span id="211">211</span>
+<span id="212">212</span>
+<span id="213">213</span>
+<span id="214">214</span>
+<span id="215">215</span>
+<span id="216">216</span>
+<span id="217">217</span>
+<span id="218">218</span>
+<span id="219">219</span>
+<span id="220">220</span>
+<span id="221">221</span>
+<span id="222">222</span>
+<span id="223">223</span>
+<span id="224">224</span>
+<span id="225">225</span>
+<span id="226">226</span>
+<span id="227">227</span>
+<span id="228">228</span>
+<span id="229">229</span>
+<span id="230">230</span>
+<span id="231">231</span>
+<span id="232">232</span>
+<span id="233">233</span>
+<span id="234">234</span>
+<span id="235">235</span>
+<span id="236">236</span>
+<span id="237">237</span>
+<span id="238">238</span>
+<span id="239">239</span>
+<span id="240">240</span>
+<span id="241">241</span>
+<span id="242">242</span>
+<span id="243">243</span>
+<span id="244">244</span>
+<span id="245">245</span>
+<span id="246">246</span>
+<span id="247">247</span>
+<span id="248">248</span>
+<span id="249">249</span>
+<span id="250">250</span>
+<span id="251">251</span>
+<span id="252">252</span>
+<span id="253">253</span>
+<span id="254">254</span>
+<span id="255">255</span>
+<span id="256">256</span>
+<span id="257">257</span>
+<span id="258">258</span>
+<span id="259">259</span>
+<span id="260">260</span>
+<span id="261">261</span>
+<span id="262">262</span>
+<span id="263">263</span>
+<span id="264">264</span>
+<span id="265">265</span>
+<span id="266">266</span>
+<span id="267">267</span>
+<span id="268">268</span>
+<span id="269">269</span>
+<span id="270">270</span>
+<span id="271">271</span>
+<span id="272">272</span>
+<span id="273">273</span>
+<span id="274">274</span>
+<span id="275">275</span>
+<span id="276">276</span>
+<span id="277">277</span>
+<span id="278">278</span>
+<span id="279">279</span>
+<span id="280">280</span>
+<span id="281">281</span>
+<span id="282">282</span>
+<span id="283">283</span>
+<span id="284">284</span>
+<span id="285">285</span>
+<span id="286">286</span>
+<span id="287">287</span>
+<span id="288">288</span>
+<span id="289">289</span>
+<span id="290">290</span>
+<span id="291">291</span>
+<span id="292">292</span>
+<span id="293">293</span>
+<span id="294">294</span>
+<span id="295">295</span>
+<span id="296">296</span>
+<span id="297">297</span>
+<span id="298">298</span>
+<span id="299">299</span>
+<span id="300">300</span>
+<span id="301">301</span>
+<span id="302">302</span>
+<span id="303">303</span>
+<span id="304">304</span>
+<span id="305">305</span>
+<span id="306">306</span>
+<span id="307">307</span>
+<span id="308">308</span>
+<span id="309">309</span>
+<span id="310">310</span>
+<span id="311">311</span>
+<span id="312">312</span>
+<span id="313">313</span>
+<span id="314">314</span>
+<span id="315">315</span>
+<span id="316">316</span>
+<span id="317">317</span>
+<span id="318">318</span>
+<span id="319">319</span>
+<span id="320">320</span>
+<span id="321">321</span>
+<span id="322">322</span>
+<span id="323">323</span>
+<span id="324">324</span>
+<span id="325">325</span>
+<span id="326">326</span>
+<span id="327">327</span>
+<span id="328">328</span>
+<span id="329">329</span>
+<span id="330">330</span>
+<span id="331">331</span>
+<span id="332">332</span>
+<span id="333">333</span>
+<span id="334">334</span>
+<span id="335">335</span>
+<span id="336">336</span>
+<span id="337">337</span>
+<span id="338">338</span>
+<span id="339">339</span>
+<span id="340">340</span>
+<span id="341">341</span>
+<span id="342">342</span>
+<span id="343">343</span>
+<span id="344">344</span>
+<span id="345">345</span>
+<span id="346">346</span>
+<span id="347">347</span>
+<span id="348">348</span>
+<span id="349">349</span>
+<span id="350">350</span>
+<span id="351">351</span>
+<span id="352">352</span>
+<span id="353">353</span>
+<span id="354">354</span>
+<span id="355">355</span>
+<span id="356">356</span>
+<span id="357">357</span>
+<span id="358">358</span>
+<span id="359">359</span>
+<span id="360">360</span>
+<span id="361">361</span>
+<span id="362">362</span>
+<span id="363">363</span>
+<span id="364">364</span>
+<span id="365">365</span>
+<span id="366">366</span>
+<span id="367">367</span>
+<span id="368">368</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="doccomment">//! Database types</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! This module provides the implementation of some defaults database types, along with traits that</span>
+<span class="doccomment">//! can be implemented externally to let [`Wallet`]s use customized databases.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! It's important to note that the databases defined here only contains "blockchain-related" data.</span>
+<span class="doccomment">//! They can be seen more as a cache than a critical piece of storage that contains secrets and</span>
+<span class="doccomment">//! keys.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! The currently recommended database is [`sled`], which is a pretty simple key-value embedded</span>
+<span class="doccomment">//! database written in Rust. If the `key-value-db` feature is enabled (which by default is),</span>
+<span class="doccomment">//! this library automatically implements all the required traits for [`sled::Tree`].</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! [`Wallet`]: crate::wallet::Wallet</span>
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hash_types</span>::<span class="ident">Txid</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">OutPoint</span>, <span class="ident">Script</span>, <span class="ident">Transaction</span>, <span class="ident">TxOut</span>};
+
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="kw-2">*</span>;
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"key-value-db"</span>)]</span>
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">mod</span> <span class="ident">keyvalue</span>;
+
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">memory</span>;
+<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">memory</span>::<span class="ident">MemoryDatabase</span>;
+
+<span class="doccomment">/// Trait for operations that can be batched</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This trait defines the list of operations that must be implemented on the [`Database`] type and</span>
+<span class="doccomment">/// the [`BatchDatabase::Batch`] type.</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">BatchOperations</span> {
+ <span class="doccomment">/// Store a script_pubkey along with its script type and child number</span>
+ <span class="kw">fn</span> <span class="ident">set_script_pubkey</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
+ <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
+ <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
+ <span class="ident">child</span>: <span class="ident">u32</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Store a [`UTXO`]</span>
+ <span class="kw">fn</span> <span class="ident">set_utxo</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">utxo</span>: <span class="kw-2">&</span><span class="ident">UTXO</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Store a raw transaction</span>
+ <span class="kw">fn</span> <span class="ident">set_raw_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">transaction</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Store the metadata of a transaction</span>
+ <span class="kw">fn</span> <span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">transaction</span>: <span class="kw-2">&</span><span class="ident">TransactionDetails</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Store the last derivation index for a given script type</span>
+ <span class="kw">fn</span> <span class="ident">set_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>, <span class="ident">value</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
+
+ <span class="doccomment">/// Delete a script_pubkey given the script type and its child number</span>
+ <span class="kw">fn</span> <span class="ident">del_script_pubkey_from_path</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
+ <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
+ <span class="ident">child</span>: <span class="ident">u32</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Delete the data related to a specific script_pubkey, meaning the script type and the child</span>
+ <span class="doccomment">/// number</span>
+ <span class="kw">fn</span> <span class="ident">del_path_from_script_pubkey</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
+ <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span>(<span class="ident">ScriptType</span>, <span class="ident">u32</span>)<span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Delete a [`UTXO`] given its [`OutPoint`]</span>
+ <span class="kw">fn</span> <span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">outpoint</span>: <span class="kw-2">&</span><span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Delete a raw transaction given its [`Txid`]</span>
+ <span class="kw">fn</span> <span class="ident">del_raw_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Delete the metadata of a transaction and optionally the raw transaction itself</span>
+ <span class="kw">fn</span> <span class="ident">del_tx</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
+ <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>,
+ <span class="ident">include_raw</span>: <span class="ident">bool</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Delete the last derivation index for a script type</span>
+ <span class="kw">fn</span> <span class="ident">del_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+}
+
+<span class="doccomment">/// Trait for reading data from a database</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This traits defines the operations that can be used to read data out of a database</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">Database</span>: <span class="ident">BatchOperations</span> {
+ <span class="doccomment">/// Read and checks the descriptor checksum for a given script type</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// Should return [`Error::ChecksumMismatch`](crate::error::Error::ChecksumMismatch) if the</span>
+ <span class="doccomment">/// checksum doesn't match. If there's no checksum in the database, simply store it for the</span>
+ <span class="doccomment">/// next time.</span>
+ <span class="kw">fn</span> <span class="ident">check_descriptor_checksum</span><span class="op"><</span><span class="ident">B</span>: <span class="ident">AsRef</span><span class="op"><</span>[<span class="ident">u8</span>]<span class="op">></span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
+ <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
+ <span class="ident">bytes</span>: <span class="ident">B</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
+
+ <span class="doccomment">/// Return the list of script_pubkeys</span>
+ <span class="kw">fn</span> <span class="ident">iter_script_pubkeys</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script_type</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">ScriptType</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Return the list of [`UTXO`]s</span>
+ <span class="kw">fn</span> <span class="ident">iter_utxos</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Return the list of raw transactions</span>
+ <span class="kw">fn</span> <span class="ident">iter_raw_txs</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Return the list of transactions metadata</span>
+ <span class="kw">fn</span> <span class="ident">iter_txs</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">include_raw</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+
+ <span class="doccomment">/// Fetch a script_pubkey given the script type and child number</span>
+ <span class="kw">fn</span> <span class="ident">get_script_pubkey_from_path</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
+ <span class="ident">child</span>: <span class="ident">u32</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Fetch the script type and child number of a given script_pubkey</span>
+ <span class="kw">fn</span> <span class="ident">get_path_from_script_pubkey</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span>(<span class="ident">ScriptType</span>, <span class="ident">u32</span>)<span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Fetch a [`UTXO`] given its [`OutPoint`]</span>
+ <span class="kw">fn</span> <span class="ident">get_utxo</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">outpoint</span>: <span class="kw-2">&</span><span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Fetch a raw transaction given its [`Txid`]</span>
+ <span class="kw">fn</span> <span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Fetch the transaction metadata and optionally also the raw transaction</span>
+ <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>, <span class="ident">include_raw</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+ <span class="doccomment">/// Return the last defivation index for a script type</span>
+ <span class="kw">fn</span> <span class="ident">get_last_index</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+
+ <span class="doccomment">/// Increment the last derivation index for a script type and returns it</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// It should insert and return `0` if not present in the database</span>
+ <span class="kw">fn</span> <span class="ident">increment_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span>;
+}
+
+<span class="doccomment">/// Trait for a database that supports batch operations</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This trait defines the methods to start and apply a batch of operations.</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">BatchDatabase</span>: <span class="ident">Database</span> {
+ <span class="doccomment">/// Container for the operations</span>
+ <span class="kw">type</span> <span class="ident">Batch</span>: <span class="ident">BatchOperations</span>;
+
+ <span class="doccomment">/// Create a new batch container</span>
+ <span class="kw">fn</span> <span class="ident">begin_batch</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span>::<span class="ident">Batch</span>;
+ <span class="doccomment">/// Consume and apply a batch of operations</span>
+ <span class="kw">fn</span> <span class="ident">commit_batch</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">batch</span>: <span class="self">Self</span>::<span class="ident">Batch</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
+}
+
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">trait</span> <span class="ident">DatabaseUtils</span>: <span class="ident">Database</span> {
+ <span class="kw">fn</span> <span class="ident">is_mine</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">bool</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">get_path_from_script_pubkey</span>(<span class="ident">script</span>)
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">o</span><span class="op">|</span> <span class="ident">o</span>.<span class="ident">is_some</span>())
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_raw_tx_or</span><span class="op"><</span><span class="ident">F</span><span class="op">></span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>, <span class="ident">f</span>: <span class="ident">F</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>
+ <span class="kw">where</span>
+ <span class="ident">F</span>: <span class="ident">FnOnce</span>() <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>,
+ {
+ <span class="self">self</span>.<span class="ident">get_tx</span>(<span class="ident">txid</span>, <span class="bool-val">true</span>)<span class="question-mark">?</span>
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">t</span><span class="op">|</span> <span class="ident">t</span>.<span class="ident">transaction</span>)
+ .<span class="ident">flatten</span>()
+ .<span class="ident">map_or_else</span>(<span class="ident">f</span>, <span class="op">|</span><span class="ident">t</span><span class="op">|</span> <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">t</span>)))
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_previous_output</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">outpoint</span>: <span class="kw-2">&</span><span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TxOut</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="ident">outpoint</span>.<span class="ident">txid</span>)<span class="question-mark">?</span>
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">previous_tx</span><span class="op">|</span> {
+ <span class="kw">if</span> <span class="ident">outpoint</span>.<span class="ident">vout</span> <span class="kw">as</span> <span class="ident">usize</span> <span class="op">></span><span class="op">=</span> <span class="ident">previous_tx</span>.<span class="ident">output</span>.<span class="ident">len</span>() {
+ <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">InvalidOutpoint</span>(<span class="ident">outpoint</span>.<span class="ident">clone</span>()))
+ } <span class="kw">else</span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">previous_tx</span>.<span class="ident">output</span>[<span class="ident">outpoint</span>.<span class="ident">vout</span> <span class="kw">as</span> <span class="ident">usize</span>].<span class="ident">clone</span>())
+ }
+ })
+ .<span class="ident">transpose</span>()
+ }
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">Database</span><span class="op">></span> <span class="ident">DatabaseUtils</span> <span class="kw">for</span> <span class="ident">T</span> {}
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">test</span> {
+ <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
+
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">deserialize</span>;
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="kw-2">*</span>;
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="kw-2">*</span>;
+
+ <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test_script_pubkey</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">tree</span>: <span class="ident">D</span>) {
+ <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="ident">Script</span>::<span class="ident">from</span>(
+ <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"76a91402306a7c23f3e8010de41e9e591348bb83f11daa88ac"</span>).<span class="ident">unwrap</span>(),
+ );
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="number">42</span>;
+ <span class="kw">let</span> <span class="ident">script_type</span> <span class="op">=</span> <span class="ident">ScriptType</span>::<span class="ident">External</span>;
+
+ <span class="ident">tree</span>.<span class="ident">set_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">script</span>, <span class="ident">script_type</span>, <span class="ident">path</span>).<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tree</span>.<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">script_type</span>, <span class="ident">path</span>).<span class="ident">unwrap</span>(),
+ <span class="prelude-val">Some</span>(<span class="ident">script</span>.<span class="ident">clone</span>())
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tree</span>.<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">script</span>).<span class="ident">unwrap</span>(),
+ <span class="prelude-val">Some</span>((<span class="ident">script_type</span>, <span class="ident">path</span>.<span class="ident">clone</span>()))
+ );
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test_batch_script_pubkey</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">tree</span>: <span class="ident">D</span>) {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">tree</span>.<span class="ident">begin_batch</span>();
+
+ <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="ident">Script</span>::<span class="ident">from</span>(
+ <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"76a91402306a7c23f3e8010de41e9e591348bb83f11daa88ac"</span>).<span class="ident">unwrap</span>(),
+ );
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="number">42</span>;
+ <span class="kw">let</span> <span class="ident">script_type</span> <span class="op">=</span> <span class="ident">ScriptType</span>::<span class="ident">External</span>;
+
+ <span class="ident">batch</span>.<span class="ident">set_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">script</span>, <span class="ident">script_type</span>, <span class="ident">path</span>).<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tree</span>.<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">script_type</span>, <span class="ident">path</span>).<span class="ident">unwrap</span>(),
+ <span class="prelude-val">None</span>
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tree</span>.<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">script</span>).<span class="ident">unwrap</span>(), <span class="prelude-val">None</span>);
+
+ <span class="ident">tree</span>.<span class="ident">commit_batch</span>(<span class="ident">batch</span>).<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tree</span>.<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">script_type</span>, <span class="ident">path</span>).<span class="ident">unwrap</span>(),
+ <span class="prelude-val">Some</span>(<span class="ident">script</span>.<span class="ident">clone</span>())
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tree</span>.<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">script</span>).<span class="ident">unwrap</span>(),
+ <span class="prelude-val">Some</span>((<span class="ident">script_type</span>, <span class="ident">path</span>.<span class="ident">clone</span>()))
+ );
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test_iter_script_pubkey</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">tree</span>: <span class="ident">D</span>) {
+ <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="ident">Script</span>::<span class="ident">from</span>(
+ <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"76a91402306a7c23f3e8010de41e9e591348bb83f11daa88ac"</span>).<span class="ident">unwrap</span>(),
+ );
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="number">42</span>;
+ <span class="kw">let</span> <span class="ident">script_type</span> <span class="op">=</span> <span class="ident">ScriptType</span>::<span class="ident">External</span>;
+
+ <span class="ident">tree</span>.<span class="ident">set_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">script</span>, <span class="ident">script_type</span>, <span class="ident">path</span>).<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tree</span>.<span class="ident">iter_script_pubkeys</span>(<span class="prelude-val">None</span>).<span class="ident">unwrap</span>().<span class="ident">len</span>(), <span class="number">1</span>);
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test_del_script_pubkey</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">tree</span>: <span class="ident">D</span>) {
+ <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="ident">Script</span>::<span class="ident">from</span>(
+ <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"76a91402306a7c23f3e8010de41e9e591348bb83f11daa88ac"</span>).<span class="ident">unwrap</span>(),
+ );
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="number">42</span>;
+ <span class="kw">let</span> <span class="ident">script_type</span> <span class="op">=</span> <span class="ident">ScriptType</span>::<span class="ident">External</span>;
+
+ <span class="ident">tree</span>.<span class="ident">set_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">script</span>, <span class="ident">script_type</span>, <span class="ident">path</span>).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tree</span>.<span class="ident">iter_script_pubkeys</span>(<span class="prelude-val">None</span>).<span class="ident">unwrap</span>().<span class="ident">len</span>(), <span class="number">1</span>);
+
+ <span class="ident">tree</span>.<span class="ident">del_script_pubkey_from_path</span>(<span class="ident">script_type</span>, <span class="ident">path</span>).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tree</span>.<span class="ident">iter_script_pubkeys</span>(<span class="prelude-val">None</span>).<span class="ident">unwrap</span>().<span class="ident">len</span>(), <span class="number">0</span>);
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test_utxo</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">tree</span>: <span class="ident">D</span>) {
+ <span class="kw">let</span> <span class="ident">outpoint</span> <span class="op">=</span> <span class="ident">OutPoint</span>::<span class="ident">from_str</span>(
+ <span class="string">"5df6e0e2761359d30a8275058e299fcc0381534545f55cf43e41983f5d4c9456:0"</span>,
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="ident">Script</span>::<span class="ident">from</span>(
+ <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"76a91402306a7c23f3e8010de41e9e591348bb83f11daa88ac"</span>).<span class="ident">unwrap</span>(),
+ );
+ <span class="kw">let</span> <span class="ident">txout</span> <span class="op">=</span> <span class="ident">TxOut</span> {
+ <span class="ident">value</span>: <span class="number">133742</span>,
+ <span class="ident">script_pubkey</span>: <span class="ident">script</span>,
+ };
+ <span class="kw">let</span> <span class="ident">utxo</span> <span class="op">=</span> <span class="ident">UTXO</span> {
+ <span class="ident">txout</span>,
+ <span class="ident">outpoint</span>,
+ <span class="ident">is_internal</span>: <span class="bool-val">false</span>,
+ };
+
+ <span class="ident">tree</span>.<span class="ident">set_utxo</span>(<span class="kw-2">&</span><span class="ident">utxo</span>).<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tree</span>.<span class="ident">get_utxo</span>(<span class="kw-2">&</span><span class="ident">outpoint</span>).<span class="ident">unwrap</span>(), <span class="prelude-val">Some</span>(<span class="ident">utxo</span>));
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test_raw_tx</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">tree</span>: <span class="ident">D</span>) {
+ <span class="kw">let</span> <span class="ident">hex_tx</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"0100000001a15d57094aa7a21a28cb20b59aab8fc7d1149a3bdbcddba9c622e4f5f6a99ece010000006c493046022100f93bb0e7d8db7bd46e40132d1f8242026e045f03a0efe71bbb8e3f475e970d790221009337cd7f1f929f00cc6ff01f03729b069a7c21b59b1736ddfee5db5946c5da8c0121033b9b137ee87d5a812d6f506efdd37f0affa7ffc310711c06c7f3e097c9447c52ffffffff0100e1f505000000001976a9140389035a9225b3839e2bbf32d826a1e222031fd888ac00000000"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">tx</span>: <span class="ident">Transaction</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">hex_tx</span>).<span class="ident">unwrap</span>();
+
+ <span class="ident">tree</span>.<span class="ident">set_raw_tx</span>(<span class="kw-2">&</span><span class="ident">tx</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tree</span>.<span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="ident">txid</span>).<span class="ident">unwrap</span>(), <span class="prelude-val">Some</span>(<span class="ident">tx</span>));
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test_tx</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">tree</span>: <span class="ident">D</span>) {
+ <span class="kw">let</span> <span class="ident">hex_tx</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"0100000001a15d57094aa7a21a28cb20b59aab8fc7d1149a3bdbcddba9c622e4f5f6a99ece010000006c493046022100f93bb0e7d8db7bd46e40132d1f8242026e045f03a0efe71bbb8e3f475e970d790221009337cd7f1f929f00cc6ff01f03729b069a7c21b59b1736ddfee5db5946c5da8c0121033b9b137ee87d5a812d6f506efdd37f0affa7ffc310711c06c7f3e097c9447c52ffffffff0100e1f505000000001976a9140389035a9225b3839e2bbf32d826a1e222031fd888ac00000000"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">tx</span>: <span class="ident">Transaction</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">hex_tx</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx_details</span> <span class="op">=</span> <span class="ident">TransactionDetails</span> {
+ <span class="ident">transaction</span>: <span class="prelude-val">Some</span>(<span class="ident">tx</span>),
+ <span class="ident">txid</span>,
+ <span class="ident">timestamp</span>: <span class="number">123456</span>,
+ <span class="ident">received</span>: <span class="number">1337</span>,
+ <span class="ident">sent</span>: <span class="number">420420</span>,
+ <span class="ident">fees</span>: <span class="number">140</span>,
+ <span class="ident">height</span>: <span class="prelude-val">Some</span>(<span class="number">1000</span>),
+ };
+
+ <span class="ident">tree</span>.<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">tx_details</span>).<span class="ident">unwrap</span>();
+
+ <span class="comment">// get with raw tx too</span>
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tree</span>.<span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="ident">tx_details</span>.<span class="ident">txid</span>, <span class="bool-val">true</span>).<span class="ident">unwrap</span>(),
+ <span class="prelude-val">Some</span>(<span class="ident">tx_details</span>.<span class="ident">clone</span>())
+ );
+ <span class="comment">// get only raw_tx</span>
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tree</span>.<span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="ident">tx_details</span>.<span class="ident">txid</span>).<span class="ident">unwrap</span>(),
+ <span class="ident">tx_details</span>.<span class="ident">transaction</span>
+ );
+
+ <span class="comment">// now get without raw_tx</span>
+ <span class="ident">tx_details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">None</span>;
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tree</span>.<span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="ident">tx_details</span>.<span class="ident">txid</span>, <span class="bool-val">false</span>).<span class="ident">unwrap</span>(),
+ <span class="prelude-val">Some</span>(<span class="ident">tx_details</span>)
+ );
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test_last_index</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">tree</span>: <span class="ident">D</span>) {
+ <span class="ident">tree</span>.<span class="ident">set_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="number">1337</span>).<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tree</span>.<span class="ident">get_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>).<span class="ident">unwrap</span>(),
+ <span class="prelude-val">Some</span>(<span class="number">1337</span>)
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tree</span>.<span class="ident">get_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>).<span class="ident">unwrap</span>(), <span class="prelude-val">None</span>);
+
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="ident">tree</span>.<span class="ident">increment_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">res</span>, <span class="number">1338</span>);
+ <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="ident">tree</span>.<span class="ident">increment_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">res</span>, <span class="number">0</span>);
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tree</span>.<span class="ident">get_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>).<span class="ident">unwrap</span>(),
+ <span class="prelude-val">Some</span>(<span class="number">1338</span>)
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tree</span>.<span class="ident">get_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>).<span class="ident">unwrap</span>(), <span class="prelude-val">Some</span>(<span class="number">0</span>));
+ }
+
+ <span class="comment">// TODO: more tests...</span>
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/descriptor/checksum.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>checksum.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10">10</span>
+<span id="11">11</span>
+<span id="12">12</span>
+<span id="13">13</span>
+<span id="14">14</span>
+<span id="15">15</span>
+<span id="16">16</span>
+<span id="17">17</span>
+<span id="18">18</span>
+<span id="19">19</span>
+<span id="20">20</span>
+<span id="21">21</span>
+<span id="22">22</span>
+<span id="23">23</span>
+<span id="24">24</span>
+<span id="25">25</span>
+<span id="26">26</span>
+<span id="27">27</span>
+<span id="28">28</span>
+<span id="29">29</span>
+<span id="30">30</span>
+<span id="31">31</span>
+<span id="32">32</span>
+<span id="33">33</span>
+<span id="34">34</span>
+<span id="35">35</span>
+<span id="36">36</span>
+<span id="37">37</span>
+<span id="38">38</span>
+<span id="39">39</span>
+<span id="40">40</span>
+<span id="41">41</span>
+<span id="42">42</span>
+<span id="43">43</span>
+<span id="44">44</span>
+<span id="45">45</span>
+<span id="46">46</span>
+<span id="47">47</span>
+<span id="48">48</span>
+<span id="49">49</span>
+<span id="50">50</span>
+<span id="51">51</span>
+<span id="52">52</span>
+<span id="53">53</span>
+<span id="54">54</span>
+<span id="55">55</span>
+<span id="56">56</span>
+<span id="57">57</span>
+<span id="58">58</span>
+<span id="59">59</span>
+<span id="60">60</span>
+<span id="61">61</span>
+<span id="62">62</span>
+<span id="63">63</span>
+<span id="64">64</span>
+<span id="65">65</span>
+<span id="66">66</span>
+<span id="67">67</span>
+<span id="68">68</span>
+<span id="69">69</span>
+<span id="70">70</span>
+<span id="71">71</span>
+<span id="72">72</span>
+<span id="73">73</span>
+<span id="74">74</span>
+<span id="75">75</span>
+<span id="76">76</span>
+<span id="77">77</span>
+<span id="78">78</span>
+<span id="79">79</span>
+<span id="80">80</span>
+<span id="81">81</span>
+<span id="82">82</span>
+<span id="83">83</span>
+<span id="84">84</span>
+<span id="85">85</span>
+<span id="86">86</span>
+<span id="87">87</span>
+<span id="88">88</span>
+<span id="89">89</span>
+<span id="90">90</span>
+<span id="91">91</span>
+<span id="92">92</span>
+<span id="93">93</span>
+<span id="94">94</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="doccomment">//! Descriptor checksum</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! This module contains a re-implementation of the function used by Bitcoin Core to calculate the</span>
+<span class="doccomment">//! checksum of a descriptor</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">iter</span>::<span class="ident">FromIterator</span>;
+
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">Error</span>;
+
+<span class="kw">const</span> <span class="ident">INPUT_CHARSET</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"0123456789()[],'/*abcdefgh@:$%{}IJKLMNOPQRSTUVWXYZ&+-.;<=>?!^_|~ijklmnopqrstuvwxyzABCDEFGH`#\"\\ "</span>;
+<span class="kw">const</span> <span class="ident">CHECKSUM_CHARSET</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"qpzry9x8gf2tvdw0s3jn54khce6mua7l"</span>;
+
+<span class="kw">fn</span> <span class="ident">poly_mod</span>(<span class="kw-2">mut</span> <span class="ident">c</span>: <span class="ident">u64</span>, <span class="ident">val</span>: <span class="ident">u64</span>) <span class="op">-</span><span class="op">></span> <span class="ident">u64</span> {
+ <span class="kw">let</span> <span class="ident">c0</span> <span class="op">=</span> <span class="ident">c</span> <span class="op">></span><span class="op">></span> <span class="number">35</span>;
+ <span class="ident">c</span> <span class="op">=</span> ((<span class="ident">c</span> <span class="op">&</span> <span class="number">0x7ffffffff</span>) <span class="op"><</span><span class="op"><</span> <span class="number">5</span>) <span class="op">^</span> <span class="ident">val</span>;
+ <span class="kw">if</span> <span class="ident">c0</span> <span class="op">&</span> <span class="number">1</span> <span class="op">></span> <span class="number">0</span> {
+ <span class="ident">c</span> <span class="op">^</span><span class="op">=</span> <span class="number">0xf5dee51989</span>
+ };
+ <span class="kw">if</span> <span class="ident">c0</span> <span class="op">&</span> <span class="number">2</span> <span class="op">></span> <span class="number">0</span> {
+ <span class="ident">c</span> <span class="op">^</span><span class="op">=</span> <span class="number">0xa9fdca3312</span>
+ };
+ <span class="kw">if</span> <span class="ident">c0</span> <span class="op">&</span> <span class="number">4</span> <span class="op">></span> <span class="number">0</span> {
+ <span class="ident">c</span> <span class="op">^</span><span class="op">=</span> <span class="number">0x1bab10e32d</span>
+ };
+ <span class="kw">if</span> <span class="ident">c0</span> <span class="op">&</span> <span class="number">8</span> <span class="op">></span> <span class="number">0</span> {
+ <span class="ident">c</span> <span class="op">^</span><span class="op">=</span> <span class="number">0x3706b1677a</span>
+ };
+ <span class="kw">if</span> <span class="ident">c0</span> <span class="op">&</span> <span class="number">16</span> <span class="op">></span> <span class="number">0</span> {
+ <span class="ident">c</span> <span class="op">^</span><span class="op">=</span> <span class="number">0x644d626ffd</span>
+ };
+
+ <span class="ident">c</span>
+}
+
+<span class="doccomment">/// Compute the checksum of a descriptor</span>
+<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_checksum</span>(<span class="ident">desc</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">c</span> <span class="op">=</span> <span class="number">1</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cls</span> <span class="op">=</span> <span class="number">0</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">clscount</span> <span class="op">=</span> <span class="number">0</span>;
+ <span class="kw">for</span> <span class="ident">ch</span> <span class="kw">in</span> <span class="ident">desc</span>.<span class="ident">chars</span>() {
+ <span class="kw">let</span> <span class="ident">pos</span> <span class="op">=</span> <span class="ident">INPUT_CHARSET</span>
+ .<span class="ident">find</span>(<span class="ident">ch</span>)
+ .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">InvalidDescriptorCharacter</span>(<span class="ident">ch</span>))<span class="question-mark">?</span> <span class="kw">as</span> <span class="ident">u64</span>;
+ <span class="ident">c</span> <span class="op">=</span> <span class="ident">poly_mod</span>(<span class="ident">c</span>, <span class="ident">pos</span> <span class="op">&</span> <span class="number">31</span>);
+ <span class="ident">cls</span> <span class="op">=</span> <span class="ident">cls</span> <span class="op">*</span> <span class="number">3</span> <span class="op">+</span> (<span class="ident">pos</span> <span class="op">></span><span class="op">></span> <span class="number">5</span>);
+ <span class="ident">clscount</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
+ <span class="kw">if</span> <span class="ident">clscount</span> <span class="op">=</span><span class="op">=</span> <span class="number">3</span> {
+ <span class="ident">c</span> <span class="op">=</span> <span class="ident">poly_mod</span>(<span class="ident">c</span>, <span class="ident">cls</span>);
+ <span class="ident">cls</span> <span class="op">=</span> <span class="number">0</span>;
+ <span class="ident">clscount</span> <span class="op">=</span> <span class="number">0</span>;
+ }
+ }
+ <span class="kw">if</span> <span class="ident">clscount</span> <span class="op">></span> <span class="number">0</span> {
+ <span class="ident">c</span> <span class="op">=</span> <span class="ident">poly_mod</span>(<span class="ident">c</span>, <span class="ident">cls</span>);
+ }
+ (<span class="number">0</span>..<span class="number">8</span>).<span class="ident">for_each</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">c</span> <span class="op">=</span> <span class="ident">poly_mod</span>(<span class="ident">c</span>, <span class="number">0</span>));
+ <span class="ident">c</span> <span class="op">^</span><span class="op">=</span> <span class="number">1</span>;
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">chars</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="number">8</span>);
+ <span class="kw">for</span> <span class="ident">j</span> <span class="kw">in</span> <span class="number">0</span>..<span class="number">8</span> {
+ <span class="ident">chars</span>.<span class="ident">push</span>(
+ <span class="ident">CHECKSUM_CHARSET</span>
+ .<span class="ident">chars</span>()
+ .<span class="ident">nth</span>(((<span class="ident">c</span> <span class="op">></span><span class="op">></span> (<span class="number">5</span> <span class="op">*</span> (<span class="number">7</span> <span class="op">-</span> <span class="ident">j</span>))) <span class="op">&</span> <span class="number">31</span>) <span class="kw">as</span> <span class="ident">usize</span>)
+ .<span class="ident">unwrap</span>(),
+ );
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">String</span>::<span class="ident">from_iter</span>(<span class="ident">chars</span>))
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/descriptor/error.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>error.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10">10</span>
+<span id="11">11</span>
+<span id="12">12</span>
+<span id="13">13</span>
+<span id="14">14</span>
+<span id="15">15</span>
+<span id="16">16</span>
+<span id="17">17</span>
+<span id="18">18</span>
+<span id="19">19</span>
+<span id="20">20</span>
+<span id="21">21</span>
+<span id="22">22</span>
+<span id="23">23</span>
+<span id="24">24</span>
+<span id="25">25</span>
+<span id="26">26</span>
+<span id="27">27</span>
+<span id="28">28</span>
+<span id="29">29</span>
+<span id="30">30</span>
+<span id="31">31</span>
+<span id="32">32</span>
+<span id="33">33</span>
+<span id="34">34</span>
+<span id="35">35</span>
+<span id="36">36</span>
+<span id="37">37</span>
+<span id="38">38</span>
+<span id="39">39</span>
+<span id="40">40</span>
+<span id="41">41</span>
+<span id="42">42</span>
+<span id="43">43</span>
+<span id="44">44</span>
+<span id="45">45</span>
+<span id="46">46</span>
+<span id="47">47</span>
+<span id="48">48</span>
+<span id="49">49</span>
+<span id="50">50</span>
+<span id="51">51</span>
+<span id="52">52</span>
+<span id="53">53</span>
+<span id="54">54</span>
+<span id="55">55</span>
+<span id="56">56</span>
+<span id="57">57</span>
+<span id="58">58</span>
+<span id="59">59</span>
+<span id="60">60</span>
+<span id="61">61</span>
+<span id="62">62</span>
+<span id="63">63</span>
+<span id="64">64</span>
+<span id="65">65</span>
+<span id="66">66</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="doccomment">//! Descriptor errors</span>
+
+<span class="doccomment">/// Errors related to the parsing and usage of descriptors</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">Error</span> {
+ <span class="ident">InternalError</span>,
+ <span class="ident">InvalidPrefix</span>(<span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>),
+ <span class="ident">HardenedDerivationOnXpub</span>,
+ <span class="ident">MalformedInput</span>,
+ <span class="ident">KeyParsingError</span>(<span class="ident">String</span>),
+
+ <span class="ident">Policy</span>(<span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">policy</span>::<span class="ident">PolicyError</span>),
+
+ <span class="ident">InputIndexDoesntExist</span>,
+ <span class="ident">MissingPublicKey</span>,
+ <span class="ident">MissingDetails</span>,
+
+ <span class="ident">InvalidDescriptorCharacter</span>(<span class="ident">char</span>),
+
+ <span class="ident">CantDeriveWithMiniscript</span>,
+
+ <span class="ident">BIP32</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">Error</span>),
+ <span class="ident">Base58</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">base58</span>::<span class="ident">Error</span>),
+ <span class="ident">PK</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">key</span>::<span class="ident">Error</span>),
+ <span class="ident">Miniscript</span>(<span class="ident">miniscript</span>::<span class="ident">Error</span>),
+ <span class="ident">Hex</span>(<span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">Error</span>),
+}
+
+<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">Error</span> {
+ <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">std</span>::<span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">std</span>::<span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
+ <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"{:?}"</span>, <span class="self">self</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span> <span class="kw">for</span> <span class="ident">Error</span> {}
+
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">Error</span>, <span class="ident">BIP32</span>);
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">base58</span>::<span class="ident">Error</span>, <span class="ident">Base58</span>);
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">key</span>::<span class="ident">Error</span>, <span class="ident">PK</span>);
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">miniscript</span>::<span class="ident">Error</span>, <span class="ident">Miniscript</span>);
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">Error</span>, <span class="ident">Hex</span>);
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">policy</span>::<span class="ident">PolicyError</span>, <span class="ident">Policy</span>);
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/descriptor/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+<span id="163">163</span>
+<span id="164">164</span>
+<span id="165">165</span>
+<span id="166">166</span>
+<span id="167">167</span>
+<span id="168">168</span>
+<span id="169">169</span>
+<span id="170">170</span>
+<span id="171">171</span>
+<span id="172">172</span>
+<span id="173">173</span>
+<span id="174">174</span>
+<span id="175">175</span>
+<span id="176">176</span>
+<span id="177">177</span>
+<span id="178">178</span>
+<span id="179">179</span>
+<span id="180">180</span>
+<span id="181">181</span>
+<span id="182">182</span>
+<span id="183">183</span>
+<span id="184">184</span>
+<span id="185">185</span>
+<span id="186">186</span>
+<span id="187">187</span>
+<span id="188">188</span>
+<span id="189">189</span>
+<span id="190">190</span>
+<span id="191">191</span>
+<span id="192">192</span>
+<span id="193">193</span>
+<span id="194">194</span>
+<span id="195">195</span>
+<span id="196">196</span>
+<span id="197">197</span>
+<span id="198">198</span>
+<span id="199">199</span>
+<span id="200">200</span>
+<span id="201">201</span>
+<span id="202">202</span>
+<span id="203">203</span>
+<span id="204">204</span>
+<span id="205">205</span>
+<span id="206">206</span>
+<span id="207">207</span>
+<span id="208">208</span>
+<span id="209">209</span>
+<span id="210">210</span>
+<span id="211">211</span>
+<span id="212">212</span>
+<span id="213">213</span>
+<span id="214">214</span>
+<span id="215">215</span>
+<span id="216">216</span>
+<span id="217">217</span>
+<span id="218">218</span>
+<span id="219">219</span>
+<span id="220">220</span>
+<span id="221">221</span>
+<span id="222">222</span>
+<span id="223">223</span>
+<span id="224">224</span>
+<span id="225">225</span>
+<span id="226">226</span>
+<span id="227">227</span>
+<span id="228">228</span>
+<span id="229">229</span>
+<span id="230">230</span>
+<span id="231">231</span>
+<span id="232">232</span>
+<span id="233">233</span>
+<span id="234">234</span>
+<span id="235">235</span>
+<span id="236">236</span>
+<span id="237">237</span>
+<span id="238">238</span>
+<span id="239">239</span>
+<span id="240">240</span>
+<span id="241">241</span>
+<span id="242">242</span>
+<span id="243">243</span>
+<span id="244">244</span>
+<span id="245">245</span>
+<span id="246">246</span>
+<span id="247">247</span>
+<span id="248">248</span>
+<span id="249">249</span>
+<span id="250">250</span>
+<span id="251">251</span>
+<span id="252">252</span>
+<span id="253">253</span>
+<span id="254">254</span>
+<span id="255">255</span>
+<span id="256">256</span>
+<span id="257">257</span>
+<span id="258">258</span>
+<span id="259">259</span>
+<span id="260">260</span>
+<span id="261">261</span>
+<span id="262">262</span>
+<span id="263">263</span>
+<span id="264">264</span>
+<span id="265">265</span>
+<span id="266">266</span>
+<span id="267">267</span>
+<span id="268">268</span>
+<span id="269">269</span>
+<span id="270">270</span>
+<span id="271">271</span>
+<span id="272">272</span>
+<span id="273">273</span>
+<span id="274">274</span>
+<span id="275">275</span>
+<span id="276">276</span>
+<span id="277">277</span>
+<span id="278">278</span>
+<span id="279">279</span>
+<span id="280">280</span>
+<span id="281">281</span>
+<span id="282">282</span>
+<span id="283">283</span>
+<span id="284">284</span>
+<span id="285">285</span>
+<span id="286">286</span>
+<span id="287">287</span>
+<span id="288">288</span>
+<span id="289">289</span>
+<span id="290">290</span>
+<span id="291">291</span>
+<span id="292">292</span>
+<span id="293">293</span>
+<span id="294">294</span>
+<span id="295">295</span>
+<span id="296">296</span>
+<span id="297">297</span>
+<span id="298">298</span>
+<span id="299">299</span>
+<span id="300">300</span>
+<span id="301">301</span>
+<span id="302">302</span>
+<span id="303">303</span>
+<span id="304">304</span>
+<span id="305">305</span>
+<span id="306">306</span>
+<span id="307">307</span>
+<span id="308">308</span>
+<span id="309">309</span>
+<span id="310">310</span>
+<span id="311">311</span>
+<span id="312">312</span>
+<span id="313">313</span>
+<span id="314">314</span>
+<span id="315">315</span>
+<span id="316">316</span>
+<span id="317">317</span>
+<span id="318">318</span>
+<span id="319">319</span>
+<span id="320">320</span>
+<span id="321">321</span>
+<span id="322">322</span>
+<span id="323">323</span>
+<span id="324">324</span>
+<span id="325">325</span>
+<span id="326">326</span>
+<span id="327">327</span>
+<span id="328">328</span>
+<span id="329">329</span>
+<span id="330">330</span>
+<span id="331">331</span>
+<span id="332">332</span>
+<span id="333">333</span>
+<span id="334">334</span>
+<span id="335">335</span>
+<span id="336">336</span>
+<span id="337">337</span>
+<span id="338">338</span>
+<span id="339">339</span>
+<span id="340">340</span>
+<span id="341">341</span>
+<span id="342">342</span>
+<span id="343">343</span>
+<span id="344">344</span>
+<span id="345">345</span>
+<span id="346">346</span>
+<span id="347">347</span>
+<span id="348">348</span>
+<span id="349">349</span>
+<span id="350">350</span>
+<span id="351">351</span>
+<span id="352">352</span>
+<span id="353">353</span>
+<span id="354">354</span>
+<span id="355">355</span>
+<span id="356">356</span>
+<span id="357">357</span>
+<span id="358">358</span>
+<span id="359">359</span>
+<span id="360">360</span>
+<span id="361">361</span>
+<span id="362">362</span>
+<span id="363">363</span>
+<span id="364">364</span>
+<span id="365">365</span>
+<span id="366">366</span>
+<span id="367">367</span>
+<span id="368">368</span>
+<span id="369">369</span>
+<span id="370">370</span>
+<span id="371">371</span>
+<span id="372">372</span>
+<span id="373">373</span>
+<span id="374">374</span>
+<span id="375">375</span>
+<span id="376">376</span>
+<span id="377">377</span>
+<span id="378">378</span>
+<span id="379">379</span>
+<span id="380">380</span>
+<span id="381">381</span>
+<span id="382">382</span>
+<span id="383">383</span>
+<span id="384">384</span>
+<span id="385">385</span>
+<span id="386">386</span>
+<span id="387">387</span>
+<span id="388">388</span>
+<span id="389">389</span>
+<span id="390">390</span>
+<span id="391">391</span>
+<span id="392">392</span>
+<span id="393">393</span>
+<span id="394">394</span>
+<span id="395">395</span>
+<span id="396">396</span>
+<span id="397">397</span>
+<span id="398">398</span>
+<span id="399">399</span>
+<span id="400">400</span>
+<span id="401">401</span>
+<span id="402">402</span>
+<span id="403">403</span>
+<span id="404">404</span>
+<span id="405">405</span>
+<span id="406">406</span>
+<span id="407">407</span>
+<span id="408">408</span>
+<span id="409">409</span>
+<span id="410">410</span>
+<span id="411">411</span>
+<span id="412">412</span>
+<span id="413">413</span>
+<span id="414">414</span>
+<span id="415">415</span>
+<span id="416">416</span>
+<span id="417">417</span>
+<span id="418">418</span>
+<span id="419">419</span>
+<span id="420">420</span>
+<span id="421">421</span>
+<span id="422">422</span>
+<span id="423">423</span>
+<span id="424">424</span>
+<span id="425">425</span>
+<span id="426">426</span>
+<span id="427">427</span>
+<span id="428">428</span>
+<span id="429">429</span>
+<span id="430">430</span>
+<span id="431">431</span>
+<span id="432">432</span>
+<span id="433">433</span>
+<span id="434">434</span>
+<span id="435">435</span>
+<span id="436">436</span>
+<span id="437">437</span>
+<span id="438">438</span>
+<span id="439">439</span>
+<span id="440">440</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="doccomment">//! Descriptors</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! This module contains generic utilities to work with descriptors, plus some re-exported types</span>
+<span class="doccomment">//! from [`miniscript`].</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::{<span class="ident">BTreeMap</span>, <span class="ident">HashMap</span>};
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>;
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hash160</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">secp256k1</span>::<span class="ident">Secp256k1</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::{<span class="ident">ChildNumber</span>, <span class="ident">DerivationPath</span>, <span class="ident">Fingerprint</span>};
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">psbt</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">PublicKey</span>, <span class="ident">Script</span>, <span class="ident">TxOut</span>};
+
+<span class="kw">use</span> <span class="ident">miniscript</span>::<span class="ident">descriptor</span>::{<span class="ident">DescriptorPublicKey</span>, <span class="ident">DescriptorXKey</span>, <span class="ident">InnerXKey</span>};
+<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">miniscript</span>::{
+ <span class="ident">Descriptor</span>, <span class="ident">Legacy</span>, <span class="ident">Miniscript</span>, <span class="ident">MiniscriptKey</span>, <span class="ident">ScriptContext</span>, <span class="ident">Segwitv0</span>, <span class="ident">Terminal</span>, <span class="ident">ToPublicKey</span>,
+};
+
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">checksum</span>;
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">error</span>;
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">policy</span>;
+
+<span class="kw">pub</span> <span class="kw">use</span> <span class="self">self</span>::<span class="ident">checksum</span>::<span class="ident">get_checksum</span>;
+<span class="kw">use</span> <span class="self">self</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
+<span class="kw">pub</span> <span class="kw">use</span> <span class="self">self</span>::<span class="ident">policy</span>::<span class="ident">Policy</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">signer</span>::<span class="ident">SignersContainer</span>;
+
+<span class="doccomment">/// Alias for a [`Descriptor`] that can contain extended keys using [`DescriptorPublicKey`]</span>
+<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">ExtendedDescriptor</span> <span class="op">=</span> <span class="ident">Descriptor</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span>;
+
+<span class="doccomment">/// Alias for the type of maps that represent derivation paths in a [`psbt::Input`] or</span>
+<span class="doccomment">/// [`psbt::Output`]</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// [`psbt::Input`]: bitcoin::util::psbt::Input</span>
+<span class="doccomment">/// [`psbt::Output`]: bitcoin::util::psbt::Output</span>
+<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">HDKeyPaths</span> <span class="op">=</span> <span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">PublicKey</span>, (<span class="ident">Fingerprint</span>, <span class="ident">DerivationPath</span>)<span class="op">></span>;
+
+<span class="doccomment">/// Trait implemented on [`Descriptor`]s to add a method to extract the spending [`policy`]</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">ExtractPolicy</span> {
+ <span class="kw">fn</span> <span class="ident">extract_policy</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">signers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+}
+
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">trait</span> <span class="ident">XKeyUtils</span> {
+ <span class="kw">fn</span> <span class="ident">full_path</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">append</span>: <span class="kw-2">&</span>[<span class="ident">ChildNumber</span>]) <span class="op">-</span><span class="op">></span> <span class="ident">DerivationPath</span>;
+ <span class="kw">fn</span> <span class="ident">root_fingerprint</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Fingerprint</span>;
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">InnerXKey</span><span class="op">></span> <span class="ident">XKeyUtils</span> <span class="kw">for</span> <span class="ident">DescriptorXKey</span><span class="op"><</span><span class="ident">K</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">full_path</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">append</span>: <span class="kw-2">&</span>[<span class="ident">ChildNumber</span>]) <span class="op">-</span><span class="op">></span> <span class="ident">DerivationPath</span> {
+ <span class="kw">let</span> <span class="ident">full_path</span> <span class="op">=</span> <span class="kw">match</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">source</span> {
+ <span class="kw-2">&</span><span class="prelude-val">Some</span>((<span class="kw">_</span>, <span class="kw-2">ref</span> <span class="ident">path</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">path</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">chain</span>(<span class="self">self</span>.<span class="ident">derivation_path</span>.<span class="ident">into_iter</span>())
+ .<span class="ident">cloned</span>()
+ .<span class="ident">collect</span>(),
+ <span class="kw-2">&</span><span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="self">self</span>.<span class="ident">derivation_path</span>.<span class="ident">clone</span>(),
+ };
+
+ <span class="kw">if</span> <span class="self">self</span>.<span class="ident">is_wildcard</span> {
+ <span class="ident">full_path</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">chain</span>(<span class="ident">append</span>.<span class="ident">into_iter</span>())
+ .<span class="ident">cloned</span>()
+ .<span class="ident">collect</span>()
+ } <span class="kw">else</span> {
+ <span class="ident">full_path</span>
+ }
+ }
+
+ <span class="kw">fn</span> <span class="ident">root_fingerprint</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Fingerprint</span> {
+ <span class="kw">match</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">source</span> {
+ <span class="kw-2">&</span><span class="prelude-val">Some</span>((<span class="ident">fingerprint</span>, <span class="kw">_</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">fingerprint</span>.<span class="ident">clone</span>(),
+ <span class="kw-2">&</span><span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="self">self</span>.<span class="ident">xkey</span>.<span class="ident">xkey_fingerprint</span>(),
+ }
+ }
+}
+
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">trait</span> <span class="ident">DescriptorMeta</span>: <span class="ident">Sized</span> {
+ <span class="kw">fn</span> <span class="ident">is_witness</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span>;
+ <span class="kw">fn</span> <span class="ident">get_hd_keypaths</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">index</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">HDKeyPaths</span>, <span class="ident">Error</span><span class="op">></span>;
+ <span class="kw">fn</span> <span class="ident">is_fixed</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span>;
+ <span class="kw">fn</span> <span class="ident">derive_from_hd_keypaths</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">hd_keypaths</span>: <span class="kw-2">&</span><span class="ident">HDKeyPaths</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="self">Self</span><span class="op">></span>;
+ <span class="kw">fn</span> <span class="ident">derive_from_psbt_input</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">psbt_input</span>: <span class="kw-2">&</span><span class="ident">psbt</span>::<span class="ident">Input</span>, <span class="ident">utxo</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TxOut</span><span class="op">></span>)
+ <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="self">Self</span><span class="op">></span>;
+}
+
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">trait</span> <span class="ident">DescriptorScripts</span> {
+ <span class="kw">fn</span> <span class="ident">psbt_redeem_script</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>;
+ <span class="kw">fn</span> <span class="ident">psbt_witness_script</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>;
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">T</span><span class="op">></span> <span class="ident">DescriptorScripts</span> <span class="kw">for</span> <span class="ident">Descriptor</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>
+<span class="kw">where</span>
+ <span class="ident">T</span>: <span class="ident">miniscript</span>::<span class="ident">MiniscriptKey</span> <span class="op">+</span> <span class="ident">miniscript</span>::<span class="ident">ToPublicKey</span>,
+{
+ <span class="kw">fn</span> <span class="ident">psbt_redeem_script</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span> {
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">Descriptor</span>::<span class="ident">ShWpkh</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">witness_script</span>()),
+ <span class="ident">Descriptor</span>::<span class="ident">ShWsh</span>(<span class="kw-2">ref</span> <span class="ident">script</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">script</span>.<span class="ident">encode</span>().<span class="ident">to_v0_p2wsh</span>()),
+ <span class="ident">Descriptor</span>::<span class="ident">Sh</span>(<span class="kw-2">ref</span> <span class="ident">script</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">script</span>.<span class="ident">encode</span>()),
+ <span class="ident">Descriptor</span>::<span class="ident">Bare</span>(<span class="kw-2">ref</span> <span class="ident">script</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">script</span>.<span class="ident">encode</span>()),
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
+ }
+ }
+
+ <span class="kw">fn</span> <span class="ident">psbt_witness_script</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span> {
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">Descriptor</span>::<span class="ident">Wsh</span>(<span class="kw-2">ref</span> <span class="ident">script</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">script</span>.<span class="ident">encode</span>()),
+ <span class="ident">Descriptor</span>::<span class="ident">ShWsh</span>(<span class="kw-2">ref</span> <span class="ident">script</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">script</span>.<span class="ident">encode</span>()),
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
+ }
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">DescriptorMeta</span> <span class="kw">for</span> <span class="ident">Descriptor</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">is_witness</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">Descriptor</span>::<span class="ident">Bare</span>(<span class="kw">_</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Pk</span>(<span class="kw">_</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Pkh</span>(<span class="kw">_</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Sh</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="bool-val">false</span>
+ }
+ <span class="ident">Descriptor</span>::<span class="ident">Wpkh</span>(<span class="kw">_</span>)
+ <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWpkh</span>(<span class="kw">_</span>)
+ <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Wsh</span>(<span class="kw">_</span>)
+ <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWsh</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="bool-val">true</span>,
+ }
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_hd_keypaths</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">index</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">HDKeyPaths</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">answer</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
+
+ <span class="kw">let</span> <span class="ident">translatefpk</span> <span class="op">=</span> <span class="op">|</span><span class="ident">key</span>: <span class="kw-2">&</span><span class="ident">DescriptorPublicKey</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">match</span> <span class="ident">key</span> {
+ <span class="ident">DescriptorPublicKey</span>::<span class="ident">PubKey</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> {}
+ <span class="ident">DescriptorPublicKey</span>::<span class="ident">XPub</span>(<span class="ident">xpub</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">derive_path</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">xpub</span>.<span class="ident">is_wildcard</span> {
+ <span class="ident">xpub</span>.<span class="ident">derivation_path</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">chain</span>([<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">index</span>)<span class="question-mark">?</span>].<span class="ident">iter</span>())
+ .<span class="ident">cloned</span>()
+ .<span class="ident">collect</span>()
+ } <span class="kw">else</span> {
+ <span class="ident">xpub</span>.<span class="ident">derivation_path</span>.<span class="ident">clone</span>()
+ };
+ <span class="kw">let</span> <span class="ident">derived_pubkey</span> <span class="op">=</span> <span class="ident">xpub</span>
+ .<span class="ident">xkey</span>
+ .<span class="ident">derive_pub</span>(<span class="kw-2">&</span><span class="ident">Secp256k1</span>::<span class="ident">verification_only</span>(), <span class="kw-2">&</span><span class="ident">derive_path</span>)<span class="question-mark">?</span>;
+
+ <span class="ident">answer</span>.<span class="ident">insert</span>(
+ <span class="ident">derived_pubkey</span>.<span class="ident">public_key</span>,
+ (
+ <span class="ident">xpub</span>.<span class="ident">root_fingerprint</span>(),
+ <span class="ident">xpub</span>.<span class="ident">full_path</span>(<span class="kw-2">&</span>[<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">index</span>)<span class="question-mark">?</span>]),
+ ),
+ );
+ }
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">DummyKey</span>::<span class="ident">default</span>())
+ };
+ <span class="kw">let</span> <span class="ident">translatefpkh</span> <span class="op">=</span> <span class="op">|</span><span class="kw">_</span>: <span class="kw-2">&</span><span class="ident">hash160</span>::<span class="ident">Hash</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> { <span class="prelude-val">Ok</span>(<span class="ident">DummyKey</span>::<span class="ident">default</span>()) };
+
+ <span class="self">self</span>.<span class="ident">translate_pk</span>(<span class="ident">translatefpk</span>, <span class="ident">translatefpkh</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">answer</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">is_fixed</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">found_wildcard</span> <span class="op">=</span> <span class="bool-val">false</span>;
+
+ <span class="kw">let</span> <span class="ident">translatefpk</span> <span class="op">=</span> <span class="op">|</span><span class="ident">key</span>: <span class="kw-2">&</span><span class="ident">DescriptorPublicKey</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">match</span> <span class="ident">key</span> {
+ <span class="ident">DescriptorPublicKey</span>::<span class="ident">PubKey</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> {}
+ <span class="ident">DescriptorPublicKey</span>::<span class="ident">XPub</span>(<span class="ident">xpub</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="ident">xpub</span>.<span class="ident">is_wildcard</span> {
+ <span class="ident">found_wildcard</span> <span class="op">=</span> <span class="bool-val">true</span>;
+ }
+ }
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">DummyKey</span>::<span class="ident">default</span>())
+ };
+ <span class="kw">let</span> <span class="ident">translatefpkh</span> <span class="op">=</span> <span class="op">|</span><span class="kw">_</span>: <span class="kw-2">&</span><span class="ident">hash160</span>::<span class="ident">Hash</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> { <span class="prelude-val">Ok</span>(<span class="ident">DummyKey</span>::<span class="ident">default</span>()) };
+
+ <span class="self">self</span>.<span class="ident">translate_pk</span>(<span class="ident">translatefpk</span>, <span class="ident">translatefpkh</span>).<span class="ident">unwrap</span>();
+
+ <span class="op">!</span><span class="ident">found_wildcard</span>
+ }
+
+ <span class="kw">fn</span> <span class="ident">derive_from_hd_keypaths</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">hd_keypaths</span>: <span class="kw-2">&</span><span class="ident">HDKeyPaths</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="self">Self</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">index</span>: <span class="ident">HashMap</span><span class="op"><</span><span class="kw">_</span>, <span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">hd_keypaths</span>.<span class="ident">values</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>();
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">derive_path</span> <span class="op">=</span> <span class="prelude-val">None</span>::<span class="op"><</span><span class="ident">DerivationPath</span><span class="op">></span>;
+ <span class="kw">let</span> <span class="ident">translatefpk</span> <span class="op">=</span> <span class="op">|</span><span class="ident">key</span>: <span class="kw-2">&</span><span class="ident">DescriptorPublicKey</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="ident">derive_path</span>.<span class="ident">is_some</span>() {
+ <span class="comment">// already found a matching path, we are done</span>
+ <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="ident">DummyKey</span>::<span class="ident">default</span>());
+ }
+
+ <span class="kw">if</span> <span class="kw">let</span> <span class="ident">DescriptorPublicKey</span>::<span class="ident">XPub</span>(<span class="ident">xpub</span>) <span class="op">=</span> <span class="ident">key</span> {
+ <span class="comment">// Check if the key matches one entry in our `index`. If it does, `matches()` will</span>
+ <span class="comment">// return the "prefix" that matched, so we remove that prefix from the full path</span>
+ <span class="comment">// found in `index` and save it in `derive_path`</span>
+ <span class="kw">let</span> <span class="ident">root_fingerprint</span> <span class="op">=</span> <span class="ident">xpub</span>.<span class="ident">root_fingerprint</span>();
+ <span class="ident">derive_path</span> <span class="op">=</span> <span class="ident">index</span>
+ .<span class="ident">get_key_value</span>(<span class="kw-2">&</span><span class="ident">root_fingerprint</span>)
+ .<span class="ident">and_then</span>(<span class="op">|</span>(<span class="ident">fingerprint</span>, <span class="ident">path</span>)<span class="op">|</span> <span class="ident">xpub</span>.<span class="ident">matches</span>(<span class="kw-2">*</span><span class="ident">fingerprint</span>, <span class="ident">path</span>))
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">prefix_path</span><span class="op">|</span> <span class="ident">prefix_path</span>.<span class="ident">into_iter</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span><span class="op">></span>())
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">prefix</span><span class="op">|</span> {
+ <span class="ident">index</span>
+ .<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">xpub</span>.<span class="ident">root_fingerprint</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">skip</span>(<span class="ident">prefix</span>.<span class="ident">len</span>())
+ .<span class="ident">cloned</span>()
+ .<span class="ident">collect</span>()
+ });
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">DummyKey</span>::<span class="ident">default</span>())
+ };
+ <span class="kw">let</span> <span class="ident">translatefpkh</span> <span class="op">=</span> <span class="op">|</span><span class="kw">_</span>: <span class="kw-2">&</span><span class="ident">hash160</span>::<span class="ident">Hash</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> { <span class="prelude-val">Ok</span>(<span class="ident">DummyKey</span>::<span class="ident">default</span>()) };
+
+ <span class="self">self</span>.<span class="ident">translate_pk</span>(<span class="ident">translatefpk</span>, <span class="ident">translatefpkh</span>).<span class="ident">unwrap</span>();
+
+ <span class="ident">derive_path</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">path</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">derive</span>(<span class="ident">path</span>.<span class="ident">as_ref</span>()))
+ }
+
+ <span class="kw">fn</span> <span class="ident">derive_from_psbt_input</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">psbt_input</span>: <span class="kw-2">&</span><span class="ident">psbt</span>::<span class="ident">Input</span>,
+ <span class="ident">utxo</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TxOut</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="self">Self</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">derived</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">derive_from_hd_keypaths</span>(<span class="kw-2">&</span><span class="ident">psbt_input</span>.<span class="ident">hd_keypaths</span>) {
+ <span class="kw">return</span> <span class="prelude-val">Some</span>(<span class="ident">derived</span>);
+ } <span class="kw">else</span> <span class="kw">if</span> <span class="op">!</span><span class="self">self</span>.<span class="ident">is_fixed</span>() {
+ <span class="comment">// If the descriptor is not fixed we can't brute-force the derivation address, so just</span>
+ <span class="comment">// exit here</span>
+ <span class="kw">return</span> <span class="prelude-val">None</span>;
+ }
+
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">Descriptor</span>::<span class="ident">Pk</span>(<span class="kw">_</span>)
+ <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Pkh</span>(<span class="kw">_</span>)
+ <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Wpkh</span>(<span class="kw">_</span>)
+ <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWpkh</span>(<span class="kw">_</span>)
+ <span class="kw">if</span> <span class="ident">utxo</span>.<span class="ident">is_some</span>()
+ <span class="kw-2">&</span><span class="op">&</span> <span class="self">self</span>.<span class="ident">script_pubkey</span>() <span class="op">=</span><span class="op">=</span> <span class="ident">utxo</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap</span>().<span class="ident">script_pubkey</span> <span class="op">=</span><span class="op">></span>
+ {
+ <span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">clone</span>())
+ }
+ <span class="ident">Descriptor</span>::<span class="ident">Bare</span>(<span class="ident">ms</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Sh</span>(<span class="ident">ms</span>)
+ <span class="kw">if</span> <span class="ident">psbt_input</span>.<span class="ident">redeem_script</span>.<span class="ident">is_some</span>()
+ <span class="kw-2">&</span><span class="op">&</span> <span class="kw-2">&</span><span class="ident">ms</span>.<span class="ident">encode</span>() <span class="op">=</span><span class="op">=</span> <span class="ident">psbt_input</span>.<span class="ident">redeem_script</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap</span>() <span class="op">=</span><span class="op">></span>
+ {
+ <span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">clone</span>())
+ }
+ <span class="ident">Descriptor</span>::<span class="ident">Wsh</span>(<span class="ident">ms</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWsh</span>(<span class="ident">ms</span>)
+ <span class="kw">if</span> <span class="ident">psbt_input</span>.<span class="ident">witness_script</span>.<span class="ident">is_some</span>()
+ <span class="kw-2">&</span><span class="op">&</span> <span class="kw-2">&</span><span class="ident">ms</span>.<span class="ident">encode</span>() <span class="op">=</span><span class="op">=</span> <span class="ident">psbt_input</span>.<span class="ident">witness_script</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap</span>() <span class="op">=</span><span class="op">></span>
+ {
+ <span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">clone</span>())
+ }
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
+ }
+ }
+}
+
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">Hash</span>, <span class="ident">PartialEq</span>, <span class="ident">PartialOrd</span>, <span class="ident">Eq</span>, <span class="ident">Ord</span>, <span class="ident">Default</span>)]</span>
+<span class="kw">struct</span> <span class="ident">DummyKey</span>();
+
+<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">DummyKey</span> {
+ <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
+ <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"DummyKey"</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span> <span class="kw">for</span> <span class="ident">DummyKey</span> {
+ <span class="kw">type</span> <span class="prelude-val">Err</span> <span class="op">=</span> ();
+
+ <span class="kw">fn</span> <span class="ident">from_str</span>(<span class="kw">_</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="self">Self</span>::<span class="prelude-val">Err</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">DummyKey</span>::<span class="ident">default</span>())
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">miniscript</span>::<span class="ident">MiniscriptKey</span> <span class="kw">for</span> <span class="ident">DummyKey</span> {
+ <span class="kw">type</span> <span class="ident">Hash</span> <span class="op">=</span> <span class="ident">DummyKey</span>;
+
+ <span class="kw">fn</span> <span class="ident">to_pubkeyhash</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">DummyKey</span> {
+ <span class="ident">DummyKey</span>::<span class="ident">default</span>()
+ }
+}
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="kw">mod</span> <span class="ident">test</span> {
+ <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
+
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">deserialize</span>;
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">FromHex</span>;
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">psbt</span>;
+
+ <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">psbt</span>::<span class="ident">PSBTUtils</span>;
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_derive_from_psbt_input_wpkh_wif</span>() {
+ <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="ident">Descriptor</span>::<span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span>::<span class="ident">from_str</span>(
+ <span class="string">"wpkh(02b4632d08485ff1df2db55b9dafd23347d1c47a457072a1e87be26896549a8737)"</span>,
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">psbt</span>: <span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span> <span class="op">=</span> <span class="ident">deserialize</span>(
+ <span class="kw-2">&</span><span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(
+ <span class="string">"70736274ff010052010000000162307be8e431fbaff807cdf9cdc3fde44d7402\
+ 11bc8342c31ffd6ec11fe35bcc0100000000ffffffff01328601000000000016\
+ 001493ce48570b55c42c2af816aeaba06cfee1224fae000000000001011fa086\
+ 01000000000016001493ce48570b55c42c2af816aeaba06cfee1224fae010304\
+ 010000000000"</span>,
+ )
+ .<span class="ident">unwrap</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">descriptor</span>
+ .<span class="ident">derive_from_psbt_input</span>(<span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>], <span class="ident">psbt</span>.<span class="ident">get_utxo_for</span>(<span class="number">0</span>))
+ .<span class="ident">is_some</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_derive_from_psbt_input_pkh_tpub</span>() {
+ <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="ident">Descriptor</span>::<span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span>::<span class="ident">from_str</span>(
+ <span class="string">"pkh([0f056943/44h/0h/0h]tpubDDpWvmUrPZrhSPmUzCMBHffvC3HyMAPnWDSAQNBTnj1iZeJa7BZQEttFiP4DS4GCcXQHezdXhn86Hj6LHX5EDstXPWrMaSneRWM8yUf6NFd/10/*)"</span>,
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">psbt</span>: <span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span> <span class="op">=</span> <span class="ident">deserialize</span>(
+ <span class="kw-2">&</span><span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(
+ <span class="string">"70736274ff010053010000000145843b86be54a3cd8c9e38444e1162676c00df\
+ e7964122a70df491ea12fd67090100000000ffffffff01c19598000000000017\
+ a91432bb94283282f72b2e034709e348c44d5a4db0ef8700000000000100f902\
+ 0000000001010167e99c0eb67640f3a1b6805f2d8be8238c947f8aaf49eb0a9c\
+ bee6a42c984200000000171600142b29a22019cca05b9c2b2d283a4c4489e1cf\
+ 9f8ffeffffff02a01dced06100000017a914e2abf033cadbd74f0f4c74946201\
+ decd20d5c43c8780969800000000001976a9148b0fce5fb1264e599a65387313\
+ 3c95478b902eb288ac02473044022015d9211576163fa5b001e84dfa3d44efd9\
+ 86b8f3a0d3d2174369288b2b750906022048dacc0e5d73ae42512fd2b97e2071\
+ a8d0bce443b390b1fe0b8128fe70ec919e01210232dad1c5a67dcb0116d407e2\
+ 52584228ab7ec00e8b9779d0c3ffe8114fc1a7d2c80600000103040100000022\
+ 0603433b83583f8c4879b329dd08bbc7da935e4cc02f637ff746e05f0466ffb2\
+ a6a2180f0569432c00008000000080000000800a000000000000000000"</span>,
+ )
+ .<span class="ident">unwrap</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">descriptor</span>
+ .<span class="ident">derive_from_psbt_input</span>(<span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>], <span class="ident">psbt</span>.<span class="ident">get_utxo_for</span>(<span class="number">0</span>))
+ .<span class="ident">is_some</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_derive_from_psbt_input_wsh</span>() {
+ <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="ident">Descriptor</span>::<span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span>::<span class="ident">from_str</span>(
+ <span class="string">"wsh(and_v(v:pk(03b6633fef2397a0a9de9d7b6f23aef8368a6e362b0581f0f0af70d5ecfd254b14),older(6)))"</span>,
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">psbt</span>: <span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span> <span class="op">=</span> <span class="ident">deserialize</span>(
+ <span class="kw-2">&</span><span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(
+ <span class="string">"70736274ff01005302000000011c8116eea34408ab6529223c9a176606742207\
+ 67a1ff1d46a6e3c4a88243ea6e01000000000600000001109698000000000017\
+ a914ad105f61102e0d01d7af40d06d6a5c3ae2f7fde387000000000001012b80\
+ 969800000000002200203ca72f106a72234754890ca7640c43f65d2174e44d33\
+ 336030f9059345091044010304010000000105252103b6633fef2397a0a9de9d\
+ 7b6f23aef8368a6e362b0581f0f0af70d5ecfd254b14ad56b20000"</span>,
+ )
+ .<span class="ident">unwrap</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">descriptor</span>
+ .<span class="ident">derive_from_psbt_input</span>(<span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>], <span class="ident">psbt</span>.<span class="ident">get_utxo_for</span>(<span class="number">0</span>))
+ .<span class="ident">is_some</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_derive_from_psbt_input_sh</span>() {
+ <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="ident">Descriptor</span>::<span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span>::<span class="ident">from_str</span>(
+ <span class="string">"sh(and_v(v:pk(021403881a5587297818fcaf17d239cefca22fce84a45b3b1d23e836c4af671dbb),after(630000)))"</span>,
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">psbt</span>: <span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span> <span class="op">=</span> <span class="ident">deserialize</span>(
+ <span class="kw-2">&</span><span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(
+ <span class="string">"70736274ff0100530100000001bc8c13df445dfadcc42afa6dc841f85d22b01d\
+ a6270ebf981740f4b7b1d800390000000000feffffff01ba9598000000000017\
+ a91457b148ba4d3e5fa8608a8657875124e3d1c9390887f09c0900000100e002\
+ 0000000001016ba1bbe05cc93574a0d611ec7d93ad0ab6685b28d0cd80e8a82d\
+ debb326643c90100000000feffffff02809698000000000017a914d9a6e8c455\
+ 8e16c8253afe53ce37ad61cf4c38c487403504cf6100000017a9144044fb6e0b\
+ 757dfc1b34886b6a95aef4d3db137e870247304402202a9b72d939bcde8ba2a1\
+ e0980597e47af4f5c152a78499143c3d0a78ac2286a602207a45b1df9e93b8c9\
+ 6f09f5c025fe3e413ca4b905fe65ee55d32a3276439a9b8f012102dc1fcc2636\
+ 4da1aa718f03d8d9bd6f2ff410ed2cf1245a168aa3bcc995ac18e0a806000001\
+ 03040100000001042821021403881a5587297818fcaf17d239cefca22fce84a4\
+ 5b3b1d23e836c4af671dbbad03f09c09b10000"</span>,
+ )
+ .<span class="ident">unwrap</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">descriptor</span>
+ .<span class="ident">derive_from_psbt_input</span>(<span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>], <span class="ident">psbt</span>.<span class="ident">get_utxo_for</span>(<span class="number">0</span>))
+ .<span class="ident">is_some</span>());
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/descriptor/policy.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>policy.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+<span id="163">163</span>
+<span id="164">164</span>
+<span id="165">165</span>
+<span id="166">166</span>
+<span id="167">167</span>
+<span id="168">168</span>
+<span id="169">169</span>
+<span id="170">170</span>
+<span id="171">171</span>
+<span id="172">172</span>
+<span id="173">173</span>
+<span id="174">174</span>
+<span id="175">175</span>
+<span id="176">176</span>
+<span id="177">177</span>
+<span id="178">178</span>
+<span id="179">179</span>
+<span id="180">180</span>
+<span id="181">181</span>
+<span id="182">182</span>
+<span id="183">183</span>
+<span id="184">184</span>
+<span id="185">185</span>
+<span id="186">186</span>
+<span id="187">187</span>
+<span id="188">188</span>
+<span id="189">189</span>
+<span id="190">190</span>
+<span id="191">191</span>
+<span id="192">192</span>
+<span id="193">193</span>
+<span id="194">194</span>
+<span id="195">195</span>
+<span id="196">196</span>
+<span id="197">197</span>
+<span id="198">198</span>
+<span id="199">199</span>
+<span id="200">200</span>
+<span id="201">201</span>
+<span id="202">202</span>
+<span id="203">203</span>
+<span id="204">204</span>
+<span id="205">205</span>
+<span id="206">206</span>
+<span id="207">207</span>
+<span id="208">208</span>
+<span id="209">209</span>
+<span id="210">210</span>
+<span id="211">211</span>
+<span id="212">212</span>
+<span id="213">213</span>
+<span id="214">214</span>
+<span id="215">215</span>
+<span id="216">216</span>
+<span id="217">217</span>
+<span id="218">218</span>
+<span id="219">219</span>
+<span id="220">220</span>
+<span id="221">221</span>
+<span id="222">222</span>
+<span id="223">223</span>
+<span id="224">224</span>
+<span id="225">225</span>
+<span id="226">226</span>
+<span id="227">227</span>
+<span id="228">228</span>
+<span id="229">229</span>
+<span id="230">230</span>
+<span id="231">231</span>
+<span id="232">232</span>
+<span id="233">233</span>
+<span id="234">234</span>
+<span id="235">235</span>
+<span id="236">236</span>
+<span id="237">237</span>
+<span id="238">238</span>
+<span id="239">239</span>
+<span id="240">240</span>
+<span id="241">241</span>
+<span id="242">242</span>
+<span id="243">243</span>
+<span id="244">244</span>
+<span id="245">245</span>
+<span id="246">246</span>
+<span id="247">247</span>
+<span id="248">248</span>
+<span id="249">249</span>
+<span id="250">250</span>
+<span id="251">251</span>
+<span id="252">252</span>
+<span id="253">253</span>
+<span id="254">254</span>
+<span id="255">255</span>
+<span id="256">256</span>
+<span id="257">257</span>
+<span id="258">258</span>
+<span id="259">259</span>
+<span id="260">260</span>
+<span id="261">261</span>
+<span id="262">262</span>
+<span id="263">263</span>
+<span id="264">264</span>
+<span id="265">265</span>
+<span id="266">266</span>
+<span id="267">267</span>
+<span id="268">268</span>
+<span id="269">269</span>
+<span id="270">270</span>
+<span id="271">271</span>
+<span id="272">272</span>
+<span id="273">273</span>
+<span id="274">274</span>
+<span id="275">275</span>
+<span id="276">276</span>
+<span id="277">277</span>
+<span id="278">278</span>
+<span id="279">279</span>
+<span id="280">280</span>
+<span id="281">281</span>
+<span id="282">282</span>
+<span id="283">283</span>
+<span id="284">284</span>
+<span id="285">285</span>
+<span id="286">286</span>
+<span id="287">287</span>
+<span id="288">288</span>
+<span id="289">289</span>
+<span id="290">290</span>
+<span id="291">291</span>
+<span id="292">292</span>
+<span id="293">293</span>
+<span id="294">294</span>
+<span id="295">295</span>
+<span id="296">296</span>
+<span id="297">297</span>
+<span id="298">298</span>
+<span id="299">299</span>
+<span id="300">300</span>
+<span id="301">301</span>
+<span id="302">302</span>
+<span id="303">303</span>
+<span id="304">304</span>
+<span id="305">305</span>
+<span id="306">306</span>
+<span id="307">307</span>
+<span id="308">308</span>
+<span id="309">309</span>
+<span id="310">310</span>
+<span id="311">311</span>
+<span id="312">312</span>
+<span id="313">313</span>
+<span id="314">314</span>
+<span id="315">315</span>
+<span id="316">316</span>
+<span id="317">317</span>
+<span id="318">318</span>
+<span id="319">319</span>
+<span id="320">320</span>
+<span id="321">321</span>
+<span id="322">322</span>
+<span id="323">323</span>
+<span id="324">324</span>
+<span id="325">325</span>
+<span id="326">326</span>
+<span id="327">327</span>
+<span id="328">328</span>
+<span id="329">329</span>
+<span id="330">330</span>
+<span id="331">331</span>
+<span id="332">332</span>
+<span id="333">333</span>
+<span id="334">334</span>
+<span id="335">335</span>
+<span id="336">336</span>
+<span id="337">337</span>
+<span id="338">338</span>
+<span id="339">339</span>
+<span id="340">340</span>
+<span id="341">341</span>
+<span id="342">342</span>
+<span id="343">343</span>
+<span id="344">344</span>
+<span id="345">345</span>
+<span id="346">346</span>
+<span id="347">347</span>
+<span id="348">348</span>
+<span id="349">349</span>
+<span id="350">350</span>
+<span id="351">351</span>
+<span id="352">352</span>
+<span id="353">353</span>
+<span id="354">354</span>
+<span id="355">355</span>
+<span id="356">356</span>
+<span id="357">357</span>
+<span id="358">358</span>
+<span id="359">359</span>
+<span id="360">360</span>
+<span id="361">361</span>
+<span id="362">362</span>
+<span id="363">363</span>
+<span id="364">364</span>
+<span id="365">365</span>
+<span id="366">366</span>
+<span id="367">367</span>
+<span id="368">368</span>
+<span id="369">369</span>
+<span id="370">370</span>
+<span id="371">371</span>
+<span id="372">372</span>
+<span id="373">373</span>
+<span id="374">374</span>
+<span id="375">375</span>
+<span id="376">376</span>
+<span id="377">377</span>
+<span id="378">378</span>
+<span id="379">379</span>
+<span id="380">380</span>
+<span id="381">381</span>
+<span id="382">382</span>
+<span id="383">383</span>
+<span id="384">384</span>
+<span id="385">385</span>
+<span id="386">386</span>
+<span id="387">387</span>
+<span id="388">388</span>
+<span id="389">389</span>
+<span id="390">390</span>
+<span id="391">391</span>
+<span id="392">392</span>
+<span id="393">393</span>
+<span id="394">394</span>
+<span id="395">395</span>
+<span id="396">396</span>
+<span id="397">397</span>
+<span id="398">398</span>
+<span id="399">399</span>
+<span id="400">400</span>
+<span id="401">401</span>
+<span id="402">402</span>
+<span id="403">403</span>
+<span id="404">404</span>
+<span id="405">405</span>
+<span id="406">406</span>
+<span id="407">407</span>
+<span id="408">408</span>
+<span id="409">409</span>
+<span id="410">410</span>
+<span id="411">411</span>
+<span id="412">412</span>
+<span id="413">413</span>
+<span id="414">414</span>
+<span id="415">415</span>
+<span id="416">416</span>
+<span id="417">417</span>
+<span id="418">418</span>
+<span id="419">419</span>
+<span id="420">420</span>
+<span id="421">421</span>
+<span id="422">422</span>
+<span id="423">423</span>
+<span id="424">424</span>
+<span id="425">425</span>
+<span id="426">426</span>
+<span id="427">427</span>
+<span id="428">428</span>
+<span id="429">429</span>
+<span id="430">430</span>
+<span id="431">431</span>
+<span id="432">432</span>
+<span id="433">433</span>
+<span id="434">434</span>
+<span id="435">435</span>
+<span id="436">436</span>
+<span id="437">437</span>
+<span id="438">438</span>
+<span id="439">439</span>
+<span id="440">440</span>
+<span id="441">441</span>
+<span id="442">442</span>
+<span id="443">443</span>
+<span id="444">444</span>
+<span id="445">445</span>
+<span id="446">446</span>
+<span id="447">447</span>
+<span id="448">448</span>
+<span id="449">449</span>
+<span id="450">450</span>
+<span id="451">451</span>
+<span id="452">452</span>
+<span id="453">453</span>
+<span id="454">454</span>
+<span id="455">455</span>
+<span id="456">456</span>
+<span id="457">457</span>
+<span id="458">458</span>
+<span id="459">459</span>
+<span id="460">460</span>
+<span id="461">461</span>
+<span id="462">462</span>
+<span id="463">463</span>
+<span id="464">464</span>
+<span id="465">465</span>
+<span id="466">466</span>
+<span id="467">467</span>
+<span id="468">468</span>
+<span id="469">469</span>
+<span id="470">470</span>
+<span id="471">471</span>
+<span id="472">472</span>
+<span id="473">473</span>
+<span id="474">474</span>
+<span id="475">475</span>
+<span id="476">476</span>
+<span id="477">477</span>
+<span id="478">478</span>
+<span id="479">479</span>
+<span id="480">480</span>
+<span id="481">481</span>
+<span id="482">482</span>
+<span id="483">483</span>
+<span id="484">484</span>
+<span id="485">485</span>
+<span id="486">486</span>
+<span id="487">487</span>
+<span id="488">488</span>
+<span id="489">489</span>
+<span id="490">490</span>
+<span id="491">491</span>
+<span id="492">492</span>
+<span id="493">493</span>
+<span id="494">494</span>
+<span id="495">495</span>
+<span id="496">496</span>
+<span id="497">497</span>
+<span id="498">498</span>
+<span id="499">499</span>
+<span id="500">500</span>
+<span id="501">501</span>
+<span id="502">502</span>
+<span id="503">503</span>
+<span id="504">504</span>
+<span id="505">505</span>
+<span id="506">506</span>
+<span id="507">507</span>
+<span id="508">508</span>
+<span id="509">509</span>
+<span id="510">510</span>
+<span id="511">511</span>
+<span id="512">512</span>
+<span id="513">513</span>
+<span id="514">514</span>
+<span id="515">515</span>
+<span id="516">516</span>
+<span id="517">517</span>
+<span id="518">518</span>
+<span id="519">519</span>
+<span id="520">520</span>
+<span id="521">521</span>
+<span id="522">522</span>
+<span id="523">523</span>
+<span id="524">524</span>
+<span id="525">525</span>
+<span id="526">526</span>
+<span id="527">527</span>
+<span id="528">528</span>
+<span id="529">529</span>
+<span id="530">530</span>
+<span id="531">531</span>
+<span id="532">532</span>
+<span id="533">533</span>
+<span id="534">534</span>
+<span id="535">535</span>
+<span id="536">536</span>
+<span id="537">537</span>
+<span id="538">538</span>
+<span id="539">539</span>
+<span id="540">540</span>
+<span id="541">541</span>
+<span id="542">542</span>
+<span id="543">543</span>
+<span id="544">544</span>
+<span id="545">545</span>
+<span id="546">546</span>
+<span id="547">547</span>
+<span id="548">548</span>
+<span id="549">549</span>
+<span id="550">550</span>
+<span id="551">551</span>
+<span id="552">552</span>
+<span id="553">553</span>
+<span id="554">554</span>
+<span id="555">555</span>
+<span id="556">556</span>
+<span id="557">557</span>
+<span id="558">558</span>
+<span id="559">559</span>
+<span id="560">560</span>
+<span id="561">561</span>
+<span id="562">562</span>
+<span id="563">563</span>
+<span id="564">564</span>
+<span id="565">565</span>
+<span id="566">566</span>
+<span id="567">567</span>
+<span id="568">568</span>
+<span id="569">569</span>
+<span id="570">570</span>
+<span id="571">571</span>
+<span id="572">572</span>
+<span id="573">573</span>
+<span id="574">574</span>
+<span id="575">575</span>
+<span id="576">576</span>
+<span id="577">577</span>
+<span id="578">578</span>
+<span id="579">579</span>
+<span id="580">580</span>
+<span id="581">581</span>
+<span id="582">582</span>
+<span id="583">583</span>
+<span id="584">584</span>
+<span id="585">585</span>
+<span id="586">586</span>
+<span id="587">587</span>
+<span id="588">588</span>
+<span id="589">589</span>
+<span id="590">590</span>
+<span id="591">591</span>
+<span id="592">592</span>
+<span id="593">593</span>
+<span id="594">594</span>
+<span id="595">595</span>
+<span id="596">596</span>
+<span id="597">597</span>
+<span id="598">598</span>
+<span id="599">599</span>
+<span id="600">600</span>
+<span id="601">601</span>
+<span id="602">602</span>
+<span id="603">603</span>
+<span id="604">604</span>
+<span id="605">605</span>
+<span id="606">606</span>
+<span id="607">607</span>
+<span id="608">608</span>
+<span id="609">609</span>
+<span id="610">610</span>
+<span id="611">611</span>
+<span id="612">612</span>
+<span id="613">613</span>
+<span id="614">614</span>
+<span id="615">615</span>
+<span id="616">616</span>
+<span id="617">617</span>
+<span id="618">618</span>
+<span id="619">619</span>
+<span id="620">620</span>
+<span id="621">621</span>
+<span id="622">622</span>
+<span id="623">623</span>
+<span id="624">624</span>
+<span id="625">625</span>
+<span id="626">626</span>
+<span id="627">627</span>
+<span id="628">628</span>
+<span id="629">629</span>
+<span id="630">630</span>
+<span id="631">631</span>
+<span id="632">632</span>
+<span id="633">633</span>
+<span id="634">634</span>
+<span id="635">635</span>
+<span id="636">636</span>
+<span id="637">637</span>
+<span id="638">638</span>
+<span id="639">639</span>
+<span id="640">640</span>
+<span id="641">641</span>
+<span id="642">642</span>
+<span id="643">643</span>
+<span id="644">644</span>
+<span id="645">645</span>
+<span id="646">646</span>
+<span id="647">647</span>
+<span id="648">648</span>
+<span id="649">649</span>
+<span id="650">650</span>
+<span id="651">651</span>
+<span id="652">652</span>
+<span id="653">653</span>
+<span id="654">654</span>
+<span id="655">655</span>
+<span id="656">656</span>
+<span id="657">657</span>
+<span id="658">658</span>
+<span id="659">659</span>
+<span id="660">660</span>
+<span id="661">661</span>
+<span id="662">662</span>
+<span id="663">663</span>
+<span id="664">664</span>
+<span id="665">665</span>
+<span id="666">666</span>
+<span id="667">667</span>
+<span id="668">668</span>
+<span id="669">669</span>
+<span id="670">670</span>
+<span id="671">671</span>
+<span id="672">672</span>
+<span id="673">673</span>
+<span id="674">674</span>
+<span id="675">675</span>
+<span id="676">676</span>
+<span id="677">677</span>
+<span id="678">678</span>
+<span id="679">679</span>
+<span id="680">680</span>
+<span id="681">681</span>
+<span id="682">682</span>
+<span id="683">683</span>
+<span id="684">684</span>
+<span id="685">685</span>
+<span id="686">686</span>
+<span id="687">687</span>
+<span id="688">688</span>
+<span id="689">689</span>
+<span id="690">690</span>
+<span id="691">691</span>
+<span id="692">692</span>
+<span id="693">693</span>
+<span id="694">694</span>
+<span id="695">695</span>
+<span id="696">696</span>
+<span id="697">697</span>
+<span id="698">698</span>
+<span id="699">699</span>
+<span id="700">700</span>
+<span id="701">701</span>
+<span id="702">702</span>
+<span id="703">703</span>
+<span id="704">704</span>
+<span id="705">705</span>
+<span id="706">706</span>
+<span id="707">707</span>
+<span id="708">708</span>
+<span id="709">709</span>
+<span id="710">710</span>
+<span id="711">711</span>
+<span id="712">712</span>
+<span id="713">713</span>
+<span id="714">714</span>
+<span id="715">715</span>
+<span id="716">716</span>
+<span id="717">717</span>
+<span id="718">718</span>
+<span id="719">719</span>
+<span id="720">720</span>
+<span id="721">721</span>
+<span id="722">722</span>
+<span id="723">723</span>
+<span id="724">724</span>
+<span id="725">725</span>
+<span id="726">726</span>
+<span id="727">727</span>
+<span id="728">728</span>
+<span id="729">729</span>
+<span id="730">730</span>
+<span id="731">731</span>
+<span id="732">732</span>
+<span id="733">733</span>
+<span id="734">734</span>
+<span id="735">735</span>
+<span id="736">736</span>
+<span id="737">737</span>
+<span id="738">738</span>
+<span id="739">739</span>
+<span id="740">740</span>
+<span id="741">741</span>
+<span id="742">742</span>
+<span id="743">743</span>
+<span id="744">744</span>
+<span id="745">745</span>
+<span id="746">746</span>
+<span id="747">747</span>
+<span id="748">748</span>
+<span id="749">749</span>
+<span id="750">750</span>
+<span id="751">751</span>
+<span id="752">752</span>
+<span id="753">753</span>
+<span id="754">754</span>
+<span id="755">755</span>
+<span id="756">756</span>
+<span id="757">757</span>
+<span id="758">758</span>
+<span id="759">759</span>
+<span id="760">760</span>
+<span id="761">761</span>
+<span id="762">762</span>
+<span id="763">763</span>
+<span id="764">764</span>
+<span id="765">765</span>
+<span id="766">766</span>
+<span id="767">767</span>
+<span id="768">768</span>
+<span id="769">769</span>
+<span id="770">770</span>
+<span id="771">771</span>
+<span id="772">772</span>
+<span id="773">773</span>
+<span id="774">774</span>
+<span id="775">775</span>
+<span id="776">776</span>
+<span id="777">777</span>
+<span id="778">778</span>
+<span id="779">779</span>
+<span id="780">780</span>
+<span id="781">781</span>
+<span id="782">782</span>
+<span id="783">783</span>
+<span id="784">784</span>
+<span id="785">785</span>
+<span id="786">786</span>
+<span id="787">787</span>
+<span id="788">788</span>
+<span id="789">789</span>
+<span id="790">790</span>
+<span id="791">791</span>
+<span id="792">792</span>
+<span id="793">793</span>
+<span id="794">794</span>
+<span id="795">795</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="doccomment">//! Descriptor policy</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! This module implements the logic to extract and represent the spending policies of a descriptor</span>
+<span class="doccomment">//! in a more human-readable format.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ## Example</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ```</span>
+<span class="doccomment">//! # use std::sync::Arc;</span>
+<span class="doccomment">//! # use bdk::descriptor::*;</span>
+<span class="doccomment">//! let desc = "wsh(and_v(v:pk(cV3oCth6zxZ1UVsHLnGothsWNsaoxRhC6aeNi5VbSdFpwUkgkEci),or_d(pk(cVMTy7uebJgvFaSBwcgvwk8qn8xSLc97dKow4MBetjrrahZoimm2),older(12960))))";</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! let (extended_desc, key_map) = ExtendedDescriptor::parse_secret(desc)?;</span>
+<span class="doccomment">//! println!("{:?}", extended_desc);</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! let signers = Arc::new(key_map.into());</span>
+<span class="doccomment">//! let policy = extended_desc.extract_policy(signers)?;</span>
+<span class="doccomment">//! println!("policy: {}", serde_json::to_string(&policy)?);</span>
+<span class="doccomment">//! # Ok::<(), bdk::Error>(())</span>
+<span class="doccomment">//! ```</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">cmp</span>::<span class="ident">max</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::{<span class="ident">BTreeMap</span>, <span class="ident">HashSet</span>, <span class="ident">VecDeque</span>};
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>;
+
+<span class="kw">use</span> <span class="ident">serde</span>::<span class="ident">ser</span>::<span class="ident">SerializeMap</span>;
+<span class="kw">use</span> <span class="ident">serde</span>::{<span class="ident">Serialize</span>, <span class="ident">Serializer</span>};
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="kw-2">*</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">Fingerprint</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">PublicKey</span>;
+
+<span class="kw">use</span> <span class="ident">miniscript</span>::<span class="ident">descriptor</span>::<span class="ident">DescriptorPublicKey</span>;
+<span class="kw">use</span> <span class="ident">miniscript</span>::{<span class="ident">Descriptor</span>, <span class="ident">Miniscript</span>, <span class="ident">MiniscriptKey</span>, <span class="ident">ScriptContext</span>, <span class="ident">Terminal</span>};
+
+<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_imports</span>)]</span>
+<span class="kw">use</span> <span class="ident">log</span>::{<span class="ident">debug</span>, <span class="ident">error</span>, <span class="ident">info</span>, <span class="ident">trace</span>};
+
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">ExtractPolicy</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">signer</span>::{<span class="ident">SignerId</span>, <span class="ident">SignersContainer</span>};
+
+<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">checksum</span>::<span class="ident">get_checksum</span>;
+<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
+<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">XKeyUtils</span>;
+
+<span class="doccomment">/// Raw public key or extended key fingerprint</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">Default</span>, <span class="ident">Serialize</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">PKOrF</span> {
+ <span class="attribute">#[<span class="ident">serde</span>(<span class="ident">skip_serializing_if</span> <span class="op">=</span> <span class="string">"Option::is_none"</span>)]</span>
+ <span class="ident">pubkey</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">PublicKey</span><span class="op">></span>,
+ <span class="attribute">#[<span class="ident">serde</span>(<span class="ident">skip_serializing_if</span> <span class="op">=</span> <span class="string">"Option::is_none"</span>)]</span>
+ <span class="ident">pubkey_hash</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">hash160</span>::<span class="ident">Hash</span><span class="op">></span>,
+ <span class="attribute">#[<span class="ident">serde</span>(<span class="ident">skip_serializing_if</span> <span class="op">=</span> <span class="string">"Option::is_none"</span>)]</span>
+ <span class="ident">fingerprint</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Fingerprint</span><span class="op">></span>,
+}
+
+<span class="kw">impl</span> <span class="ident">PKOrF</span> {
+ <span class="kw">fn</span> <span class="ident">from_key</span>(<span class="ident">k</span>: <span class="kw-2">&</span><span class="ident">DescriptorPublicKey</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="kw">match</span> <span class="ident">k</span> {
+ <span class="ident">DescriptorPublicKey</span>::<span class="ident">PubKey</span>(<span class="ident">pubkey</span>) <span class="op">=</span><span class="op">></span> <span class="ident">PKOrF</span> {
+ <span class="ident">pubkey</span>: <span class="prelude-val">Some</span>(<span class="kw-2">*</span><span class="ident">pubkey</span>),
+ ..<span class="ident">Default</span>::<span class="ident">default</span>()
+ },
+ <span class="ident">DescriptorPublicKey</span>::<span class="ident">XPub</span>(<span class="ident">xpub</span>) <span class="op">=</span><span class="op">></span> <span class="ident">PKOrF</span> {
+ <span class="ident">fingerprint</span>: <span class="prelude-val">Some</span>(<span class="ident">xpub</span>.<span class="ident">root_fingerprint</span>()),
+ ..<span class="ident">Default</span>::<span class="ident">default</span>()
+ },
+ }
+ }
+
+ <span class="kw">fn</span> <span class="ident">from_key_hash</span>(<span class="ident">k</span>: <span class="ident">hash160</span>::<span class="ident">Hash</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">PKOrF</span> {
+ <span class="ident">pubkey_hash</span>: <span class="prelude-val">Some</span>(<span class="ident">k</span>),
+ ..<span class="ident">Default</span>::<span class="ident">default</span>()
+ }
+ }
+}
+
+<span class="doccomment">/// An item that need to be satisfied</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">Serialize</span>)]</span>
+<span class="attribute">#[<span class="ident">serde</span>(<span class="ident">tag</span> <span class="op">=</span> <span class="string">"type"</span>, <span class="ident">rename_all</span> <span class="op">=</span> <span class="string">"UPPERCASE"</span>)]</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">SatisfiableItem</span> {
+ <span class="comment">// Leaves</span>
+ <span class="ident">Signature</span>(<span class="ident">PKOrF</span>),
+ <span class="ident">SignatureKey</span>(<span class="ident">PKOrF</span>),
+ <span class="ident">SHA256Preimage</span> {
+ <span class="ident">hash</span>: <span class="ident">sha256</span>::<span class="ident">Hash</span>,
+ },
+ <span class="ident">HASH256Preimage</span> {
+ <span class="ident">hash</span>: <span class="ident">sha256d</span>::<span class="ident">Hash</span>,
+ },
+ <span class="ident">RIPEMD160Preimage</span> {
+ <span class="ident">hash</span>: <span class="ident">ripemd160</span>::<span class="ident">Hash</span>,
+ },
+ <span class="ident">HASH160Preimage</span> {
+ <span class="ident">hash</span>: <span class="ident">hash160</span>::<span class="ident">Hash</span>,
+ },
+ <span class="ident">AbsoluteTimelock</span> {
+ <span class="ident">value</span>: <span class="ident">u32</span>,
+ },
+ <span class="ident">RelativeTimelock</span> {
+ <span class="ident">value</span>: <span class="ident">u32</span>,
+ },
+
+ <span class="comment">// Complex item</span>
+ <span class="ident">Thresh</span> {
+ <span class="ident">items</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>,
+ <span class="ident">threshold</span>: <span class="ident">usize</span>,
+ },
+ <span class="ident">Multisig</span> {
+ <span class="ident">keys</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">PKOrF</span><span class="op">></span>,
+ <span class="ident">threshold</span>: <span class="ident">usize</span>,
+ },
+}
+
+<span class="kw">impl</span> <span class="ident">SatisfiableItem</span> {
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_leaf</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">SatisfiableItem</span>::<span class="ident">Thresh</span> {
+ <span class="ident">items</span>: <span class="kw">_</span>,
+ <span class="ident">threshold</span>: <span class="kw">_</span>,
+ } <span class="op">=</span><span class="op">></span> <span class="bool-val">false</span>,
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="bool-val">true</span>,
+ }
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">id</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">String</span> {
+ <span class="ident">get_checksum</span>(<span class="kw-2">&</span><span class="ident">serde_json</span>::<span class="ident">to_string</span>(<span class="self">self</span>).<span class="ident">expect</span>(<span class="string">"Failed to serialize a SatisfiableItem"</span>))
+ .<span class="ident">expect</span>(<span class="string">"Failed to compute a SatisfiableItem id"</span>)
+ }
+}
+
+<span class="kw">fn</span> <span class="ident">combinations</span>(<span class="ident">vec</span>: <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>, <span class="ident">size</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span><span class="op">></span> {
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">vec</span>.<span class="ident">len</span>() <span class="op">></span><span class="op">=</span> <span class="ident">size</span>);
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">answer</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">queue</span> <span class="op">=</span> <span class="ident">VecDeque</span>::<span class="ident">new</span>();
+ <span class="kw">for</span> (<span class="ident">index</span>, <span class="ident">val</span>) <span class="kw">in</span> <span class="ident">vec</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">new_vec</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">size</span>);
+ <span class="ident">new_vec</span>.<span class="ident">push</span>(<span class="kw-2">*</span><span class="ident">val</span>);
+ <span class="ident">queue</span>.<span class="ident">push_back</span>((<span class="ident">index</span>, <span class="ident">new_vec</span>));
+ }
+
+ <span class="kw">while</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">index</span>, <span class="ident">vals</span>)) <span class="op">=</span> <span class="ident">queue</span>.<span class="ident">pop_front</span>() {
+ <span class="kw">if</span> <span class="ident">vals</span>.<span class="ident">len</span>() <span class="op">></span><span class="op">=</span> <span class="ident">size</span> {
+ <span class="ident">answer</span>.<span class="ident">push</span>(<span class="ident">vals</span>);
+ } <span class="kw">else</span> {
+ <span class="kw">for</span> (<span class="ident">new_index</span>, <span class="ident">val</span>) <span class="kw">in</span> <span class="ident">vec</span>.<span class="ident">iter</span>().<span class="ident">skip</span>(<span class="ident">index</span> <span class="op">+</span> <span class="number">1</span>).<span class="ident">enumerate</span>() {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cloned</span> <span class="op">=</span> <span class="ident">vals</span>.<span class="ident">clone</span>();
+ <span class="ident">cloned</span>.<span class="ident">push</span>(<span class="kw-2">*</span><span class="ident">val</span>);
+ <span class="ident">queue</span>.<span class="ident">push_front</span>((<span class="ident">new_index</span>, <span class="ident">cloned</span>));
+ }
+ }
+ }
+
+ <span class="ident">answer</span>
+}
+
+<span class="kw">fn</span> <span class="ident">mix</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">Clone</span><span class="op">></span>(<span class="ident">vec</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">T</span><span class="op">></span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">T</span><span class="op">></span><span class="op">></span> {
+ <span class="kw">if</span> <span class="ident">vec</span>.<span class="ident">is_empty</span>() <span class="op">|</span><span class="op">|</span> <span class="ident">vec</span>.<span class="ident">iter</span>().<span class="ident">any</span>(<span class="ident">Vec</span>::<span class="ident">is_empty</span>) {
+ <span class="kw">return</span> <span class="macro">vec</span><span class="macro">!</span>[];
+ }
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">answer</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
+ <span class="kw">let</span> <span class="ident">size</span> <span class="op">=</span> <span class="ident">vec</span>.<span class="ident">len</span>();
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">queue</span> <span class="op">=</span> <span class="ident">VecDeque</span>::<span class="ident">new</span>();
+ <span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">vec</span>[<span class="number">0</span>] {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">new_vec</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">size</span>);
+ <span class="ident">new_vec</span>.<span class="ident">push</span>(<span class="ident">i</span>.<span class="ident">clone</span>());
+ <span class="ident">queue</span>.<span class="ident">push_back</span>(<span class="ident">new_vec</span>);
+ }
+
+ <span class="kw">while</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">vals</span>) <span class="op">=</span> <span class="ident">queue</span>.<span class="ident">pop_front</span>() {
+ <span class="kw">if</span> <span class="ident">vals</span>.<span class="ident">len</span>() <span class="op">></span><span class="op">=</span> <span class="ident">size</span> {
+ <span class="ident">answer</span>.<span class="ident">push</span>(<span class="ident">vals</span>);
+ } <span class="kw">else</span> {
+ <span class="kw">let</span> <span class="ident">level</span> <span class="op">=</span> <span class="ident">vals</span>.<span class="ident">len</span>();
+ <span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">vec</span>[<span class="ident">level</span>] {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cloned</span> <span class="op">=</span> <span class="ident">vals</span>.<span class="ident">clone</span>();
+ <span class="ident">cloned</span>.<span class="ident">push</span>(<span class="ident">i</span>.<span class="ident">clone</span>());
+ <span class="ident">queue</span>.<span class="ident">push_front</span>(<span class="ident">cloned</span>);
+ }
+ }
+ }
+
+ <span class="ident">answer</span>
+}
+
+<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">ConditionMap</span> <span class="op">=</span> <span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">usize</span>, <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Condition</span><span class="op">></span><span class="op">></span>;
+<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">FoldedConditionMap</span> <span class="op">=</span> <span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>, <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Condition</span><span class="op">></span><span class="op">></span>;
+
+<span class="kw">fn</span> <span class="ident">serialize_folded_cond_map</span><span class="op"><</span><span class="ident">S</span><span class="op">></span>(
+ <span class="ident">input_map</span>: <span class="kw-2">&</span><span class="ident">FoldedConditionMap</span>,
+ <span class="ident">serializer</span>: <span class="ident">S</span>,
+) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">S</span>::<span class="prelude-val">Ok</span>, <span class="ident">S</span>::<span class="ident">Error</span><span class="op">></span>
+<span class="kw">where</span>
+ <span class="ident">S</span>: <span class="ident">Serializer</span>,
+{
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">serializer</span>.<span class="ident">serialize_map</span>(<span class="prelude-val">Some</span>(<span class="ident">input_map</span>.<span class="ident">len</span>()))<span class="question-mark">?</span>;
+ <span class="kw">for</span> (<span class="ident">k</span>, <span class="ident">v</span>) <span class="kw">in</span> <span class="ident">input_map</span> {
+ <span class="kw">let</span> <span class="ident">k_string</span> <span class="op">=</span> <span class="macro">format</span><span class="macro">!</span>(<span class="string">"{:?}"</span>, <span class="ident">k</span>);
+ <span class="ident">map</span>.<span class="ident">serialize_entry</span>(<span class="kw-2">&</span><span class="ident">k_string</span>, <span class="ident">v</span>)<span class="question-mark">?</span>;
+ }
+ <span class="ident">map</span>.<span class="ident">end</span>()
+}
+
+<span class="doccomment">/// Represent if and how much a policy item is satisfied by the wallet's descriptor</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">Serialize</span>)]</span>
+<span class="attribute">#[<span class="ident">serde</span>(<span class="ident">tag</span> <span class="op">=</span> <span class="string">"type"</span>, <span class="ident">rename_all</span> <span class="op">=</span> <span class="string">"UPPERCASE"</span>)]</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">Satisfaction</span> {
+ <span class="doccomment">/// Only a partial satisfaction of some kind of threshold policy</span>
+ <span class="ident">Partial</span> {
+ <span class="doccomment">/// Total number of items</span>
+ <span class="ident">n</span>: <span class="ident">usize</span>,
+ <span class="doccomment">/// Threshold</span>
+ <span class="ident">m</span>: <span class="ident">usize</span>,
+ <span class="doccomment">/// The items that can be satisfied by the descriptor</span>
+ <span class="ident">items</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
+ <span class="attribute">#[<span class="ident">serde</span>(<span class="ident">skip_serializing_if</span> <span class="op">=</span> <span class="string">"BTreeMap::is_empty"</span>)]</span>
+ <span class="doccomment">/// Extra conditions that also need to be satisfied</span>
+ <span class="ident">conditions</span>: <span class="ident">ConditionMap</span>,
+ },
+ <span class="doccomment">/// Can reach the threshold of some kind of threshold policy</span>
+ <span class="ident">PartialComplete</span> {
+ <span class="doccomment">/// Total number of items</span>
+ <span class="ident">n</span>: <span class="ident">usize</span>,
+ <span class="doccomment">/// Threshold</span>
+ <span class="ident">m</span>: <span class="ident">usize</span>,
+ <span class="doccomment">/// The items that can be satisfied by the descriptor</span>
+ <span class="ident">items</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
+ <span class="attribute">#[<span class="ident">serde</span>(
+ <span class="ident">serialize_with</span> <span class="op">=</span> <span class="string">"serialize_folded_cond_map"</span>,
+ <span class="ident">skip_serializing_if</span> <span class="op">=</span> <span class="string">"BTreeMap::is_empty"</span>
+ )]</span>
+ <span class="doccomment">/// Extra conditions that also need to be satisfied</span>
+ <span class="ident">conditions</span>: <span class="ident">FoldedConditionMap</span>,
+ },
+
+ <span class="doccomment">/// Can satisfy the policy item</span>
+ <span class="ident">Complete</span> {
+ <span class="doccomment">/// Extra conditions that also need to be satisfied</span>
+ <span class="ident">condition</span>: <span class="ident">Condition</span>,
+ },
+ <span class="doccomment">/// Cannot satisfy or contribute to the policy item</span>
+ <span class="prelude-val">None</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">Satisfaction</span> {
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_leaf</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">Satisfaction</span>::<span class="prelude-val">None</span> <span class="op">|</span> <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> { .. } <span class="op">=</span><span class="op">></span> <span class="bool-val">true</span>,
+ <span class="ident">Satisfaction</span>::<span class="ident">PartialComplete</span> { .. } <span class="op">|</span> <span class="ident">Satisfaction</span>::<span class="ident">Partial</span> { .. } <span class="op">=</span><span class="op">></span> <span class="bool-val">false</span>,
+ }
+ }
+
+ <span class="comment">// add `inner` as one of self's partial items. this only makes sense on partials</span>
+ <span class="kw">fn</span> <span class="ident">add</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">inner</span>: <span class="kw-2">&</span><span class="ident">Satisfaction</span>, <span class="ident">inner_index</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">PolicyError</span><span class="op">></span> {
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">Satisfaction</span>::<span class="prelude-val">None</span> <span class="op">|</span> <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> { .. } <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="ident">PolicyError</span>::<span class="ident">AddOnLeaf</span>),
+ <span class="ident">Satisfaction</span>::<span class="ident">PartialComplete</span> { .. } <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="ident">PolicyError</span>::<span class="ident">AddOnPartialComplete</span>),
+ <span class="ident">Satisfaction</span>::<span class="ident">Partial</span> {
+ <span class="ident">n</span>,
+ <span class="kw-2">ref</span> <span class="kw-2">mut</span> <span class="ident">conditions</span>,
+ <span class="kw-2">ref</span> <span class="kw-2">mut</span> <span class="ident">items</span>,
+ ..
+ } <span class="op">=</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="ident">inner_index</span> <span class="op">></span><span class="op">=</span> <span class="kw-2">*</span><span class="ident">n</span> <span class="op">|</span><span class="op">|</span> <span class="ident">items</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">inner_index</span>) {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">PolicyError</span>::<span class="ident">IndexOutOfRange</span>(<span class="ident">inner_index</span>));
+ }
+
+ <span class="kw">match</span> <span class="ident">inner</span> {
+ <span class="comment">// not relevant if not completed yet</span>
+ <span class="ident">Satisfaction</span>::<span class="prelude-val">None</span> <span class="op">|</span> <span class="ident">Satisfaction</span>::<span class="ident">Partial</span> { .. } <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Ok</span>(()),
+ <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> { <span class="ident">condition</span> } <span class="op">=</span><span class="op">></span> {
+ <span class="ident">items</span>.<span class="ident">push</span>(<span class="ident">inner_index</span>);
+ <span class="ident">conditions</span>.<span class="ident">insert</span>(<span class="ident">inner_index</span>, <span class="macro">vec</span><span class="macro">!</span>[<span class="kw-2">*</span><span class="ident">condition</span>].<span class="ident">into_iter</span>().<span class="ident">collect</span>());
+ }
+ <span class="ident">Satisfaction</span>::<span class="ident">PartialComplete</span> {
+ <span class="ident">conditions</span>: <span class="ident">other_conditions</span>,
+ ..
+ } <span class="op">=</span><span class="op">></span> {
+ <span class="ident">items</span>.<span class="ident">push</span>(<span class="ident">inner_index</span>);
+ <span class="kw">let</span> <span class="ident">conditions_set</span> <span class="op">=</span> <span class="ident">other_conditions</span>
+ .<span class="ident">values</span>()
+ .<span class="ident">fold</span>(<span class="ident">HashSet</span>::<span class="ident">new</span>(), <span class="op">|</span><span class="ident">set</span>, <span class="ident">i</span><span class="op">|</span> <span class="ident">set</span>.<span class="ident">union</span>(<span class="kw-2">&</span><span class="ident">i</span>).<span class="ident">cloned</span>().<span class="ident">collect</span>());
+ <span class="ident">conditions</span>.<span class="ident">insert</span>(<span class="ident">inner_index</span>, <span class="ident">conditions_set</span>);
+ }
+ }
+
+ <span class="prelude-val">Ok</span>(())
+ }
+ }
+ }
+
+ <span class="kw">fn</span> <span class="ident">finalize</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">PolicyError</span><span class="op">></span> {
+ <span class="comment">// if partial try to bump it to a partialcomplete</span>
+ <span class="kw">if</span> <span class="kw">let</span> <span class="ident">Satisfaction</span>::<span class="ident">Partial</span> {
+ <span class="ident">n</span>,
+ <span class="ident">m</span>,
+ <span class="ident">items</span>,
+ <span class="ident">conditions</span>,
+ } <span class="op">=</span> <span class="self">self</span>
+ {
+ <span class="kw">if</span> <span class="ident">items</span>.<span class="ident">len</span>() <span class="op">></span><span class="op">=</span> <span class="kw-2">*</span><span class="ident">m</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
+ <span class="kw">let</span> <span class="ident">indexes</span> <span class="op">=</span> <span class="ident">combinations</span>(<span class="ident">items</span>, <span class="kw-2">*</span><span class="ident">m</span>);
+ <span class="comment">// `indexes` at this point is a Vec<Vec<usize>>, with the "n choose k" of items (m of n)</span>
+ <span class="ident">indexes</span>
+ .<span class="ident">into_iter</span>()
+ <span class="comment">// .inspect(|x| println!("--- orig --- {:?}", x))</span>
+ <span class="comment">// we map each of the combinations of elements into a tuple of ([choosen items], [conditions]). unfortunately, those items have potentially more than one</span>
+ <span class="comment">// condition (think about ORs), so we also use `mix` to expand those, i.e. [[0], [1, 2]] becomes [[0, 1], [0, 2]]. This is necessary to make sure that we</span>
+ <span class="comment">// consider every possibile options and check whether or not they are compatible.</span>
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">i_vec</span><span class="op">|</span> {
+ <span class="ident">mix</span>(<span class="ident">i_vec</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> {
+ <span class="ident">conditions</span>
+ .<span class="ident">get</span>(<span class="ident">i</span>)
+ .<span class="ident">and_then</span>(<span class="op">|</span><span class="ident">set</span><span class="op">|</span> <span class="prelude-val">Some</span>(<span class="ident">set</span>.<span class="ident">clone</span>().<span class="ident">into_iter</span>().<span class="ident">collect</span>()))
+ .<span class="ident">unwrap_or</span>(<span class="macro">vec</span><span class="macro">!</span>[])
+ })
+ .<span class="ident">collect</span>())
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> (<span class="ident">i_vec</span>.<span class="ident">clone</span>(), <span class="ident">x</span>))
+ .<span class="ident">collect</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span>(<span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>, <span class="ident">Vec</span><span class="op"><</span><span class="ident">Condition</span><span class="op">></span>)<span class="op">></span><span class="op">></span>()
+ })
+ <span class="comment">// .inspect(|x: &Vec<(Vec<usize>, Vec<Condition>)>| println!("fetch {:?}", x))</span>
+ <span class="comment">// since the previous step can turn one item of the iterator into multiple ones, we call flatten to expand them out</span>
+ .<span class="ident">flatten</span>()
+ <span class="comment">// .inspect(|x| println!("flat {:?}", x))</span>
+ <span class="comment">// try to fold all the conditions for this specific combination of indexes/options. if they are not compatibile, try_fold will be Err</span>
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">key</span>, <span class="ident">val</span>)<span class="op">|</span> {
+ (
+ <span class="ident">key</span>,
+ <span class="ident">val</span>.<span class="ident">into_iter</span>()
+ .<span class="ident">try_fold</span>(<span class="ident">Condition</span>::<span class="ident">default</span>(), <span class="op">|</span><span class="ident">acc</span>, <span class="ident">v</span><span class="op">|</span> <span class="ident">acc</span>.<span class="ident">merge</span>(<span class="kw-2">&</span><span class="ident">v</span>)),
+ )
+ })
+ <span class="comment">// .inspect(|x| println!("try_fold {:?}", x))</span>
+ <span class="comment">// filter out all the incompatible combinations</span>
+ .<span class="ident">filter</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">val</span>)<span class="op">|</span> <span class="ident">val</span>.<span class="ident">is_ok</span>())
+ <span class="comment">// .inspect(|x| println!("filter {:?}", x))</span>
+ <span class="comment">// push them into the map</span>
+ .<span class="ident">for_each</span>(<span class="op">|</span>(<span class="ident">key</span>, <span class="ident">val</span>)<span class="op">|</span> {
+ <span class="ident">map</span>.<span class="ident">entry</span>(<span class="ident">key</span>)
+ .<span class="ident">or_insert_with</span>(<span class="ident">HashSet</span>::<span class="ident">new</span>)
+ .<span class="ident">insert</span>(<span class="ident">val</span>.<span class="ident">unwrap</span>());
+ });
+ <span class="comment">// TODO: if the map is empty, the conditions are not compatible, return an error?</span>
+ <span class="kw-2">*</span><span class="self">self</span> <span class="op">=</span> <span class="ident">Satisfaction</span>::<span class="ident">PartialComplete</span> {
+ <span class="ident">n</span>: <span class="kw-2">*</span><span class="ident">n</span>,
+ <span class="ident">m</span>: <span class="kw-2">*</span><span class="ident">m</span>,
+ <span class="ident">items</span>: <span class="ident">items</span>.<span class="ident">clone</span>(),
+ <span class="ident">conditions</span>: <span class="ident">map</span>,
+ };
+ }
+ }
+
+ <span class="prelude-val">Ok</span>(())
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">bool</span><span class="op">></span> <span class="kw">for</span> <span class="ident">Satisfaction</span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">other</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="kw">if</span> <span class="ident">other</span> {
+ <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> {
+ <span class="ident">condition</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ }
+ } <span class="kw">else</span> {
+ <span class="ident">Satisfaction</span>::<span class="prelude-val">None</span>
+ }
+ }
+}
+
+<span class="doccomment">/// Descriptor spending policy</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">Serialize</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Policy</span> {
+ <span class="doccomment">/// Identifier for this policy node</span>
+ <span class="kw">pub</span> <span class="ident">id</span>: <span class="ident">String</span>,
+
+ <span class="doccomment">/// Type of this policy node</span>
+ <span class="attribute">#[<span class="ident">serde</span>(<span class="ident">flatten</span>)]</span>
+ <span class="kw">pub</span> <span class="ident">item</span>: <span class="ident">SatisfiableItem</span>,
+ <span class="doccomment">/// How a much given PSBT already satisfies this polcy node **(currently unused)**</span>
+ <span class="kw">pub</span> <span class="ident">satisfaction</span>: <span class="ident">Satisfaction</span>,
+ <span class="doccomment">/// How the wallet's descriptor can satisfy this policy node</span>
+ <span class="kw">pub</span> <span class="ident">contribution</span>: <span class="ident">Satisfaction</span>,
+}
+
+<span class="doccomment">/// An extra condition that must be satisfied but that is out of control of the user</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Hash</span>, <span class="ident">Clone</span>, <span class="ident">Copy</span>, <span class="ident">Debug</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>, <span class="ident">PartialOrd</span>, <span class="ident">Ord</span>, <span class="ident">Default</span>, <span class="ident">Serialize</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Condition</span> {
+ <span class="attribute">#[<span class="ident">serde</span>(<span class="ident">skip_serializing_if</span> <span class="op">=</span> <span class="string">"Option::is_none"</span>)]</span>
+ <span class="kw">pub</span> <span class="ident">csv</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+ <span class="attribute">#[<span class="ident">serde</span>(<span class="ident">skip_serializing_if</span> <span class="op">=</span> <span class="string">"Option::is_none"</span>)]</span>
+ <span class="kw">pub</span> <span class="ident">timelock</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+}
+
+<span class="kw">impl</span> <span class="ident">Condition</span> {
+ <span class="kw">fn</span> <span class="ident">merge_timelock</span>(<span class="ident">a</span>: <span class="ident">u32</span>, <span class="ident">b</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">PolicyError</span><span class="op">></span> {
+ <span class="kw">const</span> <span class="ident">BLOCKS_TIMELOCK_THRESHOLD</span>: <span class="ident">u32</span> <span class="op">=</span> <span class="number">500000000</span>;
+
+ <span class="kw">if</span> (<span class="ident">a</span> <span class="op"><</span> <span class="ident">BLOCKS_TIMELOCK_THRESHOLD</span>) <span class="op">!</span><span class="op">=</span> (<span class="ident">b</span> <span class="op"><</span> <span class="ident">BLOCKS_TIMELOCK_THRESHOLD</span>) {
+ <span class="prelude-val">Err</span>(<span class="ident">PolicyError</span>::<span class="ident">MixedTimelockUnits</span>)
+ } <span class="kw">else</span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">max</span>(<span class="ident">a</span>, <span class="ident">b</span>))
+ }
+ }
+
+ <span class="kw">fn</span> <span class="ident">merge</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">other</span>: <span class="kw-2">&</span><span class="ident">Condition</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">PolicyError</span><span class="op">></span> {
+ <span class="kw">match</span> (<span class="self">self</span>.<span class="ident">csv</span>, <span class="ident">other</span>.<span class="ident">csv</span>) {
+ (<span class="prelude-val">Some</span>(<span class="ident">a</span>), <span class="prelude-val">Some</span>(<span class="ident">b</span>)) <span class="op">=</span><span class="op">></span> <span class="self">self</span>.<span class="ident">csv</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="self">Self</span>::<span class="ident">merge_timelock</span>(<span class="ident">a</span>, <span class="ident">b</span>)<span class="question-mark">?</span>),
+ (<span class="prelude-val">None</span>, <span class="ident">any</span>) <span class="op">=</span><span class="op">></span> <span class="self">self</span>.<span class="ident">csv</span> <span class="op">=</span> <span class="ident">any</span>,
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> {}
+ }
+
+ <span class="kw">match</span> (<span class="self">self</span>.<span class="ident">timelock</span>, <span class="ident">other</span>.<span class="ident">timelock</span>) {
+ (<span class="prelude-val">Some</span>(<span class="ident">a</span>), <span class="prelude-val">Some</span>(<span class="ident">b</span>)) <span class="op">=</span><span class="op">></span> <span class="self">self</span>.<span class="ident">timelock</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="self">Self</span>::<span class="ident">merge_timelock</span>(<span class="ident">a</span>, <span class="ident">b</span>)<span class="question-mark">?</span>),
+ (<span class="prelude-val">None</span>, <span class="ident">any</span>) <span class="op">=</span><span class="op">></span> <span class="self">self</span>.<span class="ident">timelock</span> <span class="op">=</span> <span class="ident">any</span>,
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> {}
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>)
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_null</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="self">self</span>.<span class="ident">csv</span>.<span class="ident">is_none</span>() <span class="kw-2">&</span><span class="op">&</span> <span class="self">self</span>.<span class="ident">timelock</span>.<span class="ident">is_none</span>()
+ }
+}
+
+<span class="doccomment">/// Errors that can happen while extracting and manipulating policies</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">PolicyError</span> {
+ <span class="ident">NotEnoughItemsSelected</span>(<span class="ident">String</span>),
+ <span class="ident">TooManyItemsSelected</span>(<span class="ident">String</span>),
+ <span class="ident">IndexOutOfRange</span>(<span class="ident">usize</span>),
+ <span class="ident">AddOnLeaf</span>,
+ <span class="ident">AddOnPartialComplete</span>,
+ <span class="ident">MixedTimelockUnits</span>,
+ <span class="ident">IncompatibleConditions</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">PolicyError</span> {
+ <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
+ <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"{:?}"</span>, <span class="self">self</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span> <span class="kw">for</span> <span class="ident">PolicyError</span> {}
+
+<span class="kw">impl</span> <span class="ident">Policy</span> {
+ <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">item</span>: <span class="ident">SatisfiableItem</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">Policy</span> {
+ <span class="ident">id</span>: <span class="ident">item</span>.<span class="ident">id</span>(),
+ <span class="ident">item</span>,
+ <span class="ident">satisfaction</span>: <span class="ident">Satisfaction</span>::<span class="prelude-val">None</span>,
+ <span class="ident">contribution</span>: <span class="ident">Satisfaction</span>::<span class="prelude-val">None</span>,
+ }
+ }
+
+ <span class="kw">fn</span> <span class="ident">make_and</span>(<span class="ident">a</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">b</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">PolicyError</span><span class="op">></span> {
+ <span class="kw">match</span> (<span class="ident">a</span>, <span class="ident">b</span>) {
+ (<span class="prelude-val">None</span>, <span class="prelude-val">None</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
+ (<span class="prelude-val">Some</span>(<span class="ident">x</span>), <span class="prelude-val">None</span>) <span class="op">|</span> (<span class="prelude-val">None</span>, <span class="prelude-val">Some</span>(<span class="ident">x</span>)) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">x</span>)),
+ (<span class="prelude-val">Some</span>(<span class="ident">a</span>), <span class="prelude-val">Some</span>(<span class="ident">b</span>)) <span class="op">=</span><span class="op">></span> <span class="self">Self</span>::<span class="ident">make_thresh</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">a</span>, <span class="ident">b</span>], <span class="number">2</span>),
+ }
+ }
+
+ <span class="kw">fn</span> <span class="ident">make_or</span>(<span class="ident">a</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">b</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">PolicyError</span><span class="op">></span> {
+ <span class="kw">match</span> (<span class="ident">a</span>, <span class="ident">b</span>) {
+ (<span class="prelude-val">None</span>, <span class="prelude-val">None</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
+ (<span class="prelude-val">Some</span>(<span class="ident">x</span>), <span class="prelude-val">None</span>) <span class="op">|</span> (<span class="prelude-val">None</span>, <span class="prelude-val">Some</span>(<span class="ident">x</span>)) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">x</span>)),
+ (<span class="prelude-val">Some</span>(<span class="ident">a</span>), <span class="prelude-val">Some</span>(<span class="ident">b</span>)) <span class="op">=</span><span class="op">></span> <span class="self">Self</span>::<span class="ident">make_thresh</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">a</span>, <span class="ident">b</span>], <span class="number">1</span>),
+ }
+ }
+
+ <span class="kw">fn</span> <span class="ident">make_thresh</span>(<span class="ident">items</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">threshold</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">PolicyError</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="ident">threshold</span> <span class="op">=</span><span class="op">=</span> <span class="number">0</span> {
+ <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>);
+ }
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">contribution</span> <span class="op">=</span> <span class="ident">Satisfaction</span>::<span class="ident">Partial</span> {
+ <span class="ident">n</span>: <span class="ident">items</span>.<span class="ident">len</span>(),
+ <span class="ident">m</span>: <span class="ident">threshold</span>,
+ <span class="ident">items</span>: <span class="macro">vec</span><span class="macro">!</span>[],
+ <span class="ident">conditions</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ };
+ <span class="kw">for</span> (<span class="ident">index</span>, <span class="ident">item</span>) <span class="kw">in</span> <span class="ident">items</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
+ <span class="ident">contribution</span>.<span class="ident">add</span>(<span class="kw-2">&</span><span class="ident">item</span>.<span class="ident">contribution</span>, <span class="ident">index</span>)<span class="question-mark">?</span>;
+ }
+ <span class="ident">contribution</span>.<span class="ident">finalize</span>()<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">policy</span>: <span class="ident">Policy</span> <span class="op">=</span> <span class="ident">SatisfiableItem</span>::<span class="ident">Thresh</span> { <span class="ident">items</span>, <span class="ident">threshold</span> }.<span class="ident">into</span>();
+ <span class="ident">policy</span>.<span class="ident">contribution</span> <span class="op">=</span> <span class="ident">contribution</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">policy</span>))
+ }
+
+ <span class="kw">fn</span> <span class="ident">make_multisig</span>(
+ <span class="ident">keys</span>: <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span>,
+ <span class="ident">signers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span><span class="op">></span>,
+ <span class="ident">threshold</span>: <span class="ident">usize</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">PolicyError</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="ident">threshold</span> <span class="op">=</span><span class="op">=</span> <span class="number">0</span> {
+ <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>);
+ }
+
+ <span class="kw">let</span> <span class="ident">parsed_keys</span> <span class="op">=</span> <span class="ident">keys</span>.<span class="ident">iter</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">k</span><span class="op">|</span> <span class="ident">PKOrF</span>::<span class="ident">from_key</span>(<span class="ident">k</span>)).<span class="ident">collect</span>();
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">contribution</span> <span class="op">=</span> <span class="ident">Satisfaction</span>::<span class="ident">Partial</span> {
+ <span class="ident">n</span>: <span class="ident">keys</span>.<span class="ident">len</span>(),
+ <span class="ident">m</span>: <span class="ident">threshold</span>,
+ <span class="ident">items</span>: <span class="macro">vec</span><span class="macro">!</span>[],
+ <span class="ident">conditions</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ };
+ <span class="kw">for</span> (<span class="ident">index</span>, <span class="ident">key</span>) <span class="kw">in</span> <span class="ident">keys</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="kw">_</span>) <span class="op">=</span> <span class="ident">signers</span>.<span class="ident">find</span>(<span class="ident">signer_id</span>(<span class="ident">key</span>)) {
+ <span class="ident">contribution</span>.<span class="ident">add</span>(
+ <span class="kw-2">&</span><span class="ident">Satisfaction</span>::<span class="ident">Complete</span> {
+ <span class="ident">condition</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ },
+ <span class="ident">index</span>,
+ )<span class="question-mark">?</span>;
+ }
+ }
+ <span class="ident">contribution</span>.<span class="ident">finalize</span>()<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">policy</span>: <span class="ident">Policy</span> <span class="op">=</span> <span class="ident">SatisfiableItem</span>::<span class="ident">Multisig</span> {
+ <span class="ident">keys</span>: <span class="ident">parsed_keys</span>,
+ <span class="ident">threshold</span>,
+ }
+ .<span class="ident">into</span>();
+ <span class="ident">policy</span>.<span class="ident">contribution</span> <span class="op">=</span> <span class="ident">contribution</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">policy</span>))
+ }
+
+ <span class="doccomment">/// Return whether or not a specific path in the policy tree is required to unambiguously</span>
+ <span class="doccomment">/// create a transaction</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// What this means is that for some spending policies the user should select which paths in</span>
+ <span class="doccomment">/// the tree it intends to satisfy while signing, because the transaction must be created differently based</span>
+ <span class="doccomment">/// on that.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">requires_path</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="self">self</span>.<span class="ident">get_condition</span>(<span class="kw-2">&</span><span class="ident">BTreeMap</span>::<span class="ident">new</span>()).<span class="ident">is_err</span>()
+ }
+
+ <span class="doccomment">/// Return the conditions that are set by the spending policy for a given path in the</span>
+ <span class="doccomment">/// policy tree</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_condition</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">path</span>: <span class="kw-2">&</span><span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Condition</span>, <span class="ident">PolicyError</span><span class="op">></span> {
+ <span class="comment">// if items.len() == threshold, selected can be omitted and we take all of them by default</span>
+ <span class="kw">let</span> <span class="ident">default</span> <span class="op">=</span> <span class="kw">match</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">item</span> {
+ <span class="ident">SatisfiableItem</span>::<span class="ident">Thresh</span> { <span class="ident">items</span>, <span class="ident">threshold</span> } <span class="kw">if</span> <span class="ident">items</span>.<span class="ident">len</span>() <span class="op">=</span><span class="op">=</span> <span class="kw-2">*</span><span class="ident">threshold</span> <span class="op">=</span><span class="op">></span> {
+ (<span class="number">0</span>..<span class="kw-2">*</span><span class="ident">threshold</span>).<span class="ident">into_iter</span>().<span class="ident">collect</span>()
+ }
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="macro">vec</span><span class="macro">!</span>[],
+ };
+ <span class="kw">let</span> <span class="ident">selected</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">path</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">id</span>) {
+ <span class="kw">_</span> <span class="kw">if</span> <span class="op">!</span><span class="ident">default</span>.<span class="ident">is_empty</span>() <span class="op">=</span><span class="op">></span> <span class="kw-2">&</span><span class="ident">default</span>,
+ <span class="prelude-val">Some</span>(<span class="ident">arr</span>) <span class="op">=</span><span class="op">></span> <span class="ident">arr</span>,
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="kw-2">&</span><span class="ident">default</span>,
+ };
+
+ <span class="kw">match</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">item</span> {
+ <span class="ident">SatisfiableItem</span>::<span class="ident">Thresh</span> { <span class="ident">items</span>, <span class="ident">threshold</span> } <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">mapped_req</span> <span class="op">=</span> <span class="ident">items</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> <span class="ident">i</span>.<span class="ident">get_condition</span>(<span class="ident">path</span>))
+ .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()<span class="question-mark">?</span>;
+
+ <span class="comment">// if all the requirements are null we don't care about `selected` because there</span>
+ <span class="comment">// are no requirements</span>
+ <span class="kw">if</span> <span class="ident">mapped_req</span>.<span class="ident">iter</span>().<span class="ident">all</span>(<span class="ident">Condition</span>::<span class="ident">is_null</span>) {
+ <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="ident">Condition</span>::<span class="ident">default</span>());
+ }
+
+ <span class="comment">// if we have something, make sure we have enough items. note that the user can set</span>
+ <span class="comment">// an empty value for this step in case of n-of-n, because `selected` is set to all</span>
+ <span class="comment">// the elements above</span>
+ <span class="kw">if</span> <span class="ident">selected</span>.<span class="ident">len</span>() <span class="op"><</span> <span class="kw-2">*</span><span class="ident">threshold</span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">PolicyError</span>::<span class="ident">NotEnoughItemsSelected</span>(<span class="self">self</span>.<span class="ident">id</span>.<span class="ident">clone</span>()));
+ } <span class="kw">else</span> <span class="kw">if</span> <span class="ident">selected</span>.<span class="ident">len</span>() <span class="op">></span> <span class="kw-2">*</span><span class="ident">threshold</span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">PolicyError</span>::<span class="ident">TooManyItemsSelected</span>(<span class="self">self</span>.<span class="ident">id</span>.<span class="ident">clone</span>()));
+ }
+
+ <span class="comment">// check the selected items, see if there are conflicting requirements</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">requirements</span> <span class="op">=</span> <span class="ident">Condition</span>::<span class="ident">default</span>();
+ <span class="kw">for</span> <span class="ident">item_index</span> <span class="kw">in</span> <span class="ident">selected</span> {
+ <span class="ident">requirements</span> <span class="op">=</span> <span class="ident">requirements</span>.<span class="ident">merge</span>(
+ <span class="ident">mapped_req</span>
+ .<span class="ident">get</span>(<span class="kw-2">*</span><span class="ident">item_index</span>)
+ .<span class="ident">ok_or</span>(<span class="ident">PolicyError</span>::<span class="ident">IndexOutOfRange</span>(<span class="kw-2">*</span><span class="ident">item_index</span>))<span class="question-mark">?</span>,
+ )<span class="question-mark">?</span>;
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">requirements</span>)
+ }
+ <span class="kw">_</span> <span class="kw">if</span> <span class="op">!</span><span class="ident">selected</span>.<span class="ident">is_empty</span>() <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="ident">PolicyError</span>::<span class="ident">TooManyItemsSelected</span>(<span class="self">self</span>.<span class="ident">id</span>.<span class="ident">clone</span>())),
+ <span class="ident">SatisfiableItem</span>::<span class="ident">AbsoluteTimelock</span> { <span class="ident">value</span> } <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">Condition</span> {
+ <span class="ident">csv</span>: <span class="prelude-val">None</span>,
+ <span class="ident">timelock</span>: <span class="prelude-val">Some</span>(<span class="kw-2">*</span><span class="ident">value</span>),
+ }),
+ <span class="ident">SatisfiableItem</span>::<span class="ident">RelativeTimelock</span> { <span class="ident">value</span> } <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">Condition</span> {
+ <span class="ident">csv</span>: <span class="prelude-val">Some</span>(<span class="kw-2">*</span><span class="ident">value</span>),
+ <span class="ident">timelock</span>: <span class="prelude-val">None</span>,
+ }),
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">Condition</span>::<span class="ident">default</span>()),
+ }
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">SatisfiableItem</span><span class="op">></span> <span class="kw">for</span> <span class="ident">Policy</span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">other</span>: <span class="ident">SatisfiableItem</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">Self</span>::<span class="ident">new</span>(<span class="ident">other</span>)
+ }
+}
+
+<span class="kw">fn</span> <span class="ident">signer_id</span>(<span class="ident">key</span>: <span class="kw-2">&</span><span class="ident">DescriptorPublicKey</span>) <span class="op">-</span><span class="op">></span> <span class="ident">SignerId</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
+ <span class="kw">match</span> <span class="ident">key</span> {
+ <span class="ident">DescriptorPublicKey</span>::<span class="ident">PubKey</span>(<span class="ident">pubkey</span>) <span class="op">=</span><span class="op">></span> <span class="ident">pubkey</span>.<span class="ident">to_pubkeyhash</span>().<span class="ident">into</span>(),
+ <span class="ident">DescriptorPublicKey</span>::<span class="ident">XPub</span>(<span class="ident">xpub</span>) <span class="op">=</span><span class="op">></span> <span class="ident">xpub</span>.<span class="ident">root_fingerprint</span>().<span class="ident">into</span>(),
+ }
+}
+
+<span class="kw">fn</span> <span class="ident">signature</span>(
+ <span class="ident">key</span>: <span class="kw-2">&</span><span class="ident">DescriptorPublicKey</span>,
+ <span class="ident">signers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span><span class="op">></span>,
+) <span class="op">-</span><span class="op">></span> <span class="ident">Policy</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">policy</span>: <span class="ident">Policy</span> <span class="op">=</span> <span class="ident">SatisfiableItem</span>::<span class="ident">Signature</span>(<span class="ident">PKOrF</span>::<span class="ident">from_key</span>(<span class="ident">key</span>)).<span class="ident">into</span>();
+
+ <span class="ident">policy</span>.<span class="ident">contribution</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">signers</span>.<span class="ident">find</span>(<span class="ident">signer_id</span>(<span class="ident">key</span>)).<span class="ident">is_some</span>() {
+ <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> {
+ <span class="ident">condition</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ }
+ } <span class="kw">else</span> {
+ <span class="ident">Satisfaction</span>::<span class="prelude-val">None</span>
+ };
+
+ <span class="ident">policy</span>
+}
+
+<span class="kw">fn</span> <span class="ident">signature_key</span>(
+ <span class="ident">key_hash</span>: <span class="kw-2">&</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span> <span class="kw">as</span> <span class="ident">MiniscriptKey</span><span class="op">></span>::<span class="ident">Hash</span>,
+ <span class="ident">signers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span><span class="op">></span>,
+) <span class="op">-</span><span class="op">></span> <span class="ident">Policy</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">policy</span>: <span class="ident">Policy</span> <span class="op">=</span> <span class="ident">SatisfiableItem</span>::<span class="ident">Signature</span>(<span class="ident">PKOrF</span>::<span class="ident">from_key_hash</span>(<span class="kw-2">*</span><span class="ident">key_hash</span>)).<span class="ident">into</span>();
+
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="kw">_</span>) <span class="op">=</span> <span class="ident">signers</span>.<span class="ident">find</span>(<span class="ident">SignerId</span>::<span class="ident">PkHash</span>(<span class="kw-2">*</span><span class="ident">key_hash</span>)) {
+ <span class="ident">policy</span>.<span class="ident">contribution</span> <span class="op">=</span> <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> {
+ <span class="ident">condition</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ }
+ }
+
+ <span class="ident">policy</span>
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span> <span class="ident">ExtractPolicy</span> <span class="kw">for</span> <span class="ident">Miniscript</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span>, <span class="ident">Ctx</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">extract_policy</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">signers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="kw">match</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">node</span> {
+ <span class="comment">// Leaves</span>
+ <span class="ident">Terminal</span>::<span class="ident">True</span> <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">False</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
+ <span class="ident">Terminal</span>::<span class="ident">PkK</span>(<span class="ident">pubkey</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">signature</span>(<span class="ident">pubkey</span>, <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))),
+ <span class="ident">Terminal</span>::<span class="ident">PkH</span>(<span class="ident">pubkey_hash</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">signature_key</span>(<span class="ident">pubkey_hash</span>, <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))),
+ <span class="ident">Terminal</span>::<span class="ident">After</span>(<span class="ident">value</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">policy</span>: <span class="ident">Policy</span> <span class="op">=</span> <span class="ident">SatisfiableItem</span>::<span class="ident">AbsoluteTimelock</span> { <span class="ident">value</span>: <span class="kw-2">*</span><span class="ident">value</span> }.<span class="ident">into</span>();
+ <span class="ident">policy</span>.<span class="ident">contribution</span> <span class="op">=</span> <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> {
+ <span class="ident">condition</span>: <span class="ident">Condition</span> {
+ <span class="ident">timelock</span>: <span class="prelude-val">Some</span>(<span class="kw-2">*</span><span class="ident">value</span>),
+ <span class="ident">csv</span>: <span class="prelude-val">None</span>,
+ },
+ };
+
+ <span class="prelude-val">Some</span>(<span class="ident">policy</span>)
+ }
+ <span class="ident">Terminal</span>::<span class="ident">Older</span>(<span class="ident">value</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">policy</span>: <span class="ident">Policy</span> <span class="op">=</span> <span class="ident">SatisfiableItem</span>::<span class="ident">RelativeTimelock</span> { <span class="ident">value</span>: <span class="kw-2">*</span><span class="ident">value</span> }.<span class="ident">into</span>();
+ <span class="ident">policy</span>.<span class="ident">contribution</span> <span class="op">=</span> <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> {
+ <span class="ident">condition</span>: <span class="ident">Condition</span> {
+ <span class="ident">timelock</span>: <span class="prelude-val">None</span>,
+ <span class="ident">csv</span>: <span class="prelude-val">Some</span>(<span class="kw-2">*</span><span class="ident">value</span>),
+ },
+ };
+
+ <span class="prelude-val">Some</span>(<span class="ident">policy</span>)
+ }
+ <span class="ident">Terminal</span>::<span class="ident">Sha256</span>(<span class="ident">hash</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">SatisfiableItem</span>::<span class="ident">SHA256Preimage</span> { <span class="ident">hash</span>: <span class="kw-2">*</span><span class="ident">hash</span> }.<span class="ident">into</span>()),
+ <span class="ident">Terminal</span>::<span class="ident">Hash256</span>(<span class="ident">hash</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="prelude-val">Some</span>(<span class="ident">SatisfiableItem</span>::<span class="ident">HASH256Preimage</span> { <span class="ident">hash</span>: <span class="kw-2">*</span><span class="ident">hash</span> }.<span class="ident">into</span>())
+ }
+ <span class="ident">Terminal</span>::<span class="ident">Ripemd160</span>(<span class="ident">hash</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="prelude-val">Some</span>(<span class="ident">SatisfiableItem</span>::<span class="ident">RIPEMD160Preimage</span> { <span class="ident">hash</span>: <span class="kw-2">*</span><span class="ident">hash</span> }.<span class="ident">into</span>())
+ }
+ <span class="ident">Terminal</span>::<span class="ident">Hash160</span>(<span class="ident">hash</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="prelude-val">Some</span>(<span class="ident">SatisfiableItem</span>::<span class="ident">HASH160Preimage</span> { <span class="ident">hash</span>: <span class="kw-2">*</span><span class="ident">hash</span> }.<span class="ident">into</span>())
+ }
+ <span class="ident">Terminal</span>::<span class="ident">Multi</span>(<span class="ident">k</span>, <span class="ident">pks</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Policy</span>::<span class="ident">make_multisig</span>(<span class="ident">pks</span>, <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>), <span class="kw-2">*</span><span class="ident">k</span>)<span class="question-mark">?</span>,
+ <span class="comment">// Identities</span>
+ <span class="ident">Terminal</span>::<span class="ident">Alt</span>(<span class="ident">inner</span>)
+ <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">Swap</span>(<span class="ident">inner</span>)
+ <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">Check</span>(<span class="ident">inner</span>)
+ <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">DupIf</span>(<span class="ident">inner</span>)
+ <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">Verify</span>(<span class="ident">inner</span>)
+ <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">NonZero</span>(<span class="ident">inner</span>)
+ <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">ZeroNotEqual</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="ident">inner</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))<span class="question-mark">?</span>,
+ <span class="comment">// Complex policies</span>
+ <span class="ident">Terminal</span>::<span class="ident">AndV</span>(<span class="ident">a</span>, <span class="ident">b</span>) <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">AndB</span>(<span class="ident">a</span>, <span class="ident">b</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Policy</span>::<span class="ident">make_and</span>(
+ <span class="ident">a</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))<span class="question-mark">?</span>,
+ <span class="ident">b</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))<span class="question-mark">?</span>,
+ )<span class="question-mark">?</span>,
+ <span class="ident">Terminal</span>::<span class="ident">AndOr</span>(<span class="ident">x</span>, <span class="ident">y</span>, <span class="ident">z</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Policy</span>::<span class="ident">make_or</span>(
+ <span class="ident">Policy</span>::<span class="ident">make_and</span>(
+ <span class="ident">x</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))<span class="question-mark">?</span>,
+ <span class="ident">y</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))<span class="question-mark">?</span>,
+ )<span class="question-mark">?</span>,
+ <span class="ident">z</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))<span class="question-mark">?</span>,
+ )<span class="question-mark">?</span>,
+ <span class="ident">Terminal</span>::<span class="ident">OrB</span>(<span class="ident">a</span>, <span class="ident">b</span>)
+ <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">OrD</span>(<span class="ident">a</span>, <span class="ident">b</span>)
+ <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">OrC</span>(<span class="ident">a</span>, <span class="ident">b</span>)
+ <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">OrI</span>(<span class="ident">a</span>, <span class="ident">b</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Policy</span>::<span class="ident">make_or</span>(
+ <span class="ident">a</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))<span class="question-mark">?</span>,
+ <span class="ident">b</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))<span class="question-mark">?</span>,
+ )<span class="question-mark">?</span>,
+ <span class="ident">Terminal</span>::<span class="ident">Thresh</span>(<span class="ident">k</span>, <span class="ident">nodes</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">threshold</span> <span class="op">=</span> <span class="kw-2">*</span><span class="ident">k</span>;
+ <span class="kw">let</span> <span class="ident">mapped</span>: <span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">nodes</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">n</span><span class="op">|</span> <span class="ident">n</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>)))
+ .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()<span class="question-mark">?</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">filter_map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span>)
+ .<span class="ident">collect</span>();
+
+ <span class="kw">if</span> <span class="ident">mapped</span>.<span class="ident">len</span>() <span class="op"><</span> <span class="ident">nodes</span>.<span class="ident">len</span>() {
+ <span class="ident">threshold</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">threshold</span>.<span class="ident">checked_sub</span>(<span class="ident">nodes</span>.<span class="ident">len</span>() <span class="op">-</span> <span class="ident">mapped</span>.<span class="ident">len</span>()) {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="op">=</span><span class="op">></span> <span class="ident">x</span>,
+ };
+ }
+
+ <span class="ident">Policy</span>::<span class="ident">make_thresh</span>(<span class="ident">mapped</span>, <span class="ident">threshold</span>)<span class="question-mark">?</span>
+ }
+ })
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">ExtractPolicy</span> <span class="kw">for</span> <span class="ident">Descriptor</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">extract_policy</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">signers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">Descriptor</span>::<span class="ident">Pk</span>(<span class="ident">pubkey</span>)
+ <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Pkh</span>(<span class="ident">pubkey</span>)
+ <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Wpkh</span>(<span class="ident">pubkey</span>)
+ <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWpkh</span>(<span class="ident">pubkey</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">signature</span>(<span class="ident">pubkey</span>, <span class="ident">signers</span>))),
+ <span class="ident">Descriptor</span>::<span class="ident">Bare</span>(<span class="ident">inner</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Sh</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">inner</span>.<span class="ident">extract_policy</span>(<span class="ident">signers</span>)<span class="question-mark">?</span>),
+ <span class="ident">Descriptor</span>::<span class="ident">Wsh</span>(<span class="ident">inner</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWsh</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">inner</span>.<span class="ident">extract_policy</span>(<span class="ident">signers</span>)<span class="question-mark">?</span>),
+ }
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/error.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>error.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Address</span>, <span class="ident">OutPoint</span>};
+
+<span class="doccomment">/// Errors that can be thrown by the [`Wallet`](crate::wallet::Wallet)</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">Error</span> {
+ <span class="ident">KeyMismatch</span>(<span class="ident">bitcoin</span>::<span class="ident">secp256k1</span>::<span class="ident">PublicKey</span>, <span class="ident">bitcoin</span>::<span class="ident">secp256k1</span>::<span class="ident">PublicKey</span>),
+ <span class="ident">MissingInputUTXO</span>(<span class="ident">usize</span>),
+ <span class="ident">InvalidU32Bytes</span>(<span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>),
+ <span class="ident">Generic</span>(<span class="ident">String</span>),
+ <span class="ident">ScriptDoesntHaveAddressForm</span>,
+ <span class="ident">SendAllMultipleOutputs</span>,
+ <span class="ident">NoAddressees</span>,
+ <span class="ident">OutputBelowDustLimit</span>(<span class="ident">usize</span>),
+ <span class="ident">InsufficientFunds</span>,
+ <span class="ident">InvalidAddressNetwork</span>(<span class="ident">Address</span>),
+ <span class="ident">UnknownUTXO</span>,
+ <span class="ident">DifferentTransactions</span>,
+ <span class="ident">TransactionNotFound</span>,
+ <span class="ident">TransactionConfirmed</span>,
+ <span class="ident">IrreplaceableTransaction</span>,
+ <span class="ident">FeeRateTooLow</span> {
+ <span class="ident">required</span>: <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">FeeRate</span>,
+ },
+
+ <span class="ident">ChecksumMismatch</span>,
+ <span class="ident">DifferentDescriptorStructure</span>,
+
+ <span class="ident">SpendingPolicyRequired</span>,
+ <span class="ident">InvalidPolicyPathError</span>(<span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">policy</span>::<span class="ident">PolicyError</span>),
+
+ <span class="ident">Signer</span>(<span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">signer</span>::<span class="ident">SignerError</span>),
+
+ <span class="comment">// Blockchain interface errors</span>
+ <span class="ident">Uncapable</span>(<span class="kw">crate</span>::<span class="ident">blockchain</span>::<span class="ident">Capability</span>),
+ <span class="ident">OfflineClient</span>,
+ <span class="ident">InvalidProgressValue</span>(<span class="ident">f32</span>),
+ <span class="ident">ProgressUpdateError</span>,
+ <span class="ident">MissingCachedAddresses</span>,
+ <span class="ident">InvalidOutpoint</span>(<span class="ident">OutPoint</span>),
+
+ <span class="ident">Descriptor</span>(<span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">error</span>::<span class="ident">Error</span>),
+ <span class="ident">AddressValidator</span>(<span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">address_validator</span>::<span class="ident">AddressValidatorError</span>),
+
+ <span class="ident">Encode</span>(<span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span>),
+ <span class="ident">Miniscript</span>(<span class="ident">miniscript</span>::<span class="ident">Error</span>),
+ <span class="ident">BIP32</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">Error</span>),
+ <span class="ident">Secp256k1</span>(<span class="ident">bitcoin</span>::<span class="ident">secp256k1</span>::<span class="ident">Error</span>),
+ <span class="ident">JSON</span>(<span class="ident">serde_json</span>::<span class="ident">Error</span>),
+ <span class="ident">Hex</span>(<span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">Error</span>),
+ <span class="ident">PSBT</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">psbt</span>::<span class="ident">Error</span>),
+
+ <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"electrum"</span>)]</span>
+ <span class="ident">Electrum</span>(<span class="ident">electrum_client</span>::<span class="ident">Error</span>),
+ <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"esplora"</span>)]</span>
+ <span class="ident">Esplora</span>(<span class="kw">crate</span>::<span class="ident">blockchain</span>::<span class="ident">esplora</span>::<span class="ident">EsploraError</span>),
+ <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"compact_filters"</span>)]</span>
+ <span class="ident">CompactFilters</span>(<span class="kw">crate</span>::<span class="ident">blockchain</span>::<span class="ident">compact_filters</span>::<span class="ident">CompactFiltersError</span>),
+ <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"key-value-db"</span>)]</span>
+ <span class="ident">Sled</span>(<span class="ident">sled</span>::<span class="ident">Error</span>),
+}
+
+<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">Error</span> {
+ <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
+ <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"{:?}"</span>, <span class="self">self</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span> <span class="kw">for</span> <span class="ident">Error</span> {}
+
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_error</span> {
+ ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">from</span>:<span class="ident">ty</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">to</span>:<span class="ident">ident</span> ) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">convert</span>::<span class="ident">From</span><span class="op"><</span><span class="macro-nonterminal">$</span><span class="macro-nonterminal">from</span><span class="op">></span> <span class="kw">for</span> <span class="ident">Error</span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">err</span>: <span class="macro-nonterminal">$</span><span class="macro-nonterminal">from</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">Error</span>::<span class="macro-nonterminal">$</span><span class="macro-nonterminal">to</span>(<span class="ident">err</span>)
+ }
+ }
+ };
+}
+
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">error</span>::<span class="ident">Error</span>, <span class="ident">Descriptor</span>);
+<span class="macro">impl_error</span><span class="macro">!</span>(
+ <span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">address_validator</span>::<span class="ident">AddressValidatorError</span>,
+ <span class="ident">AddressValidator</span>
+);
+<span class="macro">impl_error</span><span class="macro">!</span>(
+ <span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">policy</span>::<span class="ident">PolicyError</span>,
+ <span class="ident">InvalidPolicyPathError</span>
+);
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">signer</span>::<span class="ident">SignerError</span>, <span class="ident">Signer</span>);
+
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span>, <span class="ident">Encode</span>);
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">miniscript</span>::<span class="ident">Error</span>, <span class="ident">Miniscript</span>);
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">Error</span>, <span class="ident">BIP32</span>);
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">secp256k1</span>::<span class="ident">Error</span>, <span class="ident">Secp256k1</span>);
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">serde_json</span>::<span class="ident">Error</span>, <span class="ident">JSON</span>);
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">Error</span>, <span class="ident">Hex</span>);
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">psbt</span>::<span class="ident">Error</span>, <span class="ident">PSBT</span>);
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"electrum"</span>)]</span>
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">electrum_client</span>::<span class="ident">Error</span>, <span class="ident">Electrum</span>);
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"esplora"</span>)]</span>
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="kw">crate</span>::<span class="ident">blockchain</span>::<span class="ident">esplora</span>::<span class="ident">EsploraError</span>, <span class="ident">Esplora</span>);
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"key-value-db"</span>)]</span>
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">sled</span>::<span class="ident">Error</span>, <span class="ident">Sled</span>);
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"compact_filters"</span>)]</span>
+<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="kw">crate</span>::<span class="ident">blockchain</span>::<span class="ident">compact_filters</span>::<span class="ident">CompactFiltersError</span><span class="op">></span> <span class="kw">for</span> <span class="ident">Error</span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">other</span>: <span class="kw">crate</span>::<span class="ident">blockchain</span>::<span class="ident">compact_filters</span>::<span class="ident">CompactFiltersError</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="kw">match</span> <span class="ident">other</span> {
+ <span class="kw">crate</span>::<span class="ident">blockchain</span>::<span class="ident">compact_filters</span>::<span class="ident">CompactFiltersError</span>::<span class="ident">Global</span>(<span class="ident">e</span>) <span class="op">=</span><span class="op">></span> <span class="kw-2">*</span><span class="ident">e</span>,
+ <span class="ident">err</span> @ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="ident">Error</span>::<span class="ident">CompactFilters</span>(<span class="ident">err</span>),
+ }
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/lib.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>lib.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10">10</span>
+<span id="11">11</span>
+<span id="12">12</span>
+<span id="13">13</span>
+<span id="14">14</span>
+<span id="15">15</span>
+<span id="16">16</span>
+<span id="17">17</span>
+<span id="18">18</span>
+<span id="19">19</span>
+<span id="20">20</span>
+<span id="21">21</span>
+<span id="22">22</span>
+<span id="23">23</span>
+<span id="24">24</span>
+<span id="25">25</span>
+<span id="26">26</span>
+<span id="27">27</span>
+<span id="28">28</span>
+<span id="29">29</span>
+<span id="30">30</span>
+<span id="31">31</span>
+<span id="32">32</span>
+<span id="33">33</span>
+<span id="34">34</span>
+<span id="35">35</span>
+<span id="36">36</span>
+<span id="37">37</span>
+<span id="38">38</span>
+<span id="39">39</span>
+<span id="40">40</span>
+<span id="41">41</span>
+<span id="42">42</span>
+<span id="43">43</span>
+<span id="44">44</span>
+<span id="45">45</span>
+<span id="46">46</span>
+<span id="47">47</span>
+<span id="48">48</span>
+<span id="49">49</span>
+<span id="50">50</span>
+<span id="51">51</span>
+<span id="52">52</span>
+<span id="53">53</span>
+<span id="54">54</span>
+<span id="55">55</span>
+<span id="56">56</span>
+<span id="57">57</span>
+<span id="58">58</span>
+<span id="59">59</span>
+<span id="60">60</span>
+<span id="61">61</span>
+<span id="62">62</span>
+<span id="63">63</span>
+<span id="64">64</span>
+<span id="65">65</span>
+<span id="66">66</span>
+<span id="67">67</span>
+<span id="68">68</span>
+<span id="69">69</span>
+<span id="70">70</span>
+<span id="71">71</span>
+<span id="72">72</span>
+<span id="73">73</span>
+<span id="74">74</span>
+<span id="75">75</span>
+<span id="76">76</span>
+<span id="77">77</span>
+<span id="78">78</span>
+<span id="79">79</span>
+<span id="80">80</span>
+<span id="81">81</span>
+<span id="82">82</span>
+<span id="83">83</span>
+<span id="84">84</span>
+<span id="85">85</span>
+<span id="86">86</span>
+<span id="87">87</span>
+<span id="88">88</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="comment">// only enables the `doc_cfg` feature when</span>
+<span class="comment">// the `docsrs` configuration attribute is defined</span>
+<span class="attribute">#![<span class="ident">cfg_attr</span>(<span class="ident">docsrs</span>, <span class="ident">feature</span>(<span class="ident">doc_cfg</span>))]</span>
+<span class="comment">// only enables the nightly `external_doc` feature when</span>
+<span class="comment">// `test-md-docs` is enabled</span>
+<span class="attribute">#![<span class="ident">cfg_attr</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"test-md-docs"</span>, <span class="ident">feature</span>(<span class="ident">external_doc</span>))]</span>
+
+<span class="kw">pub</span> <span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">bitcoin</span>;
+<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">log</span>;
+<span class="kw">pub</span> <span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">miniscript</span>;
+<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">serde</span>;
+<span class="attribute">#[<span class="ident">macro_use</span>]</span>
+<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">serde_json</span>;
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">any</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>, <span class="ident">feature</span> <span class="op">=</span> <span class="string">"async-interface"</span>))]</span>
+<span class="attribute">#[<span class="ident">macro_use</span>]</span>
+<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">async_trait</span>;
+<span class="attribute">#[<span class="ident">macro_use</span>]</span>
+<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">bdk_macros</span>;
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">any</span>(<span class="ident">test</span>, <span class="ident">feature</span> <span class="op">=</span> <span class="string">"compact_filters"</span>))]</span>
+<span class="attribute">#[<span class="ident">macro_use</span>]</span>
+<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">lazy_static</span>;
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"electrum"</span>)]</span>
+<span class="kw">pub</span> <span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">electrum_client</span>;
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"esplora"</span>)]</span>
+<span class="kw">pub</span> <span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">reqwest</span>;
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"key-value-db"</span>)]</span>
+<span class="kw">pub</span> <span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">sled</span>;
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"cli-utils"</span>)]</span>
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">cli</span>;
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="attribute">#[<span class="ident">macro_use</span>]</span>
+<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">testutils</span>;
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="attribute">#[<span class="ident">macro_use</span>]</span>
+<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">testutils_macros</span>;
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="attribute">#[<span class="ident">macro_use</span>]</span>
+<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">serial_test</span>;
+
+<span class="attribute">#[<span class="ident">macro_use</span>]</span>
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">mod</span> <span class="ident">error</span>;
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">blockchain</span>;
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">database</span>;
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">descriptor</span>;
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"test-md-docs"</span>)]</span>
+<span class="kw">mod</span> <span class="ident">doctest</span>;
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">mod</span> <span class="ident">psbt</span>;
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">mod</span> <span class="ident">types</span>;
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">wallet</span>;
+
+<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">descriptor</span>::<span class="ident">HDKeyPaths</span>;
+<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">error</span>::<span class="ident">Error</span>;
+<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">types</span>::<span class="kw-2">*</span>;
+<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">wallet</span>::<span class="ident">address_validator</span>;
+<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">wallet</span>::<span class="ident">signer</span>;
+<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">wallet</span>::<span class="ident">tx_builder</span>::<span class="ident">TxBuilder</span>;
+<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">wallet</span>::{<span class="ident">OfflineWallet</span>, <span class="ident">Wallet</span>};
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/psbt/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10">10</span>
+<span id="11">11</span>
+<span id="12">12</span>
+<span id="13">13</span>
+<span id="14">14</span>
+<span id="15">15</span>
+<span id="16">16</span>
+<span id="17">17</span>
+<span id="18">18</span>
+<span id="19">19</span>
+<span id="20">20</span>
+<span id="21">21</span>
+<span id="22">22</span>
+<span id="23">23</span>
+<span id="24">24</span>
+<span id="25">25</span>
+<span id="26">26</span>
+<span id="27">27</span>
+<span id="28">28</span>
+<span id="29">29</span>
+<span id="30">30</span>
+<span id="31">31</span>
+<span id="32">32</span>
+<span id="33">33</span>
+<span id="34">34</span>
+<span id="35">35</span>
+<span id="36">36</span>
+<span id="37">37</span>
+<span id="38">38</span>
+<span id="39">39</span>
+<span id="40">40</span>
+<span id="41">41</span>
+<span id="42">42</span>
+<span id="43">43</span>
+<span id="44">44</span>
+<span id="45">45</span>
+<span id="46">46</span>
+<span id="47">47</span>
+<span id="48">48</span>
+<span id="49">49</span>
+<span id="50">50</span>
+<span id="51">51</span>
+<span id="52">52</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span> <span class="kw">as</span> <span class="ident">PSBT</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">TxOut</span>;
+
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">PSBTUtils</span> {
+ <span class="kw">fn</span> <span class="ident">get_utxo_for</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">input_index</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TxOut</span><span class="op">></span>;
+}
+
+<span class="kw">impl</span> <span class="ident">PSBTUtils</span> <span class="kw">for</span> <span class="ident">PSBT</span> {
+ <span class="kw">fn</span> <span class="ident">get_utxo_for</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">input_index</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TxOut</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>;
+
+ <span class="kw">if</span> <span class="ident">input_index</span> <span class="op">></span><span class="op">=</span> <span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">len</span>() {
+ <span class="kw">return</span> <span class="prelude-val">None</span>;
+ }
+
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">input</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">inputs</span>.<span class="ident">get</span>(<span class="ident">input_index</span>) {
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">wit_utxo</span>) <span class="op">=</span> <span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">witness_utxo</span> {
+ <span class="prelude-val">Some</span>(<span class="ident">wit_utxo</span>.<span class="ident">clone</span>())
+ } <span class="kw">else</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">in_tx</span>) <span class="op">=</span> <span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">non_witness_utxo</span> {
+ <span class="prelude-val">Some</span>(<span class="ident">in_tx</span>.<span class="ident">output</span>[<span class="ident">tx</span>.<span class="ident">input</span>[<span class="ident">input_index</span>].<span class="ident">previous_output</span>.<span class="ident">vout</span> <span class="kw">as</span> <span class="ident">usize</span>].<span class="ident">clone</span>())
+ } <span class="kw">else</span> {
+ <span class="prelude-val">None</span>
+ }
+ } <span class="kw">else</span> {
+ <span class="prelude-val">None</span>
+ }
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/types.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>types.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../bdk/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">convert</span>::<span class="ident">AsRef</span>;
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">blockdata</span>::<span class="ident">transaction</span>::{<span class="ident">OutPoint</span>, <span class="ident">Transaction</span>, <span class="ident">TxOut</span>};
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hash_types</span>::<span class="ident">Txid</span>;
+
+<span class="kw">use</span> <span class="ident">serde</span>::{<span class="ident">Deserialize</span>, <span class="ident">Serialize</span>};
+
+<span class="doccomment">/// Types of script</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Serialize</span>, <span class="ident">Deserialize</span>, <span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">Copy</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>, <span class="ident">Hash</span>)]</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">ScriptType</span> {
+ <span class="ident">External</span> <span class="op">=</span> <span class="number">0</span>,
+ <span class="ident">Internal</span> <span class="op">=</span> <span class="number">1</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">ScriptType</span> {
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">as_byte</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">u8</span> {
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">ScriptType</span>::<span class="ident">External</span> <span class="op">=</span><span class="op">></span> <span class="string">'e'</span> <span class="kw">as</span> <span class="ident">u8</span>,
+ <span class="ident">ScriptType</span>::<span class="ident">Internal</span> <span class="op">=</span><span class="op">></span> <span class="string">'i'</span> <span class="kw">as</span> <span class="ident">u8</span>,
+ }
+ }
+
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_internal</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="self">self</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">ScriptType</span>::<span class="ident">Internal</span>
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">AsRef</span><span class="op"><</span>[<span class="ident">u8</span>]<span class="op">></span> <span class="kw">for</span> <span class="ident">ScriptType</span> {
+ <span class="kw">fn</span> <span class="ident">as_ref</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="kw-2">&</span>[<span class="ident">u8</span>] {
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">ScriptType</span>::<span class="ident">External</span> <span class="op">=</span><span class="op">></span> <span class="string">b"e"</span>,
+ <span class="ident">ScriptType</span>::<span class="ident">Internal</span> <span class="op">=</span><span class="op">></span> <span class="string">b"i"</span>,
+ }
+ }
+}
+
+<span class="doccomment">/// Fee rate</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Copy</span>, <span class="ident">Clone</span>, <span class="ident">PartialEq</span>, <span class="ident">PartialOrd</span>)]</span>
+<span class="comment">// Internally stored as satoshi/vbyte</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">FeeRate</span>(<span class="ident">f32</span>);
+
+<span class="kw">impl</span> <span class="ident">FeeRate</span> {
+ <span class="doccomment">/// Create a new instance of [`FeeRate`] given a float fee rate in btc/kvbytes</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">from_btc_per_kvb</span>(<span class="ident">btc_per_kvb</span>: <span class="ident">f32</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">FeeRate</span>(<span class="ident">btc_per_kvb</span> <span class="op">*</span> <span class="number">1e5</span>)
+ }
+
+ <span class="doccomment">/// Create a new instance of [`FeeRate`] given a float fee rate in satoshi/vbyte</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">from_sat_per_vb</span>(<span class="ident">sat_per_vb</span>: <span class="ident">f32</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">FeeRate</span>(<span class="ident">sat_per_vb</span>)
+ }
+
+ <span class="doccomment">/// Create a new [`FeeRate`] with the default min relay fee value</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">default_min_relay_fee</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">FeeRate</span>(<span class="number">1.0</span>)
+ }
+
+ <span class="doccomment">/// Return the value as satoshi/vbyte</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">as_sat_vb</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">f32</span> {
+ <span class="self">self</span>.<span class="number">0</span>
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">default</span>::<span class="ident">Default</span> <span class="kw">for</span> <span class="ident">FeeRate</span> {
+ <span class="kw">fn</span> <span class="ident">default</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">FeeRate</span>::<span class="ident">default_min_relay_fee</span>()
+ }
+}
+
+<span class="doccomment">/// A wallet unspent output</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Serialize</span>, <span class="ident">Deserialize</span>, <span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">UTXO</span> {
+ <span class="kw">pub</span> <span class="ident">outpoint</span>: <span class="ident">OutPoint</span>,
+ <span class="kw">pub</span> <span class="ident">txout</span>: <span class="ident">TxOut</span>,
+ <span class="kw">pub</span> <span class="ident">is_internal</span>: <span class="ident">bool</span>,
+}
+
+<span class="doccomment">/// A wallet transaction</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Serialize</span>, <span class="ident">Deserialize</span>, <span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>, <span class="ident">Default</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">TransactionDetails</span> {
+ <span class="kw">pub</span> <span class="ident">transaction</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>,
+ <span class="kw">pub</span> <span class="ident">txid</span>: <span class="ident">Txid</span>,
+ <span class="kw">pub</span> <span class="ident">timestamp</span>: <span class="ident">u64</span>,
+ <span class="kw">pub</span> <span class="ident">received</span>: <span class="ident">u64</span>,
+ <span class="kw">pub</span> <span class="ident">sent</span>: <span class="ident">u64</span>,
+ <span class="kw">pub</span> <span class="ident">fees</span>: <span class="ident">u64</span>,
+ <span class="kw">pub</span> <span class="ident">height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "bdk";</script><script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/wallet/address_validator.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>address_validator.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="doccomment">//! Address validation callbacks</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! The typical usage of those callbacks is for displaying the newly-generated address on a</span>
+<span class="doccomment">//! hardware wallet, so that the user can cross-check its correctness.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! More generally speaking though, these callbacks can also be used to "do something" every time</span>
+<span class="doccomment">//! an address is generated, without necessarily checking or validating it.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! An address validator can be attached to a [`Wallet`](super::Wallet) by using the</span>
+<span class="doccomment">//! [`Wallet::add_address_validator`](super::Wallet::add_address_validator) method, and</span>
+<span class="doccomment">//! whenever a new address is generated (either explicitly by the user with</span>
+<span class="doccomment">//! [`Wallet::get_new_address`](super::Wallet::get_new_address) or internally to create a change</span>
+<span class="doccomment">//! address) all the attached validators will be polled, in sequence. All of them must complete</span>
+<span class="doccomment">//! successfully to continue.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ## Example</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ```</span>
+<span class="doccomment">//! # use std::sync::Arc;</span>
+<span class="doccomment">//! # use bitcoin::*;</span>
+<span class="doccomment">//! # use bdk::address_validator::*;</span>
+<span class="doccomment">//! # use bdk::database::*;</span>
+<span class="doccomment">//! # use bdk::*;</span>
+<span class="doccomment">//! struct PrintAddressAndContinue;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! impl AddressValidator for PrintAddressAndContinue {</span>
+<span class="doccomment">//! fn validate(</span>
+<span class="doccomment">//! &self,</span>
+<span class="doccomment">//! script_type: ScriptType,</span>
+<span class="doccomment">//! hd_keypaths: &HDKeyPaths,</span>
+<span class="doccomment">//! script: &Script</span>
+<span class="doccomment">//! ) -> Result<(), AddressValidatorError> {</span>
+<span class="doccomment">//! let address = Address::from_script(script, Network::Testnet)</span>
+<span class="doccomment">//! .as_ref()</span>
+<span class="doccomment">//! .map(Address::to_string)</span>
+<span class="doccomment">//! .unwrap_or(script.to_string());</span>
+<span class="doccomment">//! println!("New address of type {:?}: {}", script_type, address);</span>
+<span class="doccomment">//! println!("HD keypaths: {:#?}", hd_keypaths);</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! Ok(())</span>
+<span class="doccomment">//! }</span>
+<span class="doccomment">//! }</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! let descriptor = "wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)";</span>
+<span class="doccomment">//! let mut wallet: OfflineWallet<_> = Wallet::new_offline(descriptor, None, Network::Testnet, MemoryDatabase::default())?;</span>
+<span class="doccomment">//! wallet.add_address_validator(Arc::new(Box::new(PrintAddressAndContinue)));</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! let address = wallet.get_new_address()?;</span>
+<span class="doccomment">//! println!("Address: {}", address);</span>
+<span class="doccomment">//! # Ok::<(), bdk::Error>(())</span>
+<span class="doccomment">//! ```</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">Script</span>;
+
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">HDKeyPaths</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">ScriptType</span>;
+
+<span class="doccomment">/// Errors that can be returned to fail the validation of an address</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>)]</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">AddressValidatorError</span> {
+ <span class="ident">UserRejected</span>,
+ <span class="ident">ConnectionError</span>,
+ <span class="ident">TimeoutError</span>,
+ <span class="ident">InvalidScript</span>,
+ <span class="ident">Message</span>(<span class="ident">String</span>),
+}
+
+<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">AddressValidatorError</span> {
+ <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
+ <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"{:?}"</span>, <span class="self">self</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span> <span class="kw">for</span> <span class="ident">AddressValidatorError</span> {}
+
+<span class="doccomment">/// Trait to build address validators</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// All the address validators attached to a wallet with [`Wallet::add_address_validator`](super::Wallet::add_address_validator) will be polled</span>
+<span class="doccomment">/// every time an address (external or internal) is generated by the wallet. Errors returned in the</span>
+<span class="doccomment">/// validator will be propagated up to the original caller that triggered the address generation.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// For a usage example see [this module](crate::address_validator)'s documentation.</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">AddressValidator</span> {
+ <span class="doccomment">/// Validate or inspect an address</span>
+ <span class="kw">fn</span> <span class="ident">validate</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
+ <span class="ident">hd_keypaths</span>: <span class="kw-2">&</span><span class="ident">HDKeyPaths</span>,
+ <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">AddressValidatorError</span><span class="op">></span>;
+}
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="kw">mod</span> <span class="ident">test</span> {
+ <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>;
+
+ <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">test</span>::{<span class="ident">get_funded_wallet</span>, <span class="ident">get_test_wpkh</span>};
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">TxBuilder</span>;
+
+ <span class="kw">struct</span> <span class="ident">TestValidator</span>;
+ <span class="kw">impl</span> <span class="ident">AddressValidator</span> <span class="kw">for</span> <span class="ident">TestValidator</span> {
+ <span class="kw">fn</span> <span class="ident">validate</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">_script_type</span>: <span class="ident">ScriptType</span>,
+ <span class="ident">_hd_keypaths</span>: <span class="kw-2">&</span><span class="ident">HDKeyPaths</span>,
+ <span class="ident">_script</span>: <span class="kw-2">&</span><span class="ident">bitcoin</span>::<span class="ident">Script</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">AddressValidatorError</span><span class="op">></span> {
+ <span class="prelude-val">Err</span>(<span class="ident">AddressValidatorError</span>::<span class="ident">InvalidScript</span>)
+ }
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"InvalidScript"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_address_validator_external</span>() {
+ <span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="ident">wallet</span>.<span class="ident">add_address_validator</span>(<span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">TestValidator</span>)));
+
+ <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"InvalidScript"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_address_validator_internal</span>() {
+ <span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">wallet</span>, <span class="ident">descriptors</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="ident">wallet</span>.<span class="ident">add_address_validator</span>(<span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">TestValidator</span>)));
+
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="macro">testutils</span><span class="macro">!</span>(@<span class="ident">external</span> <span class="ident">descriptors</span>, <span class="number">10</span>);
+ <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
+ <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
+ <span class="number">25_000</span>,
+ )]))
+ .<span class="ident">unwrap</span>();
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/wallet/coin_selection.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>coin_selection.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+<span id="163">163</span>
+<span id="164">164</span>
+<span id="165">165</span>
+<span id="166">166</span>
+<span id="167">167</span>
+<span id="168">168</span>
+<span id="169">169</span>
+<span id="170">170</span>
+<span id="171">171</span>
+<span id="172">172</span>
+<span id="173">173</span>
+<span id="174">174</span>
+<span id="175">175</span>
+<span id="176">176</span>
+<span id="177">177</span>
+<span id="178">178</span>
+<span id="179">179</span>
+<span id="180">180</span>
+<span id="181">181</span>
+<span id="182">182</span>
+<span id="183">183</span>
+<span id="184">184</span>
+<span id="185">185</span>
+<span id="186">186</span>
+<span id="187">187</span>
+<span id="188">188</span>
+<span id="189">189</span>
+<span id="190">190</span>
+<span id="191">191</span>
+<span id="192">192</span>
+<span id="193">193</span>
+<span id="194">194</span>
+<span id="195">195</span>
+<span id="196">196</span>
+<span id="197">197</span>
+<span id="198">198</span>
+<span id="199">199</span>
+<span id="200">200</span>
+<span id="201">201</span>
+<span id="202">202</span>
+<span id="203">203</span>
+<span id="204">204</span>
+<span id="205">205</span>
+<span id="206">206</span>
+<span id="207">207</span>
+<span id="208">208</span>
+<span id="209">209</span>
+<span id="210">210</span>
+<span id="211">211</span>
+<span id="212">212</span>
+<span id="213">213</span>
+<span id="214">214</span>
+<span id="215">215</span>
+<span id="216">216</span>
+<span id="217">217</span>
+<span id="218">218</span>
+<span id="219">219</span>
+<span id="220">220</span>
+<span id="221">221</span>
+<span id="222">222</span>
+<span id="223">223</span>
+<span id="224">224</span>
+<span id="225">225</span>
+<span id="226">226</span>
+<span id="227">227</span>
+<span id="228">228</span>
+<span id="229">229</span>
+<span id="230">230</span>
+<span id="231">231</span>
+<span id="232">232</span>
+<span id="233">233</span>
+<span id="234">234</span>
+<span id="235">235</span>
+<span id="236">236</span>
+<span id="237">237</span>
+<span id="238">238</span>
+<span id="239">239</span>
+<span id="240">240</span>
+<span id="241">241</span>
+<span id="242">242</span>
+<span id="243">243</span>
+<span id="244">244</span>
+<span id="245">245</span>
+<span id="246">246</span>
+<span id="247">247</span>
+<span id="248">248</span>
+<span id="249">249</span>
+<span id="250">250</span>
+<span id="251">251</span>
+<span id="252">252</span>
+<span id="253">253</span>
+<span id="254">254</span>
+<span id="255">255</span>
+<span id="256">256</span>
+<span id="257">257</span>
+<span id="258">258</span>
+<span id="259">259</span>
+<span id="260">260</span>
+<span id="261">261</span>
+<span id="262">262</span>
+<span id="263">263</span>
+<span id="264">264</span>
+<span id="265">265</span>
+<span id="266">266</span>
+<span id="267">267</span>
+<span id="268">268</span>
+<span id="269">269</span>
+<span id="270">270</span>
+<span id="271">271</span>
+<span id="272">272</span>
+<span id="273">273</span>
+<span id="274">274</span>
+<span id="275">275</span>
+<span id="276">276</span>
+<span id="277">277</span>
+<span id="278">278</span>
+<span id="279">279</span>
+<span id="280">280</span>
+<span id="281">281</span>
+<span id="282">282</span>
+<span id="283">283</span>
+<span id="284">284</span>
+<span id="285">285</span>
+<span id="286">286</span>
+<span id="287">287</span>
+<span id="288">288</span>
+<span id="289">289</span>
+<span id="290">290</span>
+<span id="291">291</span>
+<span id="292">292</span>
+<span id="293">293</span>
+<span id="294">294</span>
+<span id="295">295</span>
+<span id="296">296</span>
+<span id="297">297</span>
+<span id="298">298</span>
+<span id="299">299</span>
+<span id="300">300</span>
+<span id="301">301</span>
+<span id="302">302</span>
+<span id="303">303</span>
+<span id="304">304</span>
+<span id="305">305</span>
+<span id="306">306</span>
+<span id="307">307</span>
+<span id="308">308</span>
+<span id="309">309</span>
+<span id="310">310</span>
+<span id="311">311</span>
+<span id="312">312</span>
+<span id="313">313</span>
+<span id="314">314</span>
+<span id="315">315</span>
+<span id="316">316</span>
+<span id="317">317</span>
+<span id="318">318</span>
+<span id="319">319</span>
+<span id="320">320</span>
+<span id="321">321</span>
+<span id="322">322</span>
+<span id="323">323</span>
+<span id="324">324</span>
+<span id="325">325</span>
+<span id="326">326</span>
+<span id="327">327</span>
+<span id="328">328</span>
+<span id="329">329</span>
+<span id="330">330</span>
+<span id="331">331</span>
+<span id="332">332</span>
+<span id="333">333</span>
+<span id="334">334</span>
+<span id="335">335</span>
+<span id="336">336</span>
+<span id="337">337</span>
+<span id="338">338</span>
+<span id="339">339</span>
+<span id="340">340</span>
+<span id="341">341</span>
+<span id="342">342</span>
+<span id="343">343</span>
+<span id="344">344</span>
+<span id="345">345</span>
+<span id="346">346</span>
+<span id="347">347</span>
+<span id="348">348</span>
+<span id="349">349</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="doccomment">//! Coin selection</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! This module provides the trait [`CoinSelectionAlgorithm`] that can be implemented to</span>
+<span class="doccomment">//! define custom coin selection algorithms.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! The coin selection algorithm is not globally part of a [`Wallet`](super::Wallet), instead it</span>
+<span class="doccomment">//! is selected whenever a [`Wallet::create_tx`](super::Wallet::create_tx) call is made, through</span>
+<span class="doccomment">//! the use of the [`TxBuilder`] structure, specifically with</span>
+<span class="doccomment">//! [`TxBuilder::coin_selection`](super::tx_builder::TxBuilder::coin_selection) method.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! The [`DefaultCoinSelectionAlgorithm`] selects the default coin selection algorithm that</span>
+<span class="doccomment">//! [`TxBuilder`] uses, if it's not explicitly overridden.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! [`TxBuilder`]: super::tx_builder::TxBuilder</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ## Example</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ```no_run</span>
+<span class="doccomment">//! # use std::str::FromStr;</span>
+<span class="doccomment">//! # use bitcoin::*;</span>
+<span class="doccomment">//! # use bitcoin::consensus::serialize;</span>
+<span class="doccomment">//! # use bdk::wallet::coin_selection::*;</span>
+<span class="doccomment">//! # use bdk::*;</span>
+<span class="doccomment">//! #[derive(Debug)]</span>
+<span class="doccomment">//! struct AlwaysSpendEverything;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! impl CoinSelectionAlgorithm for AlwaysSpendEverything {</span>
+<span class="doccomment">//! fn coin_select(</span>
+<span class="doccomment">//! &self,</span>
+<span class="doccomment">//! utxos: Vec<UTXO>,</span>
+<span class="doccomment">//! _use_all_utxos: bool,</span>
+<span class="doccomment">//! fee_rate: FeeRate,</span>
+<span class="doccomment">//! amount_needed: u64,</span>
+<span class="doccomment">//! input_witness_weight: usize,</span>
+<span class="doccomment">//! fee_amount: f32,</span>
+<span class="doccomment">//! ) -> Result<CoinSelectionResult, bdk::Error> {</span>
+<span class="doccomment">//! let selected_amount = utxos.iter().fold(0, |acc, utxo| acc + utxo.txout.value);</span>
+<span class="doccomment">//! let all_utxos_selected = utxos</span>
+<span class="doccomment">//! .into_iter()</span>
+<span class="doccomment">//! .map(|utxo| {</span>
+<span class="doccomment">//! (</span>
+<span class="doccomment">//! TxIn {</span>
+<span class="doccomment">//! previous_output: utxo.outpoint,</span>
+<span class="doccomment">//! ..Default::default()</span>
+<span class="doccomment">//! },</span>
+<span class="doccomment">//! utxo.txout.script_pubkey,</span>
+<span class="doccomment">//! )</span>
+<span class="doccomment">//! })</span>
+<span class="doccomment">//! .collect::<Vec<_>>();</span>
+<span class="doccomment">//! let additional_weight = all_utxos_selected.iter().fold(0, |acc, (txin, _)| {</span>
+<span class="doccomment">//! acc + serialize(txin).len() * 4 + input_witness_weight</span>
+<span class="doccomment">//! });</span>
+<span class="doccomment">//! let additional_fees = additional_weight as f32 * fee_rate.as_sat_vb() / 4.0;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! if (fee_amount + additional_fees).ceil() as u64 + amount_needed > selected_amount {</span>
+<span class="doccomment">//! return Err(bdk::Error::InsufficientFunds);</span>
+<span class="doccomment">//! }</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! Ok(CoinSelectionResult {</span>
+<span class="doccomment">//! txin: all_utxos_selected,</span>
+<span class="doccomment">//! selected_amount,</span>
+<span class="doccomment">//! fee_amount: fee_amount + additional_fees,</span>
+<span class="doccomment">//! })</span>
+<span class="doccomment">//! }</span>
+<span class="doccomment">//! }</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! # let wallet: OfflineWallet<_> = Wallet::new_offline("", None, Network::Testnet, bdk::database::MemoryDatabase::default())?;</span>
+<span class="doccomment">//! // create wallet, sync, ...</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! let to_address = Address::from_str("2N4eQYCbKUHCCTUjBJeHcJp9ok6J2GZsTDt").unwrap();</span>
+<span class="doccomment">//! let (psbt, details) = wallet.create_tx(</span>
+<span class="doccomment">//! TxBuilder::with_recipients(vec![(to_address.script_pubkey(), 50_000)])</span>
+<span class="doccomment">//! .coin_selection(AlwaysSpendEverything),</span>
+<span class="doccomment">//! )?;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! // inspect, sign, broadcast, ...</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! # Ok::<(), bdk::Error>(())</span>
+<span class="doccomment">//! ```</span>
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">serialize</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Script</span>, <span class="ident">TxIn</span>};
+
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::{<span class="ident">FeeRate</span>, <span class="ident">UTXO</span>};
+
+<span class="doccomment">/// Default coin selection algorithm used by [`TxBuilder`](super::tx_builder::TxBuilder) if not</span>
+<span class="doccomment">/// overridden</span>
+<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">DefaultCoinSelectionAlgorithm</span> <span class="op">=</span> <span class="ident">DumbCoinSelection</span>;
+
+<span class="doccomment">/// Result of a successful coin selection</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">CoinSelectionResult</span> {
+ <span class="doccomment">/// List of inputs to use, with the respective previous script_pubkey</span>
+ <span class="kw">pub</span> <span class="ident">txin</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">TxIn</span>, <span class="ident">Script</span>)<span class="op">></span>,
+ <span class="doccomment">/// Sum of the selected inputs' value</span>
+ <span class="kw">pub</span> <span class="ident">selected_amount</span>: <span class="ident">u64</span>,
+ <span class="doccomment">/// Total fee amount in satoshi</span>
+ <span class="kw">pub</span> <span class="ident">fee_amount</span>: <span class="ident">f32</span>,
+}
+
+<span class="doccomment">/// Trait for generalized coin selection algorithms</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This trait can be implemented to make the [`Wallet`](super::Wallet) use a customized coin</span>
+<span class="doccomment">/// selection algorithm when it creates transactions.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// For an example see [this module](crate::wallet::coin_selection)'s documentation.</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">CoinSelectionAlgorithm</span>: <span class="ident">std</span>::<span class="ident">fmt</span>::<span class="ident">Debug</span> {
+ <span class="doccomment">/// Perform the coin selection</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// - `utxos`: the list of spendable UTXOs</span>
+ <span class="doccomment">/// - `use_all_utxos`: if true all utxos should be spent unconditionally</span>
+ <span class="doccomment">/// - `fee_rate`: fee rate to use</span>
+ <span class="doccomment">/// - `amount_needed`: the amount in satoshi to select</span>
+ <span class="doccomment">/// - `input_witness_weight`: the weight of an input's witness to keep into account for the fees</span>
+ <span class="doccomment">/// - `fee_amount`: the amount of fees in satoshi already accumulated from adding outputs</span>
+ <span class="kw">fn</span> <span class="ident">coin_select</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>,
+ <span class="ident">use_all_utxos</span>: <span class="ident">bool</span>,
+ <span class="ident">fee_rate</span>: <span class="ident">FeeRate</span>,
+ <span class="ident">amount_needed</span>: <span class="ident">u64</span>,
+ <span class="ident">input_witness_weight</span>: <span class="ident">usize</span>,
+ <span class="ident">fee_amount</span>: <span class="ident">f32</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CoinSelectionResult</span>, <span class="ident">Error</span><span class="op">></span>;
+}
+
+<span class="doccomment">/// Simple and dumb coin selection</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This coin selection algorithm sorts the available UTXOs by value and then picks them starting</span>
+<span class="doccomment">/// from the largest ones until the required amount is reached.</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Default</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">DumbCoinSelection</span>;
+
+<span class="kw">impl</span> <span class="ident">CoinSelectionAlgorithm</span> <span class="kw">for</span> <span class="ident">DumbCoinSelection</span> {
+ <span class="kw">fn</span> <span class="ident">coin_select</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="kw-2">mut</span> <span class="ident">utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>,
+ <span class="ident">use_all_utxos</span>: <span class="ident">bool</span>,
+ <span class="ident">fee_rate</span>: <span class="ident">FeeRate</span>,
+ <span class="ident">outgoing_amount</span>: <span class="ident">u64</span>,
+ <span class="ident">input_witness_weight</span>: <span class="ident">usize</span>,
+ <span class="kw-2">mut</span> <span class="ident">fee_amount</span>: <span class="ident">f32</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CoinSelectionResult</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">txin</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
+ <span class="kw">let</span> <span class="ident">calc_fee_bytes</span> <span class="op">=</span> <span class="op">|</span><span class="ident">wu</span><span class="op">|</span> (<span class="ident">wu</span> <span class="kw">as</span> <span class="ident">f32</span>) <span class="op">*</span> <span class="ident">fee_rate</span>.<span class="ident">as_sat_vb</span>() <span class="op">/</span> <span class="number">4.0</span>;
+
+ <span class="ident">log</span>::<span class="macro">debug</span><span class="macro">!</span>(
+ <span class="string">"outgoing_amount = `{}`, fee_amount = `{}`, fee_rate = `{:?}`"</span>,
+ <span class="ident">outgoing_amount</span>,
+ <span class="ident">fee_amount</span>,
+ <span class="ident">fee_rate</span>
+ );
+
+ <span class="comment">// sort so that we pick them starting from the larger.</span>
+ <span class="ident">utxos</span>.<span class="ident">sort_by</span>(<span class="op">|</span><span class="ident">a</span>, <span class="ident">b</span><span class="op">|</span> <span class="ident">a</span>.<span class="ident">txout</span>.<span class="ident">value</span>.<span class="ident">partial_cmp</span>(<span class="kw-2">&</span><span class="ident">b</span>.<span class="ident">txout</span>.<span class="ident">value</span>).<span class="ident">unwrap</span>());
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">selected_amount</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
+ <span class="kw">while</span> <span class="ident">use_all_utxos</span> <span class="op">|</span><span class="op">|</span> <span class="ident">selected_amount</span> <span class="op"><</span> <span class="ident">outgoing_amount</span> <span class="op">+</span> (<span class="ident">fee_amount</span>.<span class="ident">ceil</span>() <span class="kw">as</span> <span class="ident">u64</span>) {
+ <span class="kw">let</span> <span class="ident">utxo</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">utxos</span>.<span class="ident">pop</span>() {
+ <span class="prelude-val">Some</span>(<span class="ident">utxo</span>) <span class="op">=</span><span class="op">></span> <span class="ident">utxo</span>,
+ <span class="prelude-val">None</span> <span class="kw">if</span> <span class="ident">selected_amount</span> <span class="op"><</span> <span class="ident">outgoing_amount</span> <span class="op">+</span> (<span class="ident">fee_amount</span>.<span class="ident">ceil</span>() <span class="kw">as</span> <span class="ident">u64</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">InsufficientFunds</span>)
+ }
+ <span class="prelude-val">None</span> <span class="kw">if</span> <span class="ident">use_all_utxos</span> <span class="op">=</span><span class="op">></span> <span class="kw">break</span>,
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">InsufficientFunds</span>),
+ };
+
+ <span class="kw">let</span> <span class="ident">new_in</span> <span class="op">=</span> <span class="ident">TxIn</span> {
+ <span class="ident">previous_output</span>: <span class="ident">utxo</span>.<span class="ident">outpoint</span>,
+ <span class="ident">script_sig</span>: <span class="ident">Script</span>::<span class="ident">default</span>(),
+ <span class="ident">sequence</span>: <span class="number">0</span>, <span class="comment">// Let the caller choose the right nSequence</span>
+ <span class="ident">witness</span>: <span class="macro">vec</span><span class="macro">!</span>[],
+ };
+ <span class="ident">fee_amount</span> <span class="op">+</span><span class="op">=</span> <span class="ident">calc_fee_bytes</span>(<span class="ident">serialize</span>(<span class="kw-2">&</span><span class="ident">new_in</span>).<span class="ident">len</span>() <span class="op">*</span> <span class="number">4</span> <span class="op">+</span> <span class="ident">input_witness_weight</span>);
+ <span class="ident">log</span>::<span class="macro">debug</span><span class="macro">!</span>(
+ <span class="string">"Selected {}, updated fee_amount = `{}`"</span>,
+ <span class="ident">new_in</span>.<span class="ident">previous_output</span>,
+ <span class="ident">fee_amount</span>
+ );
+
+ <span class="ident">txin</span>.<span class="ident">push</span>((<span class="ident">new_in</span>, <span class="ident">utxo</span>.<span class="ident">txout</span>.<span class="ident">script_pubkey</span>));
+ <span class="ident">selected_amount</span> <span class="op">+</span><span class="op">=</span> <span class="ident">utxo</span>.<span class="ident">txout</span>.<span class="ident">value</span>;
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">CoinSelectionResult</span> {
+ <span class="ident">txin</span>,
+ <span class="ident">fee_amount</span>,
+ <span class="ident">selected_amount</span>,
+ })
+ }
+}
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="kw">mod</span> <span class="ident">test</span> {
+ <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
+
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">OutPoint</span>, <span class="ident">Script</span>, <span class="ident">TxOut</span>};
+
+ <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="kw-2">*</span>;
+
+ <span class="kw">const</span> <span class="ident">P2WPKH_WITNESS_SIZE</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">73</span> <span class="op">+</span> <span class="number">33</span> <span class="op">+</span> <span class="number">2</span>;
+
+ <span class="kw">fn</span> <span class="ident">get_test_utxos</span>() <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span> {
+ <span class="macro">vec</span><span class="macro">!</span>[
+ <span class="ident">UTXO</span> {
+ <span class="ident">outpoint</span>: <span class="ident">OutPoint</span>::<span class="ident">from_str</span>(
+ <span class="string">"ebd9813ecebc57ff8f30797de7c205e3c7498ca950ea4341ee51a685ff2fa30a:0"</span>,
+ )
+ .<span class="ident">unwrap</span>(),
+ <span class="ident">txout</span>: <span class="ident">TxOut</span> {
+ <span class="ident">value</span>: <span class="number">100_000</span>,
+ <span class="ident">script_pubkey</span>: <span class="ident">Script</span>::<span class="ident">new</span>(),
+ },
+ <span class="ident">is_internal</span>: <span class="bool-val">false</span>,
+ },
+ <span class="ident">UTXO</span> {
+ <span class="ident">outpoint</span>: <span class="ident">OutPoint</span>::<span class="ident">from_str</span>(
+ <span class="string">"65d92ddff6b6dc72c89624a6491997714b90f6004f928d875bc0fd53f264fa85:0"</span>,
+ )
+ .<span class="ident">unwrap</span>(),
+ <span class="ident">txout</span>: <span class="ident">TxOut</span> {
+ <span class="ident">value</span>: <span class="number">200_000</span>,
+ <span class="ident">script_pubkey</span>: <span class="ident">Script</span>::<span class="ident">new</span>(),
+ },
+ <span class="ident">is_internal</span>: <span class="bool-val">true</span>,
+ },
+ ]
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_dumb_coin_selection_success</span>() {
+ <span class="kw">let</span> <span class="ident">utxos</span> <span class="op">=</span> <span class="ident">get_test_utxos</span>();
+
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">DumbCoinSelection</span>
+ .<span class="ident">coin_select</span>(
+ <span class="ident">utxos</span>,
+ <span class="bool-val">false</span>,
+ <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">1.0</span>),
+ <span class="number">250_000</span>,
+ <span class="ident">P2WPKH_WITNESS_SIZE</span>,
+ <span class="number">50.0</span>,
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">txin</span>.<span class="ident">len</span>(), <span class="number">2</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">selected_amount</span>, <span class="number">300_000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">fee_amount</span>, <span class="number">186.0</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_dumb_coin_selection_use_all</span>() {
+ <span class="kw">let</span> <span class="ident">utxos</span> <span class="op">=</span> <span class="ident">get_test_utxos</span>();
+
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">DumbCoinSelection</span>
+ .<span class="ident">coin_select</span>(
+ <span class="ident">utxos</span>,
+ <span class="bool-val">true</span>,
+ <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">1.0</span>),
+ <span class="number">20_000</span>,
+ <span class="ident">P2WPKH_WITNESS_SIZE</span>,
+ <span class="number">50.0</span>,
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">txin</span>.<span class="ident">len</span>(), <span class="number">2</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">selected_amount</span>, <span class="number">300_000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">fee_amount</span>, <span class="number">186.0</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_dumb_coin_selection_use_only_necessary</span>() {
+ <span class="kw">let</span> <span class="ident">utxos</span> <span class="op">=</span> <span class="ident">get_test_utxos</span>();
+
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">DumbCoinSelection</span>
+ .<span class="ident">coin_select</span>(
+ <span class="ident">utxos</span>,
+ <span class="bool-val">false</span>,
+ <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">1.0</span>),
+ <span class="number">20_000</span>,
+ <span class="ident">P2WPKH_WITNESS_SIZE</span>,
+ <span class="number">50.0</span>,
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">txin</span>.<span class="ident">len</span>(), <span class="number">1</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">selected_amount</span>, <span class="number">200_000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">fee_amount</span>, <span class="number">118.0</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"InsufficientFunds"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_dumb_coin_selection_insufficient_funds</span>() {
+ <span class="kw">let</span> <span class="ident">utxos</span> <span class="op">=</span> <span class="ident">get_test_utxos</span>();
+
+ <span class="ident">DumbCoinSelection</span>
+ .<span class="ident">coin_select</span>(
+ <span class="ident">utxos</span>,
+ <span class="bool-val">false</span>,
+ <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">1.0</span>),
+ <span class="number">500_000</span>,
+ <span class="ident">P2WPKH_WITNESS_SIZE</span>,
+ <span class="number">50.0</span>,
+ )
+ .<span class="ident">unwrap</span>();
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"InsufficientFunds"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_dumb_coin_selection_insufficient_funds_high_fees</span>() {
+ <span class="kw">let</span> <span class="ident">utxos</span> <span class="op">=</span> <span class="ident">get_test_utxos</span>();
+
+ <span class="ident">DumbCoinSelection</span>
+ .<span class="ident">coin_select</span>(
+ <span class="ident">utxos</span>,
+ <span class="bool-val">false</span>,
+ <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">1000.0</span>),
+ <span class="number">250_000</span>,
+ <span class="ident">P2WPKH_WITNESS_SIZE</span>,
+ <span class="number">50.0</span>,
+ )
+ .<span class="ident">unwrap</span>();
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/wallet/export.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>export.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+<span id="163">163</span>
+<span id="164">164</span>
+<span id="165">165</span>
+<span id="166">166</span>
+<span id="167">167</span>
+<span id="168">168</span>
+<span id="169">169</span>
+<span id="170">170</span>
+<span id="171">171</span>
+<span id="172">172</span>
+<span id="173">173</span>
+<span id="174">174</span>
+<span id="175">175</span>
+<span id="176">176</span>
+<span id="177">177</span>
+<span id="178">178</span>
+<span id="179">179</span>
+<span id="180">180</span>
+<span id="181">181</span>
+<span id="182">182</span>
+<span id="183">183</span>
+<span id="184">184</span>
+<span id="185">185</span>
+<span id="186">186</span>
+<span id="187">187</span>
+<span id="188">188</span>
+<span id="189">189</span>
+<span id="190">190</span>
+<span id="191">191</span>
+<span id="192">192</span>
+<span id="193">193</span>
+<span id="194">194</span>
+<span id="195">195</span>
+<span id="196">196</span>
+<span id="197">197</span>
+<span id="198">198</span>
+<span id="199">199</span>
+<span id="200">200</span>
+<span id="201">201</span>
+<span id="202">202</span>
+<span id="203">203</span>
+<span id="204">204</span>
+<span id="205">205</span>
+<span id="206">206</span>
+<span id="207">207</span>
+<span id="208">208</span>
+<span id="209">209</span>
+<span id="210">210</span>
+<span id="211">211</span>
+<span id="212">212</span>
+<span id="213">213</span>
+<span id="214">214</span>
+<span id="215">215</span>
+<span id="216">216</span>
+<span id="217">217</span>
+<span id="218">218</span>
+<span id="219">219</span>
+<span id="220">220</span>
+<span id="221">221</span>
+<span id="222">222</span>
+<span id="223">223</span>
+<span id="224">224</span>
+<span id="225">225</span>
+<span id="226">226</span>
+<span id="227">227</span>
+<span id="228">228</span>
+<span id="229">229</span>
+<span id="230">230</span>
+<span id="231">231</span>
+<span id="232">232</span>
+<span id="233">233</span>
+<span id="234">234</span>
+<span id="235">235</span>
+<span id="236">236</span>
+<span id="237">237</span>
+<span id="238">238</span>
+<span id="239">239</span>
+<span id="240">240</span>
+<span id="241">241</span>
+<span id="242">242</span>
+<span id="243">243</span>
+<span id="244">244</span>
+<span id="245">245</span>
+<span id="246">246</span>
+<span id="247">247</span>
+<span id="248">248</span>
+<span id="249">249</span>
+<span id="250">250</span>
+<span id="251">251</span>
+<span id="252">252</span>
+<span id="253">253</span>
+<span id="254">254</span>
+<span id="255">255</span>
+<span id="256">256</span>
+<span id="257">257</span>
+<span id="258">258</span>
+<span id="259">259</span>
+<span id="260">260</span>
+<span id="261">261</span>
+<span id="262">262</span>
+<span id="263">263</span>
+<span id="264">264</span>
+<span id="265">265</span>
+<span id="266">266</span>
+<span id="267">267</span>
+<span id="268">268</span>
+<span id="269">269</span>
+<span id="270">270</span>
+<span id="271">271</span>
+<span id="272">272</span>
+<span id="273">273</span>
+<span id="274">274</span>
+<span id="275">275</span>
+<span id="276">276</span>
+<span id="277">277</span>
+<span id="278">278</span>
+<span id="279">279</span>
+<span id="280">280</span>
+<span id="281">281</span>
+<span id="282">282</span>
+<span id="283">283</span>
+<span id="284">284</span>
+<span id="285">285</span>
+<span id="286">286</span>
+<span id="287">287</span>
+<span id="288">288</span>
+<span id="289">289</span>
+<span id="290">290</span>
+<span id="291">291</span>
+<span id="292">292</span>
+<span id="293">293</span>
+<span id="294">294</span>
+<span id="295">295</span>
+<span id="296">296</span>
+<span id="297">297</span>
+<span id="298">298</span>
+<span id="299">299</span>
+<span id="300">300</span>
+<span id="301">301</span>
+<span id="302">302</span>
+<span id="303">303</span>
+<span id="304">304</span>
+<span id="305">305</span>
+<span id="306">306</span>
+<span id="307">307</span>
+<span id="308">308</span>
+<span id="309">309</span>
+<span id="310">310</span>
+<span id="311">311</span>
+<span id="312">312</span>
+<span id="313">313</span>
+<span id="314">314</span>
+<span id="315">315</span>
+<span id="316">316</span>
+<span id="317">317</span>
+<span id="318">318</span>
+<span id="319">319</span>
+<span id="320">320</span>
+<span id="321">321</span>
+<span id="322">322</span>
+<span id="323">323</span>
+<span id="324">324</span>
+<span id="325">325</span>
+<span id="326">326</span>
+<span id="327">327</span>
+<span id="328">328</span>
+<span id="329">329</span>
+<span id="330">330</span>
+<span id="331">331</span>
+<span id="332">332</span>
+<span id="333">333</span>
+<span id="334">334</span>
+<span id="335">335</span>
+<span id="336">336</span>
+<span id="337">337</span>
+<span id="338">338</span>
+<span id="339">339</span>
+<span id="340">340</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="doccomment">//! Wallet export</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! This modules implements the wallet export format used by [FullyNoded](https://github.com/Fonta1n3/FullyNoded/blob/10b7808c8b929b171cca537fb50522d015168ac9/Docs/Wallets/Wallet-Export-Spec.md).</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ## Examples</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ### Import from JSON</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ```</span>
+<span class="doccomment">//! # use std::str::FromStr;</span>
+<span class="doccomment">//! # use bitcoin::*;</span>
+<span class="doccomment">//! # use bdk::database::*;</span>
+<span class="doccomment">//! # use bdk::wallet::export::*;</span>
+<span class="doccomment">//! # use bdk::*;</span>
+<span class="doccomment">//! let import = r#"{</span>
+<span class="doccomment">//! "descriptor": "wpkh([c258d2e4\/84h\/1h\/0h]tpubDD3ynpHgJQW8VvWRzQ5WFDCrs4jqVFGHB3vLC3r49XHJSqP8bHKdK4AriuUKLccK68zfzowx7YhmDN8SiSkgCDENUFx9qVw65YyqM78vyVe\/0\/*)",</span>
+<span class="doccomment">//! "blockheight":1782088,</span>
+<span class="doccomment">//! "label":"testnet"</span>
+<span class="doccomment">//! }"#;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! let import = WalletExport::from_str(import)?;</span>
+<span class="doccomment">//! let wallet: OfflineWallet<_> = Wallet::new_offline(&import.descriptor(), import.change_descriptor().as_deref(), Network::Testnet, MemoryDatabase::default())?;</span>
+<span class="doccomment">//! # Ok::<_, bdk::Error>(())</span>
+<span class="doccomment">//! ```</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ### Export a `Wallet`</span>
+<span class="doccomment">//! ```</span>
+<span class="doccomment">//! # use bitcoin::*;</span>
+<span class="doccomment">//! # use bdk::database::*;</span>
+<span class="doccomment">//! # use bdk::wallet::export::*;</span>
+<span class="doccomment">//! # use bdk::*;</span>
+<span class="doccomment">//! let wallet: OfflineWallet<_> = Wallet::new_offline(</span>
+<span class="doccomment">//! "wpkh([c258d2e4/84h/1h/0h]tpubDD3ynpHgJQW8VvWRzQ5WFDCrs4jqVFGHB3vLC3r49XHJSqP8bHKdK4AriuUKLccK68zfzowx7YhmDN8SiSkgCDENUFx9qVw65YyqM78vyVe/0/*)",</span>
+<span class="doccomment">//! Some("wpkh([c258d2e4/84h/1h/0h]tpubDD3ynpHgJQW8VvWRzQ5WFDCrs4jqVFGHB3vLC3r49XHJSqP8bHKdK4AriuUKLccK68zfzowx7YhmDN8SiSkgCDENUFx9qVw65YyqM78vyVe/1/*)"),</span>
+<span class="doccomment">//! Network::Testnet,</span>
+<span class="doccomment">//! MemoryDatabase::default()</span>
+<span class="doccomment">//! )?;</span>
+<span class="doccomment">//! let export = WalletExport::export_wallet(&wallet, "exported wallet", true)</span>
+<span class="doccomment">//! .map_err(ToString::to_string)</span>
+<span class="doccomment">//! .map_err(bdk::Error::Generic)?;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! println!("Exported: {}", export.to_string());</span>
+<span class="doccomment">//! # Ok::<_, bdk::Error>(())</span>
+<span class="doccomment">//! ```</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
+
+<span class="kw">use</span> <span class="ident">serde</span>::{<span class="ident">Deserialize</span>, <span class="ident">Serialize</span>};
+
+<span class="kw">use</span> <span class="ident">miniscript</span>::{<span class="ident">Descriptor</span>, <span class="ident">ScriptContext</span>, <span class="ident">Terminal</span>};
+
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">blockchain</span>::<span class="ident">BlockchainMarker</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">BatchDatabase</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">Wallet</span>;
+
+<span class="doccomment">/// Structure that contains the export of a wallet</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// For a usage example see [this module](crate::wallet::export)'s documentation.</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Serialize</span>, <span class="ident">Deserialize</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">WalletExport</span> {
+ <span class="ident">descriptor</span>: <span class="ident">String</span>,
+ <span class="doccomment">/// Earliest block to rescan when looking for the wallet's transactions</span>
+ <span class="kw">pub</span> <span class="ident">blockheight</span>: <span class="ident">u32</span>,
+ <span class="doccomment">/// Arbitrary label for the wallet</span>
+ <span class="kw">pub</span> <span class="ident">label</span>: <span class="ident">String</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">ToString</span> <span class="kw">for</span> <span class="ident">WalletExport</span> {
+ <span class="kw">fn</span> <span class="ident">to_string</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">String</span> {
+ <span class="ident">serde_json</span>::<span class="ident">to_string</span>(<span class="self">self</span>).<span class="ident">unwrap</span>()
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">FromStr</span> <span class="kw">for</span> <span class="ident">WalletExport</span> {
+ <span class="kw">type</span> <span class="prelude-val">Err</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">Error</span>;
+
+ <span class="kw">fn</span> <span class="ident">from_str</span>(<span class="ident">s</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="self">Self</span>::<span class="prelude-val">Err</span><span class="op">></span> {
+ <span class="ident">serde_json</span>::<span class="ident">from_str</span>(<span class="ident">s</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">WalletExport</span> {
+ <span class="doccomment">/// Export a wallet</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This function returns an error if it determines that the `wallet`'s descriptor(s) are not</span>
+ <span class="doccomment">/// supported by Bitcoin Core or don't follow the standard derivation paths defined by BIP44</span>
+ <span class="doccomment">/// and others.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// If `include_blockheight` is `true`, this function will look into the `wallet`'s database</span>
+ <span class="doccomment">/// for the oldest transaction it knows and use that as the earliest block to rescan.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// If the database is empty or `include_blockheight` is false, the `blockheight` field</span>
+ <span class="doccomment">/// returned will be `0`.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">export_wallet</span><span class="op"><</span><span class="ident">B</span>: <span class="ident">BlockchainMarker</span>, <span class="ident">D</span>: <span class="ident">BatchDatabase</span><span class="op">></span>(
+ <span class="ident">wallet</span>: <span class="kw-2">&</span><span class="ident">Wallet</span><span class="op"><</span><span class="ident">B</span>, <span class="ident">D</span><span class="op">></span>,
+ <span class="ident">label</span>: <span class="kw-2">&</span><span class="ident">str</span>,
+ <span class="ident">include_blockheight</span>: <span class="ident">bool</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">descriptor</span>
+ .<span class="ident">to_string_with_secret</span>(<span class="kw-2">&</span><span class="ident">wallet</span>.<span class="ident">signers</span>.<span class="ident">as_key_map</span>());
+ <span class="self">Self</span>::<span class="ident">is_compatible_with_core</span>(<span class="kw-2">&</span><span class="ident">descriptor</span>)<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="ident">blockheight</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">iter_txs</span>(<span class="bool-val">false</span>) {
+ <span class="kw">_</span> <span class="kw">if</span> <span class="op">!</span><span class="ident">include_blockheight</span> <span class="op">=</span><span class="op">></span> <span class="number">0</span>,
+ <span class="prelude-val">Err</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="number">0</span>,
+ <span class="prelude-val">Ok</span>(<span class="ident">txs</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">heights</span> <span class="op">=</span> <span class="ident">txs</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">tx</span><span class="op">|</span> <span class="ident">tx</span>.<span class="ident">height</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>))
+ .<span class="ident">collect</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span><span class="op">></span>();
+ <span class="ident">heights</span>.<span class="ident">sort</span>();
+
+ <span class="kw-2">*</span><span class="ident">heights</span>.<span class="ident">last</span>().<span class="ident">unwrap_or</span>(<span class="kw-2">&</span><span class="number">0</span>)
+ }
+ };
+
+ <span class="kw">let</span> <span class="ident">export</span> <span class="op">=</span> <span class="ident">WalletExport</span> {
+ <span class="ident">descriptor</span>,
+ <span class="ident">label</span>: <span class="ident">label</span>.<span class="ident">into</span>(),
+ <span class="ident">blockheight</span>,
+ };
+
+ <span class="kw">if</span> <span class="ident">export</span>.<span class="ident">change_descriptor</span>()
+ <span class="op">!</span><span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">change_descriptor</span>
+ .<span class="ident">as_ref</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">d</span><span class="op">|</span> <span class="ident">d</span>.<span class="ident">to_string_with_secret</span>(<span class="kw-2">&</span><span class="ident">wallet</span>.<span class="ident">change_signers</span>.<span class="ident">as_key_map</span>()))
+ {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="string">"Incompatible change descriptor"</span>);
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">export</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">is_compatible_with_core</span>(<span class="ident">descriptor</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">check_ms</span><span class="op"><</span><span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span>(
+ <span class="ident">terminal</span>: <span class="ident">Terminal</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">Ctx</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="kw">let</span> <span class="ident">Terminal</span>::<span class="ident">Multi</span>(<span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">terminal</span> {
+ <span class="prelude-val">Ok</span>(())
+ } <span class="kw">else</span> {
+ <span class="prelude-val">Err</span>(<span class="string">"The descriptor contains operators not supported by Bitcoin Core"</span>)
+ }
+ }
+
+ <span class="kw">match</span> <span class="ident">Descriptor</span>::<span class="op"><</span><span class="ident">String</span><span class="op">></span>::<span class="ident">from_str</span>(<span class="ident">descriptor</span>).<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="string">"Invalid descriptor"</span>)<span class="question-mark">?</span> {
+ <span class="ident">Descriptor</span>::<span class="ident">Pk</span>(<span class="kw">_</span>)
+ <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Pkh</span>(<span class="kw">_</span>)
+ <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Wpkh</span>(<span class="kw">_</span>)
+ <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWpkh</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(()),
+ <span class="ident">Descriptor</span>::<span class="ident">Sh</span>(<span class="ident">ms</span>) <span class="op">=</span><span class="op">></span> <span class="ident">check_ms</span>(<span class="ident">ms</span>.<span class="ident">node</span>),
+ <span class="ident">Descriptor</span>::<span class="ident">Wsh</span>(<span class="ident">ms</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWsh</span>(<span class="ident">ms</span>) <span class="op">=</span><span class="op">></span> <span class="ident">check_ms</span>(<span class="ident">ms</span>.<span class="ident">node</span>),
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="string">"The descriptor is not compatible with Bitcoin Core"</span>),
+ }
+ }
+
+ <span class="doccomment">/// Return the external descriptor</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">descriptor</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">String</span> {
+ <span class="self">self</span>.<span class="ident">descriptor</span>.<span class="ident">clone</span>()
+ }
+
+ <span class="doccomment">/// Return the internal descriptor, if present</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">change_descriptor</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">replaced</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">descriptor</span>.<span class="ident">replace</span>(<span class="string">"/0/*"</span>, <span class="string">"/1/*"</span>);
+
+ <span class="kw">if</span> <span class="ident">replaced</span> <span class="op">!</span><span class="op">=</span> <span class="self">self</span>.<span class="ident">descriptor</span> {
+ <span class="prelude-val">Some</span>(<span class="ident">replaced</span>)
+ } <span class="kw">else</span> {
+ <span class="prelude-val">None</span>
+ }
+ }
+}
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="kw">mod</span> <span class="ident">test</span> {
+ <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
+
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Network</span>, <span class="ident">Txid</span>};
+
+ <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::{<span class="ident">memory</span>::<span class="ident">MemoryDatabase</span>, <span class="ident">BatchOperations</span>};
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">TransactionDetails</span>;
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">wallet</span>::{<span class="ident">OfflineWallet</span>, <span class="ident">Wallet</span>};
+
+ <span class="kw">fn</span> <span class="ident">get_test_db</span>() <span class="op">-</span><span class="op">></span> <span class="ident">MemoryDatabase</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">db</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">new</span>();
+ <span class="ident">db</span>.<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">TransactionDetails</span> {
+ <span class="ident">transaction</span>: <span class="prelude-val">None</span>,
+ <span class="ident">txid</span>: <span class="ident">Txid</span>::<span class="ident">from_str</span>(
+ <span class="string">"4ddff1fa33af17f377f62b72357b43107c19110a8009b36fb832af505efed98a"</span>,
+ )
+ .<span class="ident">unwrap</span>(),
+ <span class="ident">timestamp</span>: <span class="number">12345678</span>,
+ <span class="ident">received</span>: <span class="number">100_000</span>,
+ <span class="ident">sent</span>: <span class="number">0</span>,
+ <span class="ident">fees</span>: <span class="number">500</span>,
+ <span class="ident">height</span>: <span class="prelude-val">Some</span>(<span class="number">5000</span>),
+ })
+ .<span class="ident">unwrap</span>();
+
+ <span class="ident">db</span>
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_export_bip44</span>() {
+ <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44'/0'/0'/0/*)"</span>;
+ <span class="kw">let</span> <span class="ident">change_descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44'/0'/0'/1/*)"</span>;
+
+ <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(
+ <span class="ident">descriptor</span>,
+ <span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>),
+ <span class="ident">Network</span>::<span class="ident">Testnet</span>,
+ <span class="ident">get_test_db</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">export</span> <span class="op">=</span> <span class="ident">WalletExport</span>::<span class="ident">export_wallet</span>(<span class="kw-2">&</span><span class="ident">wallet</span>, <span class="string">"Test Label"</span>, <span class="bool-val">true</span>).<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">descriptor</span>(), <span class="ident">descriptor</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">change_descriptor</span>(), <span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>.<span class="ident">into</span>()));
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">blockheight</span>, <span class="number">5000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">label</span>, <span class="string">"Test Label"</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"Incompatible change descriptor"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_export_no_change</span>() {
+ <span class="comment">// This wallet explicitly doesn't have a change descriptor. It should be impossible to</span>
+ <span class="comment">// export, because exporting this kind of external descriptor normally implies the</span>
+ <span class="comment">// existence of an internal descriptor</span>
+
+ <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44'/0'/0'/0/*)"</span>;
+
+ <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span>
+ <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(<span class="ident">descriptor</span>, <span class="prelude-val">None</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>, <span class="ident">get_test_db</span>()).<span class="ident">unwrap</span>();
+ <span class="ident">WalletExport</span>::<span class="ident">export_wallet</span>(<span class="kw-2">&</span><span class="ident">wallet</span>, <span class="string">"Test Label"</span>, <span class="bool-val">true</span>).<span class="ident">unwrap</span>();
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"Incompatible change descriptor"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_export_incompatible_change</span>() {
+ <span class="comment">// This wallet has a change descriptor, but the derivation path is not in the "standard"</span>
+ <span class="comment">// bip44/49/etc format</span>
+
+ <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44'/0'/0'/0/*)"</span>;
+ <span class="kw">let</span> <span class="ident">change_descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/50'/0'/1/*)"</span>;
+
+ <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(
+ <span class="ident">descriptor</span>,
+ <span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>),
+ <span class="ident">Network</span>::<span class="ident">Testnet</span>,
+ <span class="ident">get_test_db</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="ident">WalletExport</span>::<span class="ident">export_wallet</span>(<span class="kw-2">&</span><span class="ident">wallet</span>, <span class="string">"Test Label"</span>, <span class="bool-val">true</span>).<span class="ident">unwrap</span>();
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_export_multi</span>() {
+ <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="string">"wsh(multi(2,\
+ [73756c7f/48'/0'/0'/2']tpubDCKxNyM3bLgbEX13Mcd8mYxbVg9ajDkWXMh29hMWBurKfVmBfWAM96QVP3zaUcN51HvkZ3ar4VwP82kC8JZhhux8vFQoJintSpVBwpFvyU3/0/*,\
+ [f9f62194/48'/0'/0'/2']tpubDDp3ZSH1yCwusRppH7zgSxq2t1VEUyXSeEp8E5aFS8m43MknUjiF1bSLo3CGWAxbDyhF1XowA5ukPzyJZjznYk3kYi6oe7QxtX2euvKWsk4/0/*,\
+ [c98b1535/48'/0'/0'/2']tpubDCDi5W4sP6zSnzJeowy8rQDVhBdRARaPhK1axABi8V1661wEPeanpEXj4ZLAUEoikVtoWcyK26TKKJSecSfeKxwHCcRrge9k1ybuiL71z4a/0/*\
+ ))"</span>;
+ <span class="kw">let</span> <span class="ident">change_descriptor</span> <span class="op">=</span> <span class="string">"wsh(multi(2,\
+ [73756c7f/48'/0'/0'/2']tpubDCKxNyM3bLgbEX13Mcd8mYxbVg9ajDkWXMh29hMWBurKfVmBfWAM96QVP3zaUcN51HvkZ3ar4VwP82kC8JZhhux8vFQoJintSpVBwpFvyU3/1/*,\
+ [f9f62194/48'/0'/0'/2']tpubDDp3ZSH1yCwusRppH7zgSxq2t1VEUyXSeEp8E5aFS8m43MknUjiF1bSLo3CGWAxbDyhF1XowA5ukPzyJZjznYk3kYi6oe7QxtX2euvKWsk4/1/*,\
+ [c98b1535/48'/0'/0'/2']tpubDCDi5W4sP6zSnzJeowy8rQDVhBdRARaPhK1axABi8V1661wEPeanpEXj4ZLAUEoikVtoWcyK26TKKJSecSfeKxwHCcRrge9k1ybuiL71z4a/1/*\
+ ))"</span>;
+
+ <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(
+ <span class="ident">descriptor</span>,
+ <span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>),
+ <span class="ident">Network</span>::<span class="ident">Testnet</span>,
+ <span class="ident">get_test_db</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">export</span> <span class="op">=</span> <span class="ident">WalletExport</span>::<span class="ident">export_wallet</span>(<span class="kw-2">&</span><span class="ident">wallet</span>, <span class="string">"Test Label"</span>, <span class="bool-val">true</span>).<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">descriptor</span>(), <span class="ident">descriptor</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">change_descriptor</span>(), <span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>.<span class="ident">into</span>()));
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">blockheight</span>, <span class="number">5000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">label</span>, <span class="string">"Test Label"</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_export_to_json</span>() {
+ <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44'/0'/0'/0/*)"</span>;
+ <span class="kw">let</span> <span class="ident">change_descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44'/0'/0'/1/*)"</span>;
+
+ <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(
+ <span class="ident">descriptor</span>,
+ <span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>),
+ <span class="ident">Network</span>::<span class="ident">Testnet</span>,
+ <span class="ident">get_test_db</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">export</span> <span class="op">=</span> <span class="ident">WalletExport</span>::<span class="ident">export_wallet</span>(<span class="kw-2">&</span><span class="ident">wallet</span>, <span class="string">"Test Label"</span>, <span class="bool-val">true</span>).<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">to_string</span>(), <span class="string">"{\"descriptor\":\"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44\'/0\'/0\'/0/*)\",\"blockheight\":5000,\"label\":\"Test Label\"}"</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_export_from_json</span>() {
+ <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44'/0'/0'/0/*)"</span>;
+ <span class="kw">let</span> <span class="ident">change_descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44'/0'/0'/1/*)"</span>;
+
+ <span class="kw">let</span> <span class="ident">import_str</span> <span class="op">=</span> <span class="string">"{\"descriptor\":\"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44\'/0\'/0\'/0/*)\",\"blockheight\":5000,\"label\":\"Test Label\"}"</span>;
+ <span class="kw">let</span> <span class="ident">export</span> <span class="op">=</span> <span class="ident">WalletExport</span>::<span class="ident">from_str</span>(<span class="ident">import_str</span>).<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">descriptor</span>(), <span class="ident">descriptor</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">change_descriptor</span>(), <span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>.<span class="ident">into</span>()));
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">blockheight</span>, <span class="number">5000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">label</span>, <span class="string">"Test Label"</span>);
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/wallet/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100"> 100</span>
+<span id="101"> 101</span>
+<span id="102"> 102</span>
+<span id="103"> 103</span>
+<span id="104"> 104</span>
+<span id="105"> 105</span>
+<span id="106"> 106</span>
+<span id="107"> 107</span>
+<span id="108"> 108</span>
+<span id="109"> 109</span>
+<span id="110"> 110</span>
+<span id="111"> 111</span>
+<span id="112"> 112</span>
+<span id="113"> 113</span>
+<span id="114"> 114</span>
+<span id="115"> 115</span>
+<span id="116"> 116</span>
+<span id="117"> 117</span>
+<span id="118"> 118</span>
+<span id="119"> 119</span>
+<span id="120"> 120</span>
+<span id="121"> 121</span>
+<span id="122"> 122</span>
+<span id="123"> 123</span>
+<span id="124"> 124</span>
+<span id="125"> 125</span>
+<span id="126"> 126</span>
+<span id="127"> 127</span>
+<span id="128"> 128</span>
+<span id="129"> 129</span>
+<span id="130"> 130</span>
+<span id="131"> 131</span>
+<span id="132"> 132</span>
+<span id="133"> 133</span>
+<span id="134"> 134</span>
+<span id="135"> 135</span>
+<span id="136"> 136</span>
+<span id="137"> 137</span>
+<span id="138"> 138</span>
+<span id="139"> 139</span>
+<span id="140"> 140</span>
+<span id="141"> 141</span>
+<span id="142"> 142</span>
+<span id="143"> 143</span>
+<span id="144"> 144</span>
+<span id="145"> 145</span>
+<span id="146"> 146</span>
+<span id="147"> 147</span>
+<span id="148"> 148</span>
+<span id="149"> 149</span>
+<span id="150"> 150</span>
+<span id="151"> 151</span>
+<span id="152"> 152</span>
+<span id="153"> 153</span>
+<span id="154"> 154</span>
+<span id="155"> 155</span>
+<span id="156"> 156</span>
+<span id="157"> 157</span>
+<span id="158"> 158</span>
+<span id="159"> 159</span>
+<span id="160"> 160</span>
+<span id="161"> 161</span>
+<span id="162"> 162</span>
+<span id="163"> 163</span>
+<span id="164"> 164</span>
+<span id="165"> 165</span>
+<span id="166"> 166</span>
+<span id="167"> 167</span>
+<span id="168"> 168</span>
+<span id="169"> 169</span>
+<span id="170"> 170</span>
+<span id="171"> 171</span>
+<span id="172"> 172</span>
+<span id="173"> 173</span>
+<span id="174"> 174</span>
+<span id="175"> 175</span>
+<span id="176"> 176</span>
+<span id="177"> 177</span>
+<span id="178"> 178</span>
+<span id="179"> 179</span>
+<span id="180"> 180</span>
+<span id="181"> 181</span>
+<span id="182"> 182</span>
+<span id="183"> 183</span>
+<span id="184"> 184</span>
+<span id="185"> 185</span>
+<span id="186"> 186</span>
+<span id="187"> 187</span>
+<span id="188"> 188</span>
+<span id="189"> 189</span>
+<span id="190"> 190</span>
+<span id="191"> 191</span>
+<span id="192"> 192</span>
+<span id="193"> 193</span>
+<span id="194"> 194</span>
+<span id="195"> 195</span>
+<span id="196"> 196</span>
+<span id="197"> 197</span>
+<span id="198"> 198</span>
+<span id="199"> 199</span>
+<span id="200"> 200</span>
+<span id="201"> 201</span>
+<span id="202"> 202</span>
+<span id="203"> 203</span>
+<span id="204"> 204</span>
+<span id="205"> 205</span>
+<span id="206"> 206</span>
+<span id="207"> 207</span>
+<span id="208"> 208</span>
+<span id="209"> 209</span>
+<span id="210"> 210</span>
+<span id="211"> 211</span>
+<span id="212"> 212</span>
+<span id="213"> 213</span>
+<span id="214"> 214</span>
+<span id="215"> 215</span>
+<span id="216"> 216</span>
+<span id="217"> 217</span>
+<span id="218"> 218</span>
+<span id="219"> 219</span>
+<span id="220"> 220</span>
+<span id="221"> 221</span>
+<span id="222"> 222</span>
+<span id="223"> 223</span>
+<span id="224"> 224</span>
+<span id="225"> 225</span>
+<span id="226"> 226</span>
+<span id="227"> 227</span>
+<span id="228"> 228</span>
+<span id="229"> 229</span>
+<span id="230"> 230</span>
+<span id="231"> 231</span>
+<span id="232"> 232</span>
+<span id="233"> 233</span>
+<span id="234"> 234</span>
+<span id="235"> 235</span>
+<span id="236"> 236</span>
+<span id="237"> 237</span>
+<span id="238"> 238</span>
+<span id="239"> 239</span>
+<span id="240"> 240</span>
+<span id="241"> 241</span>
+<span id="242"> 242</span>
+<span id="243"> 243</span>
+<span id="244"> 244</span>
+<span id="245"> 245</span>
+<span id="246"> 246</span>
+<span id="247"> 247</span>
+<span id="248"> 248</span>
+<span id="249"> 249</span>
+<span id="250"> 250</span>
+<span id="251"> 251</span>
+<span id="252"> 252</span>
+<span id="253"> 253</span>
+<span id="254"> 254</span>
+<span id="255"> 255</span>
+<span id="256"> 256</span>
+<span id="257"> 257</span>
+<span id="258"> 258</span>
+<span id="259"> 259</span>
+<span id="260"> 260</span>
+<span id="261"> 261</span>
+<span id="262"> 262</span>
+<span id="263"> 263</span>
+<span id="264"> 264</span>
+<span id="265"> 265</span>
+<span id="266"> 266</span>
+<span id="267"> 267</span>
+<span id="268"> 268</span>
+<span id="269"> 269</span>
+<span id="270"> 270</span>
+<span id="271"> 271</span>
+<span id="272"> 272</span>
+<span id="273"> 273</span>
+<span id="274"> 274</span>
+<span id="275"> 275</span>
+<span id="276"> 276</span>
+<span id="277"> 277</span>
+<span id="278"> 278</span>
+<span id="279"> 279</span>
+<span id="280"> 280</span>
+<span id="281"> 281</span>
+<span id="282"> 282</span>
+<span id="283"> 283</span>
+<span id="284"> 284</span>
+<span id="285"> 285</span>
+<span id="286"> 286</span>
+<span id="287"> 287</span>
+<span id="288"> 288</span>
+<span id="289"> 289</span>
+<span id="290"> 290</span>
+<span id="291"> 291</span>
+<span id="292"> 292</span>
+<span id="293"> 293</span>
+<span id="294"> 294</span>
+<span id="295"> 295</span>
+<span id="296"> 296</span>
+<span id="297"> 297</span>
+<span id="298"> 298</span>
+<span id="299"> 299</span>
+<span id="300"> 300</span>
+<span id="301"> 301</span>
+<span id="302"> 302</span>
+<span id="303"> 303</span>
+<span id="304"> 304</span>
+<span id="305"> 305</span>
+<span id="306"> 306</span>
+<span id="307"> 307</span>
+<span id="308"> 308</span>
+<span id="309"> 309</span>
+<span id="310"> 310</span>
+<span id="311"> 311</span>
+<span id="312"> 312</span>
+<span id="313"> 313</span>
+<span id="314"> 314</span>
+<span id="315"> 315</span>
+<span id="316"> 316</span>
+<span id="317"> 317</span>
+<span id="318"> 318</span>
+<span id="319"> 319</span>
+<span id="320"> 320</span>
+<span id="321"> 321</span>
+<span id="322"> 322</span>
+<span id="323"> 323</span>
+<span id="324"> 324</span>
+<span id="325"> 325</span>
+<span id="326"> 326</span>
+<span id="327"> 327</span>
+<span id="328"> 328</span>
+<span id="329"> 329</span>
+<span id="330"> 330</span>
+<span id="331"> 331</span>
+<span id="332"> 332</span>
+<span id="333"> 333</span>
+<span id="334"> 334</span>
+<span id="335"> 335</span>
+<span id="336"> 336</span>
+<span id="337"> 337</span>
+<span id="338"> 338</span>
+<span id="339"> 339</span>
+<span id="340"> 340</span>
+<span id="341"> 341</span>
+<span id="342"> 342</span>
+<span id="343"> 343</span>
+<span id="344"> 344</span>
+<span id="345"> 345</span>
+<span id="346"> 346</span>
+<span id="347"> 347</span>
+<span id="348"> 348</span>
+<span id="349"> 349</span>
+<span id="350"> 350</span>
+<span id="351"> 351</span>
+<span id="352"> 352</span>
+<span id="353"> 353</span>
+<span id="354"> 354</span>
+<span id="355"> 355</span>
+<span id="356"> 356</span>
+<span id="357"> 357</span>
+<span id="358"> 358</span>
+<span id="359"> 359</span>
+<span id="360"> 360</span>
+<span id="361"> 361</span>
+<span id="362"> 362</span>
+<span id="363"> 363</span>
+<span id="364"> 364</span>
+<span id="365"> 365</span>
+<span id="366"> 366</span>
+<span id="367"> 367</span>
+<span id="368"> 368</span>
+<span id="369"> 369</span>
+<span id="370"> 370</span>
+<span id="371"> 371</span>
+<span id="372"> 372</span>
+<span id="373"> 373</span>
+<span id="374"> 374</span>
+<span id="375"> 375</span>
+<span id="376"> 376</span>
+<span id="377"> 377</span>
+<span id="378"> 378</span>
+<span id="379"> 379</span>
+<span id="380"> 380</span>
+<span id="381"> 381</span>
+<span id="382"> 382</span>
+<span id="383"> 383</span>
+<span id="384"> 384</span>
+<span id="385"> 385</span>
+<span id="386"> 386</span>
+<span id="387"> 387</span>
+<span id="388"> 388</span>
+<span id="389"> 389</span>
+<span id="390"> 390</span>
+<span id="391"> 391</span>
+<span id="392"> 392</span>
+<span id="393"> 393</span>
+<span id="394"> 394</span>
+<span id="395"> 395</span>
+<span id="396"> 396</span>
+<span id="397"> 397</span>
+<span id="398"> 398</span>
+<span id="399"> 399</span>
+<span id="400"> 400</span>
+<span id="401"> 401</span>
+<span id="402"> 402</span>
+<span id="403"> 403</span>
+<span id="404"> 404</span>
+<span id="405"> 405</span>
+<span id="406"> 406</span>
+<span id="407"> 407</span>
+<span id="408"> 408</span>
+<span id="409"> 409</span>
+<span id="410"> 410</span>
+<span id="411"> 411</span>
+<span id="412"> 412</span>
+<span id="413"> 413</span>
+<span id="414"> 414</span>
+<span id="415"> 415</span>
+<span id="416"> 416</span>
+<span id="417"> 417</span>
+<span id="418"> 418</span>
+<span id="419"> 419</span>
+<span id="420"> 420</span>
+<span id="421"> 421</span>
+<span id="422"> 422</span>
+<span id="423"> 423</span>
+<span id="424"> 424</span>
+<span id="425"> 425</span>
+<span id="426"> 426</span>
+<span id="427"> 427</span>
+<span id="428"> 428</span>
+<span id="429"> 429</span>
+<span id="430"> 430</span>
+<span id="431"> 431</span>
+<span id="432"> 432</span>
+<span id="433"> 433</span>
+<span id="434"> 434</span>
+<span id="435"> 435</span>
+<span id="436"> 436</span>
+<span id="437"> 437</span>
+<span id="438"> 438</span>
+<span id="439"> 439</span>
+<span id="440"> 440</span>
+<span id="441"> 441</span>
+<span id="442"> 442</span>
+<span id="443"> 443</span>
+<span id="444"> 444</span>
+<span id="445"> 445</span>
+<span id="446"> 446</span>
+<span id="447"> 447</span>
+<span id="448"> 448</span>
+<span id="449"> 449</span>
+<span id="450"> 450</span>
+<span id="451"> 451</span>
+<span id="452"> 452</span>
+<span id="453"> 453</span>
+<span id="454"> 454</span>
+<span id="455"> 455</span>
+<span id="456"> 456</span>
+<span id="457"> 457</span>
+<span id="458"> 458</span>
+<span id="459"> 459</span>
+<span id="460"> 460</span>
+<span id="461"> 461</span>
+<span id="462"> 462</span>
+<span id="463"> 463</span>
+<span id="464"> 464</span>
+<span id="465"> 465</span>
+<span id="466"> 466</span>
+<span id="467"> 467</span>
+<span id="468"> 468</span>
+<span id="469"> 469</span>
+<span id="470"> 470</span>
+<span id="471"> 471</span>
+<span id="472"> 472</span>
+<span id="473"> 473</span>
+<span id="474"> 474</span>
+<span id="475"> 475</span>
+<span id="476"> 476</span>
+<span id="477"> 477</span>
+<span id="478"> 478</span>
+<span id="479"> 479</span>
+<span id="480"> 480</span>
+<span id="481"> 481</span>
+<span id="482"> 482</span>
+<span id="483"> 483</span>
+<span id="484"> 484</span>
+<span id="485"> 485</span>
+<span id="486"> 486</span>
+<span id="487"> 487</span>
+<span id="488"> 488</span>
+<span id="489"> 489</span>
+<span id="490"> 490</span>
+<span id="491"> 491</span>
+<span id="492"> 492</span>
+<span id="493"> 493</span>
+<span id="494"> 494</span>
+<span id="495"> 495</span>
+<span id="496"> 496</span>
+<span id="497"> 497</span>
+<span id="498"> 498</span>
+<span id="499"> 499</span>
+<span id="500"> 500</span>
+<span id="501"> 501</span>
+<span id="502"> 502</span>
+<span id="503"> 503</span>
+<span id="504"> 504</span>
+<span id="505"> 505</span>
+<span id="506"> 506</span>
+<span id="507"> 507</span>
+<span id="508"> 508</span>
+<span id="509"> 509</span>
+<span id="510"> 510</span>
+<span id="511"> 511</span>
+<span id="512"> 512</span>
+<span id="513"> 513</span>
+<span id="514"> 514</span>
+<span id="515"> 515</span>
+<span id="516"> 516</span>
+<span id="517"> 517</span>
+<span id="518"> 518</span>
+<span id="519"> 519</span>
+<span id="520"> 520</span>
+<span id="521"> 521</span>
+<span id="522"> 522</span>
+<span id="523"> 523</span>
+<span id="524"> 524</span>
+<span id="525"> 525</span>
+<span id="526"> 526</span>
+<span id="527"> 527</span>
+<span id="528"> 528</span>
+<span id="529"> 529</span>
+<span id="530"> 530</span>
+<span id="531"> 531</span>
+<span id="532"> 532</span>
+<span id="533"> 533</span>
+<span id="534"> 534</span>
+<span id="535"> 535</span>
+<span id="536"> 536</span>
+<span id="537"> 537</span>
+<span id="538"> 538</span>
+<span id="539"> 539</span>
+<span id="540"> 540</span>
+<span id="541"> 541</span>
+<span id="542"> 542</span>
+<span id="543"> 543</span>
+<span id="544"> 544</span>
+<span id="545"> 545</span>
+<span id="546"> 546</span>
+<span id="547"> 547</span>
+<span id="548"> 548</span>
+<span id="549"> 549</span>
+<span id="550"> 550</span>
+<span id="551"> 551</span>
+<span id="552"> 552</span>
+<span id="553"> 553</span>
+<span id="554"> 554</span>
+<span id="555"> 555</span>
+<span id="556"> 556</span>
+<span id="557"> 557</span>
+<span id="558"> 558</span>
+<span id="559"> 559</span>
+<span id="560"> 560</span>
+<span id="561"> 561</span>
+<span id="562"> 562</span>
+<span id="563"> 563</span>
+<span id="564"> 564</span>
+<span id="565"> 565</span>
+<span id="566"> 566</span>
+<span id="567"> 567</span>
+<span id="568"> 568</span>
+<span id="569"> 569</span>
+<span id="570"> 570</span>
+<span id="571"> 571</span>
+<span id="572"> 572</span>
+<span id="573"> 573</span>
+<span id="574"> 574</span>
+<span id="575"> 575</span>
+<span id="576"> 576</span>
+<span id="577"> 577</span>
+<span id="578"> 578</span>
+<span id="579"> 579</span>
+<span id="580"> 580</span>
+<span id="581"> 581</span>
+<span id="582"> 582</span>
+<span id="583"> 583</span>
+<span id="584"> 584</span>
+<span id="585"> 585</span>
+<span id="586"> 586</span>
+<span id="587"> 587</span>
+<span id="588"> 588</span>
+<span id="589"> 589</span>
+<span id="590"> 590</span>
+<span id="591"> 591</span>
+<span id="592"> 592</span>
+<span id="593"> 593</span>
+<span id="594"> 594</span>
+<span id="595"> 595</span>
+<span id="596"> 596</span>
+<span id="597"> 597</span>
+<span id="598"> 598</span>
+<span id="599"> 599</span>
+<span id="600"> 600</span>
+<span id="601"> 601</span>
+<span id="602"> 602</span>
+<span id="603"> 603</span>
+<span id="604"> 604</span>
+<span id="605"> 605</span>
+<span id="606"> 606</span>
+<span id="607"> 607</span>
+<span id="608"> 608</span>
+<span id="609"> 609</span>
+<span id="610"> 610</span>
+<span id="611"> 611</span>
+<span id="612"> 612</span>
+<span id="613"> 613</span>
+<span id="614"> 614</span>
+<span id="615"> 615</span>
+<span id="616"> 616</span>
+<span id="617"> 617</span>
+<span id="618"> 618</span>
+<span id="619"> 619</span>
+<span id="620"> 620</span>
+<span id="621"> 621</span>
+<span id="622"> 622</span>
+<span id="623"> 623</span>
+<span id="624"> 624</span>
+<span id="625"> 625</span>
+<span id="626"> 626</span>
+<span id="627"> 627</span>
+<span id="628"> 628</span>
+<span id="629"> 629</span>
+<span id="630"> 630</span>
+<span id="631"> 631</span>
+<span id="632"> 632</span>
+<span id="633"> 633</span>
+<span id="634"> 634</span>
+<span id="635"> 635</span>
+<span id="636"> 636</span>
+<span id="637"> 637</span>
+<span id="638"> 638</span>
+<span id="639"> 639</span>
+<span id="640"> 640</span>
+<span id="641"> 641</span>
+<span id="642"> 642</span>
+<span id="643"> 643</span>
+<span id="644"> 644</span>
+<span id="645"> 645</span>
+<span id="646"> 646</span>
+<span id="647"> 647</span>
+<span id="648"> 648</span>
+<span id="649"> 649</span>
+<span id="650"> 650</span>
+<span id="651"> 651</span>
+<span id="652"> 652</span>
+<span id="653"> 653</span>
+<span id="654"> 654</span>
+<span id="655"> 655</span>
+<span id="656"> 656</span>
+<span id="657"> 657</span>
+<span id="658"> 658</span>
+<span id="659"> 659</span>
+<span id="660"> 660</span>
+<span id="661"> 661</span>
+<span id="662"> 662</span>
+<span id="663"> 663</span>
+<span id="664"> 664</span>
+<span id="665"> 665</span>
+<span id="666"> 666</span>
+<span id="667"> 667</span>
+<span id="668"> 668</span>
+<span id="669"> 669</span>
+<span id="670"> 670</span>
+<span id="671"> 671</span>
+<span id="672"> 672</span>
+<span id="673"> 673</span>
+<span id="674"> 674</span>
+<span id="675"> 675</span>
+<span id="676"> 676</span>
+<span id="677"> 677</span>
+<span id="678"> 678</span>
+<span id="679"> 679</span>
+<span id="680"> 680</span>
+<span id="681"> 681</span>
+<span id="682"> 682</span>
+<span id="683"> 683</span>
+<span id="684"> 684</span>
+<span id="685"> 685</span>
+<span id="686"> 686</span>
+<span id="687"> 687</span>
+<span id="688"> 688</span>
+<span id="689"> 689</span>
+<span id="690"> 690</span>
+<span id="691"> 691</span>
+<span id="692"> 692</span>
+<span id="693"> 693</span>
+<span id="694"> 694</span>
+<span id="695"> 695</span>
+<span id="696"> 696</span>
+<span id="697"> 697</span>
+<span id="698"> 698</span>
+<span id="699"> 699</span>
+<span id="700"> 700</span>
+<span id="701"> 701</span>
+<span id="702"> 702</span>
+<span id="703"> 703</span>
+<span id="704"> 704</span>
+<span id="705"> 705</span>
+<span id="706"> 706</span>
+<span id="707"> 707</span>
+<span id="708"> 708</span>
+<span id="709"> 709</span>
+<span id="710"> 710</span>
+<span id="711"> 711</span>
+<span id="712"> 712</span>
+<span id="713"> 713</span>
+<span id="714"> 714</span>
+<span id="715"> 715</span>
+<span id="716"> 716</span>
+<span id="717"> 717</span>
+<span id="718"> 718</span>
+<span id="719"> 719</span>
+<span id="720"> 720</span>
+<span id="721"> 721</span>
+<span id="722"> 722</span>
+<span id="723"> 723</span>
+<span id="724"> 724</span>
+<span id="725"> 725</span>
+<span id="726"> 726</span>
+<span id="727"> 727</span>
+<span id="728"> 728</span>
+<span id="729"> 729</span>
+<span id="730"> 730</span>
+<span id="731"> 731</span>
+<span id="732"> 732</span>
+<span id="733"> 733</span>
+<span id="734"> 734</span>
+<span id="735"> 735</span>
+<span id="736"> 736</span>
+<span id="737"> 737</span>
+<span id="738"> 738</span>
+<span id="739"> 739</span>
+<span id="740"> 740</span>
+<span id="741"> 741</span>
+<span id="742"> 742</span>
+<span id="743"> 743</span>
+<span id="744"> 744</span>
+<span id="745"> 745</span>
+<span id="746"> 746</span>
+<span id="747"> 747</span>
+<span id="748"> 748</span>
+<span id="749"> 749</span>
+<span id="750"> 750</span>
+<span id="751"> 751</span>
+<span id="752"> 752</span>
+<span id="753"> 753</span>
+<span id="754"> 754</span>
+<span id="755"> 755</span>
+<span id="756"> 756</span>
+<span id="757"> 757</span>
+<span id="758"> 758</span>
+<span id="759"> 759</span>
+<span id="760"> 760</span>
+<span id="761"> 761</span>
+<span id="762"> 762</span>
+<span id="763"> 763</span>
+<span id="764"> 764</span>
+<span id="765"> 765</span>
+<span id="766"> 766</span>
+<span id="767"> 767</span>
+<span id="768"> 768</span>
+<span id="769"> 769</span>
+<span id="770"> 770</span>
+<span id="771"> 771</span>
+<span id="772"> 772</span>
+<span id="773"> 773</span>
+<span id="774"> 774</span>
+<span id="775"> 775</span>
+<span id="776"> 776</span>
+<span id="777"> 777</span>
+<span id="778"> 778</span>
+<span id="779"> 779</span>
+<span id="780"> 780</span>
+<span id="781"> 781</span>
+<span id="782"> 782</span>
+<span id="783"> 783</span>
+<span id="784"> 784</span>
+<span id="785"> 785</span>
+<span id="786"> 786</span>
+<span id="787"> 787</span>
+<span id="788"> 788</span>
+<span id="789"> 789</span>
+<span id="790"> 790</span>
+<span id="791"> 791</span>
+<span id="792"> 792</span>
+<span id="793"> 793</span>
+<span id="794"> 794</span>
+<span id="795"> 795</span>
+<span id="796"> 796</span>
+<span id="797"> 797</span>
+<span id="798"> 798</span>
+<span id="799"> 799</span>
+<span id="800"> 800</span>
+<span id="801"> 801</span>
+<span id="802"> 802</span>
+<span id="803"> 803</span>
+<span id="804"> 804</span>
+<span id="805"> 805</span>
+<span id="806"> 806</span>
+<span id="807"> 807</span>
+<span id="808"> 808</span>
+<span id="809"> 809</span>
+<span id="810"> 810</span>
+<span id="811"> 811</span>
+<span id="812"> 812</span>
+<span id="813"> 813</span>
+<span id="814"> 814</span>
+<span id="815"> 815</span>
+<span id="816"> 816</span>
+<span id="817"> 817</span>
+<span id="818"> 818</span>
+<span id="819"> 819</span>
+<span id="820"> 820</span>
+<span id="821"> 821</span>
+<span id="822"> 822</span>
+<span id="823"> 823</span>
+<span id="824"> 824</span>
+<span id="825"> 825</span>
+<span id="826"> 826</span>
+<span id="827"> 827</span>
+<span id="828"> 828</span>
+<span id="829"> 829</span>
+<span id="830"> 830</span>
+<span id="831"> 831</span>
+<span id="832"> 832</span>
+<span id="833"> 833</span>
+<span id="834"> 834</span>
+<span id="835"> 835</span>
+<span id="836"> 836</span>
+<span id="837"> 837</span>
+<span id="838"> 838</span>
+<span id="839"> 839</span>
+<span id="840"> 840</span>
+<span id="841"> 841</span>
+<span id="842"> 842</span>
+<span id="843"> 843</span>
+<span id="844"> 844</span>
+<span id="845"> 845</span>
+<span id="846"> 846</span>
+<span id="847"> 847</span>
+<span id="848"> 848</span>
+<span id="849"> 849</span>
+<span id="850"> 850</span>
+<span id="851"> 851</span>
+<span id="852"> 852</span>
+<span id="853"> 853</span>
+<span id="854"> 854</span>
+<span id="855"> 855</span>
+<span id="856"> 856</span>
+<span id="857"> 857</span>
+<span id="858"> 858</span>
+<span id="859"> 859</span>
+<span id="860"> 860</span>
+<span id="861"> 861</span>
+<span id="862"> 862</span>
+<span id="863"> 863</span>
+<span id="864"> 864</span>
+<span id="865"> 865</span>
+<span id="866"> 866</span>
+<span id="867"> 867</span>
+<span id="868"> 868</span>
+<span id="869"> 869</span>
+<span id="870"> 870</span>
+<span id="871"> 871</span>
+<span id="872"> 872</span>
+<span id="873"> 873</span>
+<span id="874"> 874</span>
+<span id="875"> 875</span>
+<span id="876"> 876</span>
+<span id="877"> 877</span>
+<span id="878"> 878</span>
+<span id="879"> 879</span>
+<span id="880"> 880</span>
+<span id="881"> 881</span>
+<span id="882"> 882</span>
+<span id="883"> 883</span>
+<span id="884"> 884</span>
+<span id="885"> 885</span>
+<span id="886"> 886</span>
+<span id="887"> 887</span>
+<span id="888"> 888</span>
+<span id="889"> 889</span>
+<span id="890"> 890</span>
+<span id="891"> 891</span>
+<span id="892"> 892</span>
+<span id="893"> 893</span>
+<span id="894"> 894</span>
+<span id="895"> 895</span>
+<span id="896"> 896</span>
+<span id="897"> 897</span>
+<span id="898"> 898</span>
+<span id="899"> 899</span>
+<span id="900"> 900</span>
+<span id="901"> 901</span>
+<span id="902"> 902</span>
+<span id="903"> 903</span>
+<span id="904"> 904</span>
+<span id="905"> 905</span>
+<span id="906"> 906</span>
+<span id="907"> 907</span>
+<span id="908"> 908</span>
+<span id="909"> 909</span>
+<span id="910"> 910</span>
+<span id="911"> 911</span>
+<span id="912"> 912</span>
+<span id="913"> 913</span>
+<span id="914"> 914</span>
+<span id="915"> 915</span>
+<span id="916"> 916</span>
+<span id="917"> 917</span>
+<span id="918"> 918</span>
+<span id="919"> 919</span>
+<span id="920"> 920</span>
+<span id="921"> 921</span>
+<span id="922"> 922</span>
+<span id="923"> 923</span>
+<span id="924"> 924</span>
+<span id="925"> 925</span>
+<span id="926"> 926</span>
+<span id="927"> 927</span>
+<span id="928"> 928</span>
+<span id="929"> 929</span>
+<span id="930"> 930</span>
+<span id="931"> 931</span>
+<span id="932"> 932</span>
+<span id="933"> 933</span>
+<span id="934"> 934</span>
+<span id="935"> 935</span>
+<span id="936"> 936</span>
+<span id="937"> 937</span>
+<span id="938"> 938</span>
+<span id="939"> 939</span>
+<span id="940"> 940</span>
+<span id="941"> 941</span>
+<span id="942"> 942</span>
+<span id="943"> 943</span>
+<span id="944"> 944</span>
+<span id="945"> 945</span>
+<span id="946"> 946</span>
+<span id="947"> 947</span>
+<span id="948"> 948</span>
+<span id="949"> 949</span>
+<span id="950"> 950</span>
+<span id="951"> 951</span>
+<span id="952"> 952</span>
+<span id="953"> 953</span>
+<span id="954"> 954</span>
+<span id="955"> 955</span>
+<span id="956"> 956</span>
+<span id="957"> 957</span>
+<span id="958"> 958</span>
+<span id="959"> 959</span>
+<span id="960"> 960</span>
+<span id="961"> 961</span>
+<span id="962"> 962</span>
+<span id="963"> 963</span>
+<span id="964"> 964</span>
+<span id="965"> 965</span>
+<span id="966"> 966</span>
+<span id="967"> 967</span>
+<span id="968"> 968</span>
+<span id="969"> 969</span>
+<span id="970"> 970</span>
+<span id="971"> 971</span>
+<span id="972"> 972</span>
+<span id="973"> 973</span>
+<span id="974"> 974</span>
+<span id="975"> 975</span>
+<span id="976"> 976</span>
+<span id="977"> 977</span>
+<span id="978"> 978</span>
+<span id="979"> 979</span>
+<span id="980"> 980</span>
+<span id="981"> 981</span>
+<span id="982"> 982</span>
+<span id="983"> 983</span>
+<span id="984"> 984</span>
+<span id="985"> 985</span>
+<span id="986"> 986</span>
+<span id="987"> 987</span>
+<span id="988"> 988</span>
+<span id="989"> 989</span>
+<span id="990"> 990</span>
+<span id="991"> 991</span>
+<span id="992"> 992</span>
+<span id="993"> 993</span>
+<span id="994"> 994</span>
+<span id="995"> 995</span>
+<span id="996"> 996</span>
+<span id="997"> 997</span>
+<span id="998"> 998</span>
+<span id="999"> 999</span>
+<span id="1000">1000</span>
+<span id="1001">1001</span>
+<span id="1002">1002</span>
+<span id="1003">1003</span>
+<span id="1004">1004</span>
+<span id="1005">1005</span>
+<span id="1006">1006</span>
+<span id="1007">1007</span>
+<span id="1008">1008</span>
+<span id="1009">1009</span>
+<span id="1010">1010</span>
+<span id="1011">1011</span>
+<span id="1012">1012</span>
+<span id="1013">1013</span>
+<span id="1014">1014</span>
+<span id="1015">1015</span>
+<span id="1016">1016</span>
+<span id="1017">1017</span>
+<span id="1018">1018</span>
+<span id="1019">1019</span>
+<span id="1020">1020</span>
+<span id="1021">1021</span>
+<span id="1022">1022</span>
+<span id="1023">1023</span>
+<span id="1024">1024</span>
+<span id="1025">1025</span>
+<span id="1026">1026</span>
+<span id="1027">1027</span>
+<span id="1028">1028</span>
+<span id="1029">1029</span>
+<span id="1030">1030</span>
+<span id="1031">1031</span>
+<span id="1032">1032</span>
+<span id="1033">1033</span>
+<span id="1034">1034</span>
+<span id="1035">1035</span>
+<span id="1036">1036</span>
+<span id="1037">1037</span>
+<span id="1038">1038</span>
+<span id="1039">1039</span>
+<span id="1040">1040</span>
+<span id="1041">1041</span>
+<span id="1042">1042</span>
+<span id="1043">1043</span>
+<span id="1044">1044</span>
+<span id="1045">1045</span>
+<span id="1046">1046</span>
+<span id="1047">1047</span>
+<span id="1048">1048</span>
+<span id="1049">1049</span>
+<span id="1050">1050</span>
+<span id="1051">1051</span>
+<span id="1052">1052</span>
+<span id="1053">1053</span>
+<span id="1054">1054</span>
+<span id="1055">1055</span>
+<span id="1056">1056</span>
+<span id="1057">1057</span>
+<span id="1058">1058</span>
+<span id="1059">1059</span>
+<span id="1060">1060</span>
+<span id="1061">1061</span>
+<span id="1062">1062</span>
+<span id="1063">1063</span>
+<span id="1064">1064</span>
+<span id="1065">1065</span>
+<span id="1066">1066</span>
+<span id="1067">1067</span>
+<span id="1068">1068</span>
+<span id="1069">1069</span>
+<span id="1070">1070</span>
+<span id="1071">1071</span>
+<span id="1072">1072</span>
+<span id="1073">1073</span>
+<span id="1074">1074</span>
+<span id="1075">1075</span>
+<span id="1076">1076</span>
+<span id="1077">1077</span>
+<span id="1078">1078</span>
+<span id="1079">1079</span>
+<span id="1080">1080</span>
+<span id="1081">1081</span>
+<span id="1082">1082</span>
+<span id="1083">1083</span>
+<span id="1084">1084</span>
+<span id="1085">1085</span>
+<span id="1086">1086</span>
+<span id="1087">1087</span>
+<span id="1088">1088</span>
+<span id="1089">1089</span>
+<span id="1090">1090</span>
+<span id="1091">1091</span>
+<span id="1092">1092</span>
+<span id="1093">1093</span>
+<span id="1094">1094</span>
+<span id="1095">1095</span>
+<span id="1096">1096</span>
+<span id="1097">1097</span>
+<span id="1098">1098</span>
+<span id="1099">1099</span>
+<span id="1100">1100</span>
+<span id="1101">1101</span>
+<span id="1102">1102</span>
+<span id="1103">1103</span>
+<span id="1104">1104</span>
+<span id="1105">1105</span>
+<span id="1106">1106</span>
+<span id="1107">1107</span>
+<span id="1108">1108</span>
+<span id="1109">1109</span>
+<span id="1110">1110</span>
+<span id="1111">1111</span>
+<span id="1112">1112</span>
+<span id="1113">1113</span>
+<span id="1114">1114</span>
+<span id="1115">1115</span>
+<span id="1116">1116</span>
+<span id="1117">1117</span>
+<span id="1118">1118</span>
+<span id="1119">1119</span>
+<span id="1120">1120</span>
+<span id="1121">1121</span>
+<span id="1122">1122</span>
+<span id="1123">1123</span>
+<span id="1124">1124</span>
+<span id="1125">1125</span>
+<span id="1126">1126</span>
+<span id="1127">1127</span>
+<span id="1128">1128</span>
+<span id="1129">1129</span>
+<span id="1130">1130</span>
+<span id="1131">1131</span>
+<span id="1132">1132</span>
+<span id="1133">1133</span>
+<span id="1134">1134</span>
+<span id="1135">1135</span>
+<span id="1136">1136</span>
+<span id="1137">1137</span>
+<span id="1138">1138</span>
+<span id="1139">1139</span>
+<span id="1140">1140</span>
+<span id="1141">1141</span>
+<span id="1142">1142</span>
+<span id="1143">1143</span>
+<span id="1144">1144</span>
+<span id="1145">1145</span>
+<span id="1146">1146</span>
+<span id="1147">1147</span>
+<span id="1148">1148</span>
+<span id="1149">1149</span>
+<span id="1150">1150</span>
+<span id="1151">1151</span>
+<span id="1152">1152</span>
+<span id="1153">1153</span>
+<span id="1154">1154</span>
+<span id="1155">1155</span>
+<span id="1156">1156</span>
+<span id="1157">1157</span>
+<span id="1158">1158</span>
+<span id="1159">1159</span>
+<span id="1160">1160</span>
+<span id="1161">1161</span>
+<span id="1162">1162</span>
+<span id="1163">1163</span>
+<span id="1164">1164</span>
+<span id="1165">1165</span>
+<span id="1166">1166</span>
+<span id="1167">1167</span>
+<span id="1168">1168</span>
+<span id="1169">1169</span>
+<span id="1170">1170</span>
+<span id="1171">1171</span>
+<span id="1172">1172</span>
+<span id="1173">1173</span>
+<span id="1174">1174</span>
+<span id="1175">1175</span>
+<span id="1176">1176</span>
+<span id="1177">1177</span>
+<span id="1178">1178</span>
+<span id="1179">1179</span>
+<span id="1180">1180</span>
+<span id="1181">1181</span>
+<span id="1182">1182</span>
+<span id="1183">1183</span>
+<span id="1184">1184</span>
+<span id="1185">1185</span>
+<span id="1186">1186</span>
+<span id="1187">1187</span>
+<span id="1188">1188</span>
+<span id="1189">1189</span>
+<span id="1190">1190</span>
+<span id="1191">1191</span>
+<span id="1192">1192</span>
+<span id="1193">1193</span>
+<span id="1194">1194</span>
+<span id="1195">1195</span>
+<span id="1196">1196</span>
+<span id="1197">1197</span>
+<span id="1198">1198</span>
+<span id="1199">1199</span>
+<span id="1200">1200</span>
+<span id="1201">1201</span>
+<span id="1202">1202</span>
+<span id="1203">1203</span>
+<span id="1204">1204</span>
+<span id="1205">1205</span>
+<span id="1206">1206</span>
+<span id="1207">1207</span>
+<span id="1208">1208</span>
+<span id="1209">1209</span>
+<span id="1210">1210</span>
+<span id="1211">1211</span>
+<span id="1212">1212</span>
+<span id="1213">1213</span>
+<span id="1214">1214</span>
+<span id="1215">1215</span>
+<span id="1216">1216</span>
+<span id="1217">1217</span>
+<span id="1218">1218</span>
+<span id="1219">1219</span>
+<span id="1220">1220</span>
+<span id="1221">1221</span>
+<span id="1222">1222</span>
+<span id="1223">1223</span>
+<span id="1224">1224</span>
+<span id="1225">1225</span>
+<span id="1226">1226</span>
+<span id="1227">1227</span>
+<span id="1228">1228</span>
+<span id="1229">1229</span>
+<span id="1230">1230</span>
+<span id="1231">1231</span>
+<span id="1232">1232</span>
+<span id="1233">1233</span>
+<span id="1234">1234</span>
+<span id="1235">1235</span>
+<span id="1236">1236</span>
+<span id="1237">1237</span>
+<span id="1238">1238</span>
+<span id="1239">1239</span>
+<span id="1240">1240</span>
+<span id="1241">1241</span>
+<span id="1242">1242</span>
+<span id="1243">1243</span>
+<span id="1244">1244</span>
+<span id="1245">1245</span>
+<span id="1246">1246</span>
+<span id="1247">1247</span>
+<span id="1248">1248</span>
+<span id="1249">1249</span>
+<span id="1250">1250</span>
+<span id="1251">1251</span>
+<span id="1252">1252</span>
+<span id="1253">1253</span>
+<span id="1254">1254</span>
+<span id="1255">1255</span>
+<span id="1256">1256</span>
+<span id="1257">1257</span>
+<span id="1258">1258</span>
+<span id="1259">1259</span>
+<span id="1260">1260</span>
+<span id="1261">1261</span>
+<span id="1262">1262</span>
+<span id="1263">1263</span>
+<span id="1264">1264</span>
+<span id="1265">1265</span>
+<span id="1266">1266</span>
+<span id="1267">1267</span>
+<span id="1268">1268</span>
+<span id="1269">1269</span>
+<span id="1270">1270</span>
+<span id="1271">1271</span>
+<span id="1272">1272</span>
+<span id="1273">1273</span>
+<span id="1274">1274</span>
+<span id="1275">1275</span>
+<span id="1276">1276</span>
+<span id="1277">1277</span>
+<span id="1278">1278</span>
+<span id="1279">1279</span>
+<span id="1280">1280</span>
+<span id="1281">1281</span>
+<span id="1282">1282</span>
+<span id="1283">1283</span>
+<span id="1284">1284</span>
+<span id="1285">1285</span>
+<span id="1286">1286</span>
+<span id="1287">1287</span>
+<span id="1288">1288</span>
+<span id="1289">1289</span>
+<span id="1290">1290</span>
+<span id="1291">1291</span>
+<span id="1292">1292</span>
+<span id="1293">1293</span>
+<span id="1294">1294</span>
+<span id="1295">1295</span>
+<span id="1296">1296</span>
+<span id="1297">1297</span>
+<span id="1298">1298</span>
+<span id="1299">1299</span>
+<span id="1300">1300</span>
+<span id="1301">1301</span>
+<span id="1302">1302</span>
+<span id="1303">1303</span>
+<span id="1304">1304</span>
+<span id="1305">1305</span>
+<span id="1306">1306</span>
+<span id="1307">1307</span>
+<span id="1308">1308</span>
+<span id="1309">1309</span>
+<span id="1310">1310</span>
+<span id="1311">1311</span>
+<span id="1312">1312</span>
+<span id="1313">1313</span>
+<span id="1314">1314</span>
+<span id="1315">1315</span>
+<span id="1316">1316</span>
+<span id="1317">1317</span>
+<span id="1318">1318</span>
+<span id="1319">1319</span>
+<span id="1320">1320</span>
+<span id="1321">1321</span>
+<span id="1322">1322</span>
+<span id="1323">1323</span>
+<span id="1324">1324</span>
+<span id="1325">1325</span>
+<span id="1326">1326</span>
+<span id="1327">1327</span>
+<span id="1328">1328</span>
+<span id="1329">1329</span>
+<span id="1330">1330</span>
+<span id="1331">1331</span>
+<span id="1332">1332</span>
+<span id="1333">1333</span>
+<span id="1334">1334</span>
+<span id="1335">1335</span>
+<span id="1336">1336</span>
+<span id="1337">1337</span>
+<span id="1338">1338</span>
+<span id="1339">1339</span>
+<span id="1340">1340</span>
+<span id="1341">1341</span>
+<span id="1342">1342</span>
+<span id="1343">1343</span>
+<span id="1344">1344</span>
+<span id="1345">1345</span>
+<span id="1346">1346</span>
+<span id="1347">1347</span>
+<span id="1348">1348</span>
+<span id="1349">1349</span>
+<span id="1350">1350</span>
+<span id="1351">1351</span>
+<span id="1352">1352</span>
+<span id="1353">1353</span>
+<span id="1354">1354</span>
+<span id="1355">1355</span>
+<span id="1356">1356</span>
+<span id="1357">1357</span>
+<span id="1358">1358</span>
+<span id="1359">1359</span>
+<span id="1360">1360</span>
+<span id="1361">1361</span>
+<span id="1362">1362</span>
+<span id="1363">1363</span>
+<span id="1364">1364</span>
+<span id="1365">1365</span>
+<span id="1366">1366</span>
+<span id="1367">1367</span>
+<span id="1368">1368</span>
+<span id="1369">1369</span>
+<span id="1370">1370</span>
+<span id="1371">1371</span>
+<span id="1372">1372</span>
+<span id="1373">1373</span>
+<span id="1374">1374</span>
+<span id="1375">1375</span>
+<span id="1376">1376</span>
+<span id="1377">1377</span>
+<span id="1378">1378</span>
+<span id="1379">1379</span>
+<span id="1380">1380</span>
+<span id="1381">1381</span>
+<span id="1382">1382</span>
+<span id="1383">1383</span>
+<span id="1384">1384</span>
+<span id="1385">1385</span>
+<span id="1386">1386</span>
+<span id="1387">1387</span>
+<span id="1388">1388</span>
+<span id="1389">1389</span>
+<span id="1390">1390</span>
+<span id="1391">1391</span>
+<span id="1392">1392</span>
+<span id="1393">1393</span>
+<span id="1394">1394</span>
+<span id="1395">1395</span>
+<span id="1396">1396</span>
+<span id="1397">1397</span>
+<span id="1398">1398</span>
+<span id="1399">1399</span>
+<span id="1400">1400</span>
+<span id="1401">1401</span>
+<span id="1402">1402</span>
+<span id="1403">1403</span>
+<span id="1404">1404</span>
+<span id="1405">1405</span>
+<span id="1406">1406</span>
+<span id="1407">1407</span>
+<span id="1408">1408</span>
+<span id="1409">1409</span>
+<span id="1410">1410</span>
+<span id="1411">1411</span>
+<span id="1412">1412</span>
+<span id="1413">1413</span>
+<span id="1414">1414</span>
+<span id="1415">1415</span>
+<span id="1416">1416</span>
+<span id="1417">1417</span>
+<span id="1418">1418</span>
+<span id="1419">1419</span>
+<span id="1420">1420</span>
+<span id="1421">1421</span>
+<span id="1422">1422</span>
+<span id="1423">1423</span>
+<span id="1424">1424</span>
+<span id="1425">1425</span>
+<span id="1426">1426</span>
+<span id="1427">1427</span>
+<span id="1428">1428</span>
+<span id="1429">1429</span>
+<span id="1430">1430</span>
+<span id="1431">1431</span>
+<span id="1432">1432</span>
+<span id="1433">1433</span>
+<span id="1434">1434</span>
+<span id="1435">1435</span>
+<span id="1436">1436</span>
+<span id="1437">1437</span>
+<span id="1438">1438</span>
+<span id="1439">1439</span>
+<span id="1440">1440</span>
+<span id="1441">1441</span>
+<span id="1442">1442</span>
+<span id="1443">1443</span>
+<span id="1444">1444</span>
+<span id="1445">1445</span>
+<span id="1446">1446</span>
+<span id="1447">1447</span>
+<span id="1448">1448</span>
+<span id="1449">1449</span>
+<span id="1450">1450</span>
+<span id="1451">1451</span>
+<span id="1452">1452</span>
+<span id="1453">1453</span>
+<span id="1454">1454</span>
+<span id="1455">1455</span>
+<span id="1456">1456</span>
+<span id="1457">1457</span>
+<span id="1458">1458</span>
+<span id="1459">1459</span>
+<span id="1460">1460</span>
+<span id="1461">1461</span>
+<span id="1462">1462</span>
+<span id="1463">1463</span>
+<span id="1464">1464</span>
+<span id="1465">1465</span>
+<span id="1466">1466</span>
+<span id="1467">1467</span>
+<span id="1468">1468</span>
+<span id="1469">1469</span>
+<span id="1470">1470</span>
+<span id="1471">1471</span>
+<span id="1472">1472</span>
+<span id="1473">1473</span>
+<span id="1474">1474</span>
+<span id="1475">1475</span>
+<span id="1476">1476</span>
+<span id="1477">1477</span>
+<span id="1478">1478</span>
+<span id="1479">1479</span>
+<span id="1480">1480</span>
+<span id="1481">1481</span>
+<span id="1482">1482</span>
+<span id="1483">1483</span>
+<span id="1484">1484</span>
+<span id="1485">1485</span>
+<span id="1486">1486</span>
+<span id="1487">1487</span>
+<span id="1488">1488</span>
+<span id="1489">1489</span>
+<span id="1490">1490</span>
+<span id="1491">1491</span>
+<span id="1492">1492</span>
+<span id="1493">1493</span>
+<span id="1494">1494</span>
+<span id="1495">1495</span>
+<span id="1496">1496</span>
+<span id="1497">1497</span>
+<span id="1498">1498</span>
+<span id="1499">1499</span>
+<span id="1500">1500</span>
+<span id="1501">1501</span>
+<span id="1502">1502</span>
+<span id="1503">1503</span>
+<span id="1504">1504</span>
+<span id="1505">1505</span>
+<span id="1506">1506</span>
+<span id="1507">1507</span>
+<span id="1508">1508</span>
+<span id="1509">1509</span>
+<span id="1510">1510</span>
+<span id="1511">1511</span>
+<span id="1512">1512</span>
+<span id="1513">1513</span>
+<span id="1514">1514</span>
+<span id="1515">1515</span>
+<span id="1516">1516</span>
+<span id="1517">1517</span>
+<span id="1518">1518</span>
+<span id="1519">1519</span>
+<span id="1520">1520</span>
+<span id="1521">1521</span>
+<span id="1522">1522</span>
+<span id="1523">1523</span>
+<span id="1524">1524</span>
+<span id="1525">1525</span>
+<span id="1526">1526</span>
+<span id="1527">1527</span>
+<span id="1528">1528</span>
+<span id="1529">1529</span>
+<span id="1530">1530</span>
+<span id="1531">1531</span>
+<span id="1532">1532</span>
+<span id="1533">1533</span>
+<span id="1534">1534</span>
+<span id="1535">1535</span>
+<span id="1536">1536</span>
+<span id="1537">1537</span>
+<span id="1538">1538</span>
+<span id="1539">1539</span>
+<span id="1540">1540</span>
+<span id="1541">1541</span>
+<span id="1542">1542</span>
+<span id="1543">1543</span>
+<span id="1544">1544</span>
+<span id="1545">1545</span>
+<span id="1546">1546</span>
+<span id="1547">1547</span>
+<span id="1548">1548</span>
+<span id="1549">1549</span>
+<span id="1550">1550</span>
+<span id="1551">1551</span>
+<span id="1552">1552</span>
+<span id="1553">1553</span>
+<span id="1554">1554</span>
+<span id="1555">1555</span>
+<span id="1556">1556</span>
+<span id="1557">1557</span>
+<span id="1558">1558</span>
+<span id="1559">1559</span>
+<span id="1560">1560</span>
+<span id="1561">1561</span>
+<span id="1562">1562</span>
+<span id="1563">1563</span>
+<span id="1564">1564</span>
+<span id="1565">1565</span>
+<span id="1566">1566</span>
+<span id="1567">1567</span>
+<span id="1568">1568</span>
+<span id="1569">1569</span>
+<span id="1570">1570</span>
+<span id="1571">1571</span>
+<span id="1572">1572</span>
+<span id="1573">1573</span>
+<span id="1574">1574</span>
+<span id="1575">1575</span>
+<span id="1576">1576</span>
+<span id="1577">1577</span>
+<span id="1578">1578</span>
+<span id="1579">1579</span>
+<span id="1580">1580</span>
+<span id="1581">1581</span>
+<span id="1582">1582</span>
+<span id="1583">1583</span>
+<span id="1584">1584</span>
+<span id="1585">1585</span>
+<span id="1586">1586</span>
+<span id="1587">1587</span>
+<span id="1588">1588</span>
+<span id="1589">1589</span>
+<span id="1590">1590</span>
+<span id="1591">1591</span>
+<span id="1592">1592</span>
+<span id="1593">1593</span>
+<span id="1594">1594</span>
+<span id="1595">1595</span>
+<span id="1596">1596</span>
+<span id="1597">1597</span>
+<span id="1598">1598</span>
+<span id="1599">1599</span>
+<span id="1600">1600</span>
+<span id="1601">1601</span>
+<span id="1602">1602</span>
+<span id="1603">1603</span>
+<span id="1604">1604</span>
+<span id="1605">1605</span>
+<span id="1606">1606</span>
+<span id="1607">1607</span>
+<span id="1608">1608</span>
+<span id="1609">1609</span>
+<span id="1610">1610</span>
+<span id="1611">1611</span>
+<span id="1612">1612</span>
+<span id="1613">1613</span>
+<span id="1614">1614</span>
+<span id="1615">1615</span>
+<span id="1616">1616</span>
+<span id="1617">1617</span>
+<span id="1618">1618</span>
+<span id="1619">1619</span>
+<span id="1620">1620</span>
+<span id="1621">1621</span>
+<span id="1622">1622</span>
+<span id="1623">1623</span>
+<span id="1624">1624</span>
+<span id="1625">1625</span>
+<span id="1626">1626</span>
+<span id="1627">1627</span>
+<span id="1628">1628</span>
+<span id="1629">1629</span>
+<span id="1630">1630</span>
+<span id="1631">1631</span>
+<span id="1632">1632</span>
+<span id="1633">1633</span>
+<span id="1634">1634</span>
+<span id="1635">1635</span>
+<span id="1636">1636</span>
+<span id="1637">1637</span>
+<span id="1638">1638</span>
+<span id="1639">1639</span>
+<span id="1640">1640</span>
+<span id="1641">1641</span>
+<span id="1642">1642</span>
+<span id="1643">1643</span>
+<span id="1644">1644</span>
+<span id="1645">1645</span>
+<span id="1646">1646</span>
+<span id="1647">1647</span>
+<span id="1648">1648</span>
+<span id="1649">1649</span>
+<span id="1650">1650</span>
+<span id="1651">1651</span>
+<span id="1652">1652</span>
+<span id="1653">1653</span>
+<span id="1654">1654</span>
+<span id="1655">1655</span>
+<span id="1656">1656</span>
+<span id="1657">1657</span>
+<span id="1658">1658</span>
+<span id="1659">1659</span>
+<span id="1660">1660</span>
+<span id="1661">1661</span>
+<span id="1662">1662</span>
+<span id="1663">1663</span>
+<span id="1664">1664</span>
+<span id="1665">1665</span>
+<span id="1666">1666</span>
+<span id="1667">1667</span>
+<span id="1668">1668</span>
+<span id="1669">1669</span>
+<span id="1670">1670</span>
+<span id="1671">1671</span>
+<span id="1672">1672</span>
+<span id="1673">1673</span>
+<span id="1674">1674</span>
+<span id="1675">1675</span>
+<span id="1676">1676</span>
+<span id="1677">1677</span>
+<span id="1678">1678</span>
+<span id="1679">1679</span>
+<span id="1680">1680</span>
+<span id="1681">1681</span>
+<span id="1682">1682</span>
+<span id="1683">1683</span>
+<span id="1684">1684</span>
+<span id="1685">1685</span>
+<span id="1686">1686</span>
+<span id="1687">1687</span>
+<span id="1688">1688</span>
+<span id="1689">1689</span>
+<span id="1690">1690</span>
+<span id="1691">1691</span>
+<span id="1692">1692</span>
+<span id="1693">1693</span>
+<span id="1694">1694</span>
+<span id="1695">1695</span>
+<span id="1696">1696</span>
+<span id="1697">1697</span>
+<span id="1698">1698</span>
+<span id="1699">1699</span>
+<span id="1700">1700</span>
+<span id="1701">1701</span>
+<span id="1702">1702</span>
+<span id="1703">1703</span>
+<span id="1704">1704</span>
+<span id="1705">1705</span>
+<span id="1706">1706</span>
+<span id="1707">1707</span>
+<span id="1708">1708</span>
+<span id="1709">1709</span>
+<span id="1710">1710</span>
+<span id="1711">1711</span>
+<span id="1712">1712</span>
+<span id="1713">1713</span>
+<span id="1714">1714</span>
+<span id="1715">1715</span>
+<span id="1716">1716</span>
+<span id="1717">1717</span>
+<span id="1718">1718</span>
+<span id="1719">1719</span>
+<span id="1720">1720</span>
+<span id="1721">1721</span>
+<span id="1722">1722</span>
+<span id="1723">1723</span>
+<span id="1724">1724</span>
+<span id="1725">1725</span>
+<span id="1726">1726</span>
+<span id="1727">1727</span>
+<span id="1728">1728</span>
+<span id="1729">1729</span>
+<span id="1730">1730</span>
+<span id="1731">1731</span>
+<span id="1732">1732</span>
+<span id="1733">1733</span>
+<span id="1734">1734</span>
+<span id="1735">1735</span>
+<span id="1736">1736</span>
+<span id="1737">1737</span>
+<span id="1738">1738</span>
+<span id="1739">1739</span>
+<span id="1740">1740</span>
+<span id="1741">1741</span>
+<span id="1742">1742</span>
+<span id="1743">1743</span>
+<span id="1744">1744</span>
+<span id="1745">1745</span>
+<span id="1746">1746</span>
+<span id="1747">1747</span>
+<span id="1748">1748</span>
+<span id="1749">1749</span>
+<span id="1750">1750</span>
+<span id="1751">1751</span>
+<span id="1752">1752</span>
+<span id="1753">1753</span>
+<span id="1754">1754</span>
+<span id="1755">1755</span>
+<span id="1756">1756</span>
+<span id="1757">1757</span>
+<span id="1758">1758</span>
+<span id="1759">1759</span>
+<span id="1760">1760</span>
+<span id="1761">1761</span>
+<span id="1762">1762</span>
+<span id="1763">1763</span>
+<span id="1764">1764</span>
+<span id="1765">1765</span>
+<span id="1766">1766</span>
+<span id="1767">1767</span>
+<span id="1768">1768</span>
+<span id="1769">1769</span>
+<span id="1770">1770</span>
+<span id="1771">1771</span>
+<span id="1772">1772</span>
+<span id="1773">1773</span>
+<span id="1774">1774</span>
+<span id="1775">1775</span>
+<span id="1776">1776</span>
+<span id="1777">1777</span>
+<span id="1778">1778</span>
+<span id="1779">1779</span>
+<span id="1780">1780</span>
+<span id="1781">1781</span>
+<span id="1782">1782</span>
+<span id="1783">1783</span>
+<span id="1784">1784</span>
+<span id="1785">1785</span>
+<span id="1786">1786</span>
+<span id="1787">1787</span>
+<span id="1788">1788</span>
+<span id="1789">1789</span>
+<span id="1790">1790</span>
+<span id="1791">1791</span>
+<span id="1792">1792</span>
+<span id="1793">1793</span>
+<span id="1794">1794</span>
+<span id="1795">1795</span>
+<span id="1796">1796</span>
+<span id="1797">1797</span>
+<span id="1798">1798</span>
+<span id="1799">1799</span>
+<span id="1800">1800</span>
+<span id="1801">1801</span>
+<span id="1802">1802</span>
+<span id="1803">1803</span>
+<span id="1804">1804</span>
+<span id="1805">1805</span>
+<span id="1806">1806</span>
+<span id="1807">1807</span>
+<span id="1808">1808</span>
+<span id="1809">1809</span>
+<span id="1810">1810</span>
+<span id="1811">1811</span>
+<span id="1812">1812</span>
+<span id="1813">1813</span>
+<span id="1814">1814</span>
+<span id="1815">1815</span>
+<span id="1816">1816</span>
+<span id="1817">1817</span>
+<span id="1818">1818</span>
+<span id="1819">1819</span>
+<span id="1820">1820</span>
+<span id="1821">1821</span>
+<span id="1822">1822</span>
+<span id="1823">1823</span>
+<span id="1824">1824</span>
+<span id="1825">1825</span>
+<span id="1826">1826</span>
+<span id="1827">1827</span>
+<span id="1828">1828</span>
+<span id="1829">1829</span>
+<span id="1830">1830</span>
+<span id="1831">1831</span>
+<span id="1832">1832</span>
+<span id="1833">1833</span>
+<span id="1834">1834</span>
+<span id="1835">1835</span>
+<span id="1836">1836</span>
+<span id="1837">1837</span>
+<span id="1838">1838</span>
+<span id="1839">1839</span>
+<span id="1840">1840</span>
+<span id="1841">1841</span>
+<span id="1842">1842</span>
+<span id="1843">1843</span>
+<span id="1844">1844</span>
+<span id="1845">1845</span>
+<span id="1846">1846</span>
+<span id="1847">1847</span>
+<span id="1848">1848</span>
+<span id="1849">1849</span>
+<span id="1850">1850</span>
+<span id="1851">1851</span>
+<span id="1852">1852</span>
+<span id="1853">1853</span>
+<span id="1854">1854</span>
+<span id="1855">1855</span>
+<span id="1856">1856</span>
+<span id="1857">1857</span>
+<span id="1858">1858</span>
+<span id="1859">1859</span>
+<span id="1860">1860</span>
+<span id="1861">1861</span>
+<span id="1862">1862</span>
+<span id="1863">1863</span>
+<span id="1864">1864</span>
+<span id="1865">1865</span>
+<span id="1866">1866</span>
+<span id="1867">1867</span>
+<span id="1868">1868</span>
+<span id="1869">1869</span>
+<span id="1870">1870</span>
+<span id="1871">1871</span>
+<span id="1872">1872</span>
+<span id="1873">1873</span>
+<span id="1874">1874</span>
+<span id="1875">1875</span>
+<span id="1876">1876</span>
+<span id="1877">1877</span>
+<span id="1878">1878</span>
+<span id="1879">1879</span>
+<span id="1880">1880</span>
+<span id="1881">1881</span>
+<span id="1882">1882</span>
+<span id="1883">1883</span>
+<span id="1884">1884</span>
+<span id="1885">1885</span>
+<span id="1886">1886</span>
+<span id="1887">1887</span>
+<span id="1888">1888</span>
+<span id="1889">1889</span>
+<span id="1890">1890</span>
+<span id="1891">1891</span>
+<span id="1892">1892</span>
+<span id="1893">1893</span>
+<span id="1894">1894</span>
+<span id="1895">1895</span>
+<span id="1896">1896</span>
+<span id="1897">1897</span>
+<span id="1898">1898</span>
+<span id="1899">1899</span>
+<span id="1900">1900</span>
+<span id="1901">1901</span>
+<span id="1902">1902</span>
+<span id="1903">1903</span>
+<span id="1904">1904</span>
+<span id="1905">1905</span>
+<span id="1906">1906</span>
+<span id="1907">1907</span>
+<span id="1908">1908</span>
+<span id="1909">1909</span>
+<span id="1910">1910</span>
+<span id="1911">1911</span>
+<span id="1912">1912</span>
+<span id="1913">1913</span>
+<span id="1914">1914</span>
+<span id="1915">1915</span>
+<span id="1916">1916</span>
+<span id="1917">1917</span>
+<span id="1918">1918</span>
+<span id="1919">1919</span>
+<span id="1920">1920</span>
+<span id="1921">1921</span>
+<span id="1922">1922</span>
+<span id="1923">1923</span>
+<span id="1924">1924</span>
+<span id="1925">1925</span>
+<span id="1926">1926</span>
+<span id="1927">1927</span>
+<span id="1928">1928</span>
+<span id="1929">1929</span>
+<span id="1930">1930</span>
+<span id="1931">1931</span>
+<span id="1932">1932</span>
+<span id="1933">1933</span>
+<span id="1934">1934</span>
+<span id="1935">1935</span>
+<span id="1936">1936</span>
+<span id="1937">1937</span>
+<span id="1938">1938</span>
+<span id="1939">1939</span>
+<span id="1940">1940</span>
+<span id="1941">1941</span>
+<span id="1942">1942</span>
+<span id="1943">1943</span>
+<span id="1944">1944</span>
+<span id="1945">1945</span>
+<span id="1946">1946</span>
+<span id="1947">1947</span>
+<span id="1948">1948</span>
+<span id="1949">1949</span>
+<span id="1950">1950</span>
+<span id="1951">1951</span>
+<span id="1952">1952</span>
+<span id="1953">1953</span>
+<span id="1954">1954</span>
+<span id="1955">1955</span>
+<span id="1956">1956</span>
+<span id="1957">1957</span>
+<span id="1958">1958</span>
+<span id="1959">1959</span>
+<span id="1960">1960</span>
+<span id="1961">1961</span>
+<span id="1962">1962</span>
+<span id="1963">1963</span>
+<span id="1964">1964</span>
+<span id="1965">1965</span>
+<span id="1966">1966</span>
+<span id="1967">1967</span>
+<span id="1968">1968</span>
+<span id="1969">1969</span>
+<span id="1970">1970</span>
+<span id="1971">1971</span>
+<span id="1972">1972</span>
+<span id="1973">1973</span>
+<span id="1974">1974</span>
+<span id="1975">1975</span>
+<span id="1976">1976</span>
+<span id="1977">1977</span>
+<span id="1978">1978</span>
+<span id="1979">1979</span>
+<span id="1980">1980</span>
+<span id="1981">1981</span>
+<span id="1982">1982</span>
+<span id="1983">1983</span>
+<span id="1984">1984</span>
+<span id="1985">1985</span>
+<span id="1986">1986</span>
+<span id="1987">1987</span>
+<span id="1988">1988</span>
+<span id="1989">1989</span>
+<span id="1990">1990</span>
+<span id="1991">1991</span>
+<span id="1992">1992</span>
+<span id="1993">1993</span>
+<span id="1994">1994</span>
+<span id="1995">1995</span>
+<span id="1996">1996</span>
+<span id="1997">1997</span>
+<span id="1998">1998</span>
+<span id="1999">1999</span>
+<span id="2000">2000</span>
+<span id="2001">2001</span>
+<span id="2002">2002</span>
+<span id="2003">2003</span>
+<span id="2004">2004</span>
+<span id="2005">2005</span>
+<span id="2006">2006</span>
+<span id="2007">2007</span>
+<span id="2008">2008</span>
+<span id="2009">2009</span>
+<span id="2010">2010</span>
+<span id="2011">2011</span>
+<span id="2012">2012</span>
+<span id="2013">2013</span>
+<span id="2014">2014</span>
+<span id="2015">2015</span>
+<span id="2016">2016</span>
+<span id="2017">2017</span>
+<span id="2018">2018</span>
+<span id="2019">2019</span>
+<span id="2020">2020</span>
+<span id="2021">2021</span>
+<span id="2022">2022</span>
+<span id="2023">2023</span>
+<span id="2024">2024</span>
+<span id="2025">2025</span>
+<span id="2026">2026</span>
+<span id="2027">2027</span>
+<span id="2028">2028</span>
+<span id="2029">2029</span>
+<span id="2030">2030</span>
+<span id="2031">2031</span>
+<span id="2032">2032</span>
+<span id="2033">2033</span>
+<span id="2034">2034</span>
+<span id="2035">2035</span>
+<span id="2036">2036</span>
+<span id="2037">2037</span>
+<span id="2038">2038</span>
+<span id="2039">2039</span>
+<span id="2040">2040</span>
+<span id="2041">2041</span>
+<span id="2042">2042</span>
+<span id="2043">2043</span>
+<span id="2044">2044</span>
+<span id="2045">2045</span>
+<span id="2046">2046</span>
+<span id="2047">2047</span>
+<span id="2048">2048</span>
+<span id="2049">2049</span>
+<span id="2050">2050</span>
+<span id="2051">2051</span>
+<span id="2052">2052</span>
+<span id="2053">2053</span>
+<span id="2054">2054</span>
+<span id="2055">2055</span>
+<span id="2056">2056</span>
+<span id="2057">2057</span>
+<span id="2058">2058</span>
+<span id="2059">2059</span>
+<span id="2060">2060</span>
+<span id="2061">2061</span>
+<span id="2062">2062</span>
+<span id="2063">2063</span>
+<span id="2064">2064</span>
+<span id="2065">2065</span>
+<span id="2066">2066</span>
+<span id="2067">2067</span>
+<span id="2068">2068</span>
+<span id="2069">2069</span>
+<span id="2070">2070</span>
+<span id="2071">2071</span>
+<span id="2072">2072</span>
+<span id="2073">2073</span>
+<span id="2074">2074</span>
+<span id="2075">2075</span>
+<span id="2076">2076</span>
+<span id="2077">2077</span>
+<span id="2078">2078</span>
+<span id="2079">2079</span>
+<span id="2080">2080</span>
+<span id="2081">2081</span>
+<span id="2082">2082</span>
+<span id="2083">2083</span>
+<span id="2084">2084</span>
+<span id="2085">2085</span>
+<span id="2086">2086</span>
+<span id="2087">2087</span>
+<span id="2088">2088</span>
+<span id="2089">2089</span>
+<span id="2090">2090</span>
+<span id="2091">2091</span>
+<span id="2092">2092</span>
+<span id="2093">2093</span>
+<span id="2094">2094</span>
+<span id="2095">2095</span>
+<span id="2096">2096</span>
+<span id="2097">2097</span>
+<span id="2098">2098</span>
+<span id="2099">2099</span>
+<span id="2100">2100</span>
+<span id="2101">2101</span>
+<span id="2102">2102</span>
+<span id="2103">2103</span>
+<span id="2104">2104</span>
+<span id="2105">2105</span>
+<span id="2106">2106</span>
+<span id="2107">2107</span>
+<span id="2108">2108</span>
+<span id="2109">2109</span>
+<span id="2110">2110</span>
+<span id="2111">2111</span>
+<span id="2112">2112</span>
+<span id="2113">2113</span>
+<span id="2114">2114</span>
+<span id="2115">2115</span>
+<span id="2116">2116</span>
+<span id="2117">2117</span>
+<span id="2118">2118</span>
+<span id="2119">2119</span>
+<span id="2120">2120</span>
+<span id="2121">2121</span>
+<span id="2122">2122</span>
+<span id="2123">2123</span>
+<span id="2124">2124</span>
+<span id="2125">2125</span>
+<span id="2126">2126</span>
+<span id="2127">2127</span>
+<span id="2128">2128</span>
+<span id="2129">2129</span>
+<span id="2130">2130</span>
+<span id="2131">2131</span>
+<span id="2132">2132</span>
+<span id="2133">2133</span>
+<span id="2134">2134</span>
+<span id="2135">2135</span>
+<span id="2136">2136</span>
+<span id="2137">2137</span>
+<span id="2138">2138</span>
+<span id="2139">2139</span>
+<span id="2140">2140</span>
+<span id="2141">2141</span>
+<span id="2142">2142</span>
+<span id="2143">2143</span>
+<span id="2144">2144</span>
+<span id="2145">2145</span>
+<span id="2146">2146</span>
+<span id="2147">2147</span>
+<span id="2148">2148</span>
+<span id="2149">2149</span>
+<span id="2150">2150</span>
+<span id="2151">2151</span>
+<span id="2152">2152</span>
+<span id="2153">2153</span>
+<span id="2154">2154</span>
+<span id="2155">2155</span>
+<span id="2156">2156</span>
+<span id="2157">2157</span>
+<span id="2158">2158</span>
+<span id="2159">2159</span>
+<span id="2160">2160</span>
+<span id="2161">2161</span>
+<span id="2162">2162</span>
+<span id="2163">2163</span>
+<span id="2164">2164</span>
+<span id="2165">2165</span>
+<span id="2166">2166</span>
+<span id="2167">2167</span>
+<span id="2168">2168</span>
+<span id="2169">2169</span>
+<span id="2170">2170</span>
+<span id="2171">2171</span>
+<span id="2172">2172</span>
+<span id="2173">2173</span>
+<span id="2174">2174</span>
+<span id="2175">2175</span>
+<span id="2176">2176</span>
+<span id="2177">2177</span>
+<span id="2178">2178</span>
+<span id="2179">2179</span>
+<span id="2180">2180</span>
+<span id="2181">2181</span>
+<span id="2182">2182</span>
+<span id="2183">2183</span>
+<span id="2184">2184</span>
+<span id="2185">2185</span>
+<span id="2186">2186</span>
+<span id="2187">2187</span>
+<span id="2188">2188</span>
+<span id="2189">2189</span>
+<span id="2190">2190</span>
+<span id="2191">2191</span>
+<span id="2192">2192</span>
+<span id="2193">2193</span>
+<span id="2194">2194</span>
+<span id="2195">2195</span>
+<span id="2196">2196</span>
+<span id="2197">2197</span>
+<span id="2198">2198</span>
+<span id="2199">2199</span>
+<span id="2200">2200</span>
+<span id="2201">2201</span>
+<span id="2202">2202</span>
+<span id="2203">2203</span>
+<span id="2204">2204</span>
+<span id="2205">2205</span>
+<span id="2206">2206</span>
+<span id="2207">2207</span>
+<span id="2208">2208</span>
+<span id="2209">2209</span>
+<span id="2210">2210</span>
+<span id="2211">2211</span>
+<span id="2212">2212</span>
+<span id="2213">2213</span>
+<span id="2214">2214</span>
+<span id="2215">2215</span>
+<span id="2216">2216</span>
+<span id="2217">2217</span>
+<span id="2218">2218</span>
+<span id="2219">2219</span>
+<span id="2220">2220</span>
+<span id="2221">2221</span>
+<span id="2222">2222</span>
+<span id="2223">2223</span>
+<span id="2224">2224</span>
+<span id="2225">2225</span>
+<span id="2226">2226</span>
+<span id="2227">2227</span>
+<span id="2228">2228</span>
+<span id="2229">2229</span>
+<span id="2230">2230</span>
+<span id="2231">2231</span>
+<span id="2232">2232</span>
+<span id="2233">2233</span>
+<span id="2234">2234</span>
+<span id="2235">2235</span>
+<span id="2236">2236</span>
+<span id="2237">2237</span>
+<span id="2238">2238</span>
+<span id="2239">2239</span>
+<span id="2240">2240</span>
+<span id="2241">2241</span>
+<span id="2242">2242</span>
+<span id="2243">2243</span>
+<span id="2244">2244</span>
+<span id="2245">2245</span>
+<span id="2246">2246</span>
+<span id="2247">2247</span>
+<span id="2248">2248</span>
+<span id="2249">2249</span>
+<span id="2250">2250</span>
+<span id="2251">2251</span>
+<span id="2252">2252</span>
+<span id="2253">2253</span>
+<span id="2254">2254</span>
+<span id="2255">2255</span>
+<span id="2256">2256</span>
+<span id="2257">2257</span>
+<span id="2258">2258</span>
+<span id="2259">2259</span>
+<span id="2260">2260</span>
+<span id="2261">2261</span>
+<span id="2262">2262</span>
+<span id="2263">2263</span>
+<span id="2264">2264</span>
+<span id="2265">2265</span>
+<span id="2266">2266</span>
+<span id="2267">2267</span>
+<span id="2268">2268</span>
+<span id="2269">2269</span>
+<span id="2270">2270</span>
+<span id="2271">2271</span>
+<span id="2272">2272</span>
+<span id="2273">2273</span>
+<span id="2274">2274</span>
+<span id="2275">2275</span>
+<span id="2276">2276</span>
+<span id="2277">2277</span>
+<span id="2278">2278</span>
+<span id="2279">2279</span>
+<span id="2280">2280</span>
+<span id="2281">2281</span>
+<span id="2282">2282</span>
+<span id="2283">2283</span>
+<span id="2284">2284</span>
+<span id="2285">2285</span>
+<span id="2286">2286</span>
+<span id="2287">2287</span>
+<span id="2288">2288</span>
+<span id="2289">2289</span>
+<span id="2290">2290</span>
+<span id="2291">2291</span>
+<span id="2292">2292</span>
+<span id="2293">2293</span>
+<span id="2294">2294</span>
+<span id="2295">2295</span>
+<span id="2296">2296</span>
+<span id="2297">2297</span>
+<span id="2298">2298</span>
+<span id="2299">2299</span>
+<span id="2300">2300</span>
+<span id="2301">2301</span>
+<span id="2302">2302</span>
+<span id="2303">2303</span>
+<span id="2304">2304</span>
+<span id="2305">2305</span>
+<span id="2306">2306</span>
+<span id="2307">2307</span>
+<span id="2308">2308</span>
+<span id="2309">2309</span>
+<span id="2310">2310</span>
+<span id="2311">2311</span>
+<span id="2312">2312</span>
+<span id="2313">2313</span>
+<span id="2314">2314</span>
+<span id="2315">2315</span>
+<span id="2316">2316</span>
+<span id="2317">2317</span>
+<span id="2318">2318</span>
+<span id="2319">2319</span>
+<span id="2320">2320</span>
+<span id="2321">2321</span>
+<span id="2322">2322</span>
+<span id="2323">2323</span>
+<span id="2324">2324</span>
+<span id="2325">2325</span>
+<span id="2326">2326</span>
+<span id="2327">2327</span>
+<span id="2328">2328</span>
+<span id="2329">2329</span>
+<span id="2330">2330</span>
+<span id="2331">2331</span>
+<span id="2332">2332</span>
+<span id="2333">2333</span>
+<span id="2334">2334</span>
+<span id="2335">2335</span>
+<span id="2336">2336</span>
+<span id="2337">2337</span>
+<span id="2338">2338</span>
+<span id="2339">2339</span>
+<span id="2340">2340</span>
+<span id="2341">2341</span>
+<span id="2342">2342</span>
+<span id="2343">2343</span>
+<span id="2344">2344</span>
+<span id="2345">2345</span>
+<span id="2346">2346</span>
+<span id="2347">2347</span>
+<span id="2348">2348</span>
+<span id="2349">2349</span>
+<span id="2350">2350</span>
+<span id="2351">2351</span>
+<span id="2352">2352</span>
+<span id="2353">2353</span>
+<span id="2354">2354</span>
+<span id="2355">2355</span>
+<span id="2356">2356</span>
+<span id="2357">2357</span>
+<span id="2358">2358</span>
+<span id="2359">2359</span>
+<span id="2360">2360</span>
+<span id="2361">2361</span>
+<span id="2362">2362</span>
+<span id="2363">2363</span>
+<span id="2364">2364</span>
+<span id="2365">2365</span>
+<span id="2366">2366</span>
+<span id="2367">2367</span>
+<span id="2368">2368</span>
+<span id="2369">2369</span>
+<span id="2370">2370</span>
+<span id="2371">2371</span>
+<span id="2372">2372</span>
+<span id="2373">2373</span>
+<span id="2374">2374</span>
+<span id="2375">2375</span>
+<span id="2376">2376</span>
+<span id="2377">2377</span>
+<span id="2378">2378</span>
+<span id="2379">2379</span>
+<span id="2380">2380</span>
+<span id="2381">2381</span>
+<span id="2382">2382</span>
+<span id="2383">2383</span>
+<span id="2384">2384</span>
+<span id="2385">2385</span>
+<span id="2386">2386</span>
+<span id="2387">2387</span>
+<span id="2388">2388</span>
+<span id="2389">2389</span>
+<span id="2390">2390</span>
+<span id="2391">2391</span>
+<span id="2392">2392</span>
+<span id="2393">2393</span>
+<span id="2394">2394</span>
+<span id="2395">2395</span>
+<span id="2396">2396</span>
+<span id="2397">2397</span>
+<span id="2398">2398</span>
+<span id="2399">2399</span>
+<span id="2400">2400</span>
+<span id="2401">2401</span>
+<span id="2402">2402</span>
+<span id="2403">2403</span>
+<span id="2404">2404</span>
+<span id="2405">2405</span>
+<span id="2406">2406</span>
+<span id="2407">2407</span>
+<span id="2408">2408</span>
+<span id="2409">2409</span>
+<span id="2410">2410</span>
+<span id="2411">2411</span>
+<span id="2412">2412</span>
+<span id="2413">2413</span>
+<span id="2414">2414</span>
+<span id="2415">2415</span>
+<span id="2416">2416</span>
+<span id="2417">2417</span>
+<span id="2418">2418</span>
+<span id="2419">2419</span>
+<span id="2420">2420</span>
+<span id="2421">2421</span>
+<span id="2422">2422</span>
+<span id="2423">2423</span>
+<span id="2424">2424</span>
+<span id="2425">2425</span>
+<span id="2426">2426</span>
+<span id="2427">2427</span>
+<span id="2428">2428</span>
+<span id="2429">2429</span>
+<span id="2430">2430</span>
+<span id="2431">2431</span>
+<span id="2432">2432</span>
+<span id="2433">2433</span>
+<span id="2434">2434</span>
+<span id="2435">2435</span>
+<span id="2436">2436</span>
+<span id="2437">2437</span>
+<span id="2438">2438</span>
+<span id="2439">2439</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="doccomment">//! Wallet</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! This module defines the [`Wallet`] structure.</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">cell</span>::<span class="ident">RefCell</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashMap</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::{<span class="ident">BTreeMap</span>, <span class="ident">HashSet</span>};
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ops</span>::{<span class="ident">Deref</span>, <span class="ident">DerefMut</span>};
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>;
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">serialize</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">ChildNumber</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span> <span class="kw">as</span> <span class="ident">PSBT</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Address</span>, <span class="ident">Network</span>, <span class="ident">OutPoint</span>, <span class="ident">Script</span>, <span class="ident">SigHashType</span>, <span class="ident">Transaction</span>, <span class="ident">TxOut</span>, <span class="ident">Txid</span>};
+
+<span class="kw">use</span> <span class="ident">miniscript</span>::<span class="ident">descriptor</span>::<span class="ident">DescriptorPublicKey</span>;
+
+<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_imports</span>)]</span>
+<span class="kw">use</span> <span class="ident">log</span>::{<span class="ident">debug</span>, <span class="ident">error</span>, <span class="ident">info</span>, <span class="ident">trace</span>};
+
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">address_validator</span>;
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">coin_selection</span>;
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">export</span>;
+<span class="kw">mod</span> <span class="ident">rbf</span>;
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">signer</span>;
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">time</span>;
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">tx_builder</span>;
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">mod</span> <span class="ident">utils</span>;
+
+<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">utils</span>::<span class="ident">IsDust</span>;
+
+<span class="kw">use</span> <span class="ident">address_validator</span>::<span class="ident">AddressValidator</span>;
+<span class="kw">use</span> <span class="ident">signer</span>::{<span class="ident">Signer</span>, <span class="ident">SignerId</span>, <span class="ident">SignerOrdering</span>, <span class="ident">SignersContainer</span>};
+<span class="kw">use</span> <span class="ident">tx_builder</span>::<span class="ident">TxBuilder</span>;
+<span class="kw">use</span> <span class="ident">utils</span>::{<span class="ident">After</span>, <span class="ident">Older</span>};
+
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">blockchain</span>::{<span class="ident">Blockchain</span>, <span class="ident">BlockchainMarker</span>, <span class="ident">OfflineBlockchain</span>, <span class="ident">Progress</span>};
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::{<span class="ident">BatchDatabase</span>, <span class="ident">BatchOperations</span>, <span class="ident">DatabaseUtils</span>};
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">descriptor</span>::{
+ <span class="ident">get_checksum</span>, <span class="ident">DescriptorMeta</span>, <span class="ident">DescriptorScripts</span>, <span class="ident">ExtendedDescriptor</span>, <span class="ident">ExtractPolicy</span>, <span class="ident">Policy</span>,
+};
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">psbt</span>::<span class="ident">PSBTUtils</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="kw-2">*</span>;
+
+<span class="kw">const</span> <span class="ident">CACHE_ADDR_BATCH_SIZE</span>: <span class="ident">u32</span> <span class="op">=</span> <span class="number">100</span>;
+
+<span class="doccomment">/// Type alias for a [`Wallet`] that uses [`OfflineBlockchain`]</span>
+<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">OfflineWallet</span><span class="op"><</span><span class="ident">D</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span><span class="op"><</span><span class="ident">OfflineBlockchain</span>, <span class="ident">D</span><span class="op">></span>;
+
+<span class="doccomment">/// A Bitcoin wallet</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// A wallet takes descriptors, a [`database`](crate::database) and a</span>
+<span class="doccomment">/// [`blockchain`](crate::blockchain) and implements the basic functions that a Bitcoin wallets</span>
+<span class="doccomment">/// needs to operate, like [generating addresses](Wallet::get_new_address), [returning the balance](Wallet::get_balance),</span>
+<span class="doccomment">/// [creating transactions](Wallet::create_tx), etc.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// A wallet can be either "online" if the [`blockchain`](crate::blockchain) type provided</span>
+<span class="doccomment">/// implements [`Blockchain`], or "offline" [`OfflineBlockchain`] is used. Offline wallets only expose</span>
+<span class="doccomment">/// methods that don't need any interaction with the blockchain to work.</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Wallet</span><span class="op"><</span><span class="ident">B</span>: <span class="ident">BlockchainMarker</span>, <span class="ident">D</span>: <span class="ident">BatchDatabase</span><span class="op">></span> {
+ <span class="ident">descriptor</span>: <span class="ident">ExtendedDescriptor</span>,
+ <span class="ident">change_descriptor</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">ExtendedDescriptor</span><span class="op">></span>,
+
+ <span class="ident">signers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span><span class="op">></span>,
+ <span class="ident">change_signers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span><span class="op">></span>,
+
+ <span class="ident">address_validators</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">AddressValidator</span><span class="op">></span><span class="op">></span><span class="op">></span>,
+
+ <span class="ident">network</span>: <span class="ident">Network</span>,
+
+ <span class="ident">current_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+
+ <span class="ident">client</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">B</span><span class="op">></span>,
+ <span class="ident">database</span>: <span class="ident">RefCell</span><span class="op"><</span><span class="ident">D</span><span class="op">></span>,
+}
+
+<span class="comment">// offline actions, always available</span>
+<span class="kw">impl</span><span class="op"><</span><span class="ident">B</span>, <span class="ident">D</span><span class="op">></span> <span class="ident">Wallet</span><span class="op"><</span><span class="ident">B</span>, <span class="ident">D</span><span class="op">></span>
+<span class="kw">where</span>
+ <span class="ident">B</span>: <span class="ident">BlockchainMarker</span>,
+ <span class="ident">D</span>: <span class="ident">BatchDatabase</span>,
+{
+ <span class="doccomment">/// Create a new "offline" wallet</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new_offline</span>(
+ <span class="ident">descriptor</span>: <span class="kw-2">&</span><span class="ident">str</span>,
+ <span class="ident">change_descriptor</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">str</span><span class="op">></span>,
+ <span class="ident">network</span>: <span class="ident">Network</span>,
+ <span class="kw-2">mut</span> <span class="ident">database</span>: <span class="ident">D</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="ident">database</span>.<span class="ident">check_descriptor_checksum</span>(
+ <span class="ident">ScriptType</span>::<span class="ident">External</span>,
+ <span class="ident">get_checksum</span>(<span class="ident">descriptor</span>)<span class="question-mark">?</span>.<span class="ident">as_bytes</span>(),
+ )<span class="question-mark">?</span>;
+ <span class="kw">let</span> (<span class="ident">descriptor</span>, <span class="ident">keymap</span>) <span class="op">=</span> <span class="ident">ExtendedDescriptor</span>::<span class="ident">parse_secret</span>(<span class="ident">descriptor</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">signers</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">SignersContainer</span>::<span class="ident">from</span>(<span class="ident">keymap</span>));
+ <span class="kw">let</span> (<span class="ident">change_descriptor</span>, <span class="ident">change_signers</span>) <span class="op">=</span> <span class="kw">match</span> <span class="ident">change_descriptor</span> {
+ <span class="prelude-val">Some</span>(<span class="ident">desc</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="ident">database</span>.<span class="ident">check_descriptor_checksum</span>(
+ <span class="ident">ScriptType</span>::<span class="ident">Internal</span>,
+ <span class="ident">get_checksum</span>(<span class="ident">desc</span>)<span class="question-mark">?</span>.<span class="ident">as_bytes</span>(),
+ )<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> (<span class="ident">change_descriptor</span>, <span class="ident">change_keymap</span>) <span class="op">=</span> <span class="ident">ExtendedDescriptor</span>::<span class="ident">parse_secret</span>(<span class="ident">desc</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">change_signers</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">SignersContainer</span>::<span class="ident">from</span>(<span class="ident">change_keymap</span>));
+ <span class="comment">// if !parsed.same_structure(descriptor.as_ref()) {</span>
+ <span class="comment">// return Err(Error::DifferentDescriptorStructure);</span>
+ <span class="comment">// }</span>
+
+ (<span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>), <span class="ident">change_signers</span>)
+ }
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> (<span class="prelude-val">None</span>, <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">SignersContainer</span>::<span class="ident">new</span>())),
+ };
+
+ <span class="prelude-val">Ok</span>(<span class="ident">Wallet</span> {
+ <span class="ident">descriptor</span>,
+ <span class="ident">change_descriptor</span>,
+ <span class="ident">signers</span>,
+ <span class="ident">change_signers</span>,
+ <span class="ident">address_validators</span>: <span class="ident">Vec</span>::<span class="ident">new</span>(),
+
+ <span class="ident">network</span>,
+
+ <span class="ident">current_height</span>: <span class="prelude-val">None</span>,
+
+ <span class="ident">client</span>: <span class="prelude-val">None</span>,
+ <span class="ident">database</span>: <span class="ident">RefCell</span>::<span class="ident">new</span>(<span class="ident">database</span>),
+ })
+ }
+
+ <span class="doccomment">/// Return a newly generated address using the external descriptor</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_new_address</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Address</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">index</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">fetch_and_increment_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>)<span class="question-mark">?</span>;
+
+ <span class="self">self</span>.<span class="ident">descriptor</span>
+ .<span class="ident">derive</span>(<span class="kw-2">&</span>[<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">index</span>).<span class="ident">unwrap</span>()])
+ .<span class="ident">address</span>(<span class="self">self</span>.<span class="ident">network</span>)
+ .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">ScriptDoesntHaveAddressForm</span>)
+ }
+
+ <span class="doccomment">/// Return whether or not a `script` is part of this wallet (either internal or external)</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_mine</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">bool</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">is_mine</span>(<span class="ident">script</span>)
+ }
+
+ <span class="doccomment">/// Return the list of unspent outputs of this wallet</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// Note that this methods only operate on the internal database, which first needs to be</span>
+ <span class="doccomment">/// [`Wallet::sync`] manually.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">list_unspent</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">iter_utxos</span>()
+ }
+
+ <span class="doccomment">/// Return the list of transactions made and received by the wallet</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// Optionally fill the [`TransactionDetails::transaction`] field with the raw transaction if</span>
+ <span class="doccomment">/// `include_raw` is `true`.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// Note that this methods only operate on the internal database, which first needs to be</span>
+ <span class="doccomment">/// [`Wallet::sync`] manually.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">list_transactions</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">include_raw</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">iter_txs</span>(<span class="ident">include_raw</span>)
+ }
+
+ <span class="doccomment">/// Return the balance, meaning the sum of this wallet's unspent outputs' values</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// Note that this methods only operate on the internal database, which first needs to be</span>
+ <span class="doccomment">/// [`Wallet::sync`] manually.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_balance</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u64</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>
+ .<span class="ident">list_unspent</span>()<span class="question-mark">?</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">fold</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">sum</span>, <span class="ident">i</span><span class="op">|</span> <span class="ident">sum</span> <span class="op">+</span> <span class="ident">i</span>.<span class="ident">txout</span>.<span class="ident">value</span>))
+ }
+
+ <span class="doccomment">/// Add an external signer</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// See [the `signer` module](signer) for an example.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">add_signer</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
+ <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
+ <span class="ident">id</span>: <span class="ident">SignerId</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span>,
+ <span class="ident">ordering</span>: <span class="ident">SignerOrdering</span>,
+ <span class="ident">signer</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Signer</span><span class="op">></span><span class="op">></span>,
+ ) {
+ <span class="kw">let</span> <span class="ident">signers</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">script_type</span> {
+ <span class="ident">ScriptType</span>::<span class="ident">External</span> <span class="op">=</span><span class="op">></span> <span class="ident">Arc</span>::<span class="ident">make_mut</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">signers</span>),
+ <span class="ident">ScriptType</span>::<span class="ident">Internal</span> <span class="op">=</span><span class="op">></span> <span class="ident">Arc</span>::<span class="ident">make_mut</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">change_signers</span>),
+ };
+
+ <span class="ident">signers</span>.<span class="ident">add_external</span>(<span class="ident">id</span>, <span class="ident">ordering</span>, <span class="ident">signer</span>);
+ }
+
+ <span class="doccomment">/// Add an address validator</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// See [the `address_validator` module](address_validator) for an example.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">add_address_validator</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">validator</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">AddressValidator</span><span class="op">></span><span class="op">></span>) {
+ <span class="self">self</span>.<span class="ident">address_validators</span>.<span class="ident">push</span>(<span class="ident">validator</span>);
+ }
+
+ <span class="doccomment">/// Create a new transaction following the options specified in the `builder`</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// ## Example</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// ```no_run</span>
+ <span class="doccomment">/// # use std::str::FromStr;</span>
+ <span class="doccomment">/// # use bitcoin::*;</span>
+ <span class="doccomment">/// # use bdk::*;</span>
+ <span class="doccomment">/// # use bdk::database::*;</span>
+ <span class="doccomment">/// # let descriptor = "wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)";</span>
+ <span class="doccomment">/// # let wallet: OfflineWallet<_> = Wallet::new_offline(descriptor, None, Network::Testnet, MemoryDatabase::default())?;</span>
+ <span class="doccomment">/// # let to_address = Address::from_str("2N4eQYCbKUHCCTUjBJeHcJp9ok6J2GZsTDt").unwrap();</span>
+ <span class="doccomment">/// let (psbt, details) = wallet.create_tx(</span>
+ <span class="doccomment">/// TxBuilder::with_recipients(vec![(to_address.script_pubkey(), 50_000)])</span>
+ <span class="doccomment">/// )?;</span>
+ <span class="doccomment">/// // sign and broadcast ...</span>
+ <span class="doccomment">/// # Ok::<(), bdk::Error>(())</span>
+ <span class="doccomment">/// ```</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">create_tx</span><span class="op"><</span><span class="ident">Cs</span>: <span class="ident">coin_selection</span>::<span class="ident">CoinSelectionAlgorithm</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">builder</span>: <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">Cs</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">PSBT</span>, <span class="ident">TransactionDetails</span>), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">recipients</span>.<span class="ident">is_empty</span>() {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">NoAddressees</span>);
+ }
+
+ <span class="comment">// TODO: fetch both internal and external policies</span>
+ <span class="kw">let</span> <span class="ident">policy</span> <span class="op">=</span> <span class="self">self</span>
+ .<span class="ident">descriptor</span>
+ .<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">signers</span>))<span class="question-mark">?</span>
+ .<span class="ident">unwrap</span>();
+ <span class="kw">if</span> <span class="ident">policy</span>.<span class="ident">requires_path</span>() <span class="kw-2">&</span><span class="op">&</span> <span class="ident">builder</span>.<span class="ident">policy_path</span>.<span class="ident">is_none</span>() {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">SpendingPolicyRequired</span>);
+ }
+ <span class="kw">let</span> <span class="ident">requirements</span> <span class="op">=</span>
+ <span class="ident">policy</span>.<span class="ident">get_condition</span>(<span class="ident">builder</span>.<span class="ident">policy_path</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap_or</span>(<span class="kw-2">&</span><span class="ident">BTreeMap</span>::<span class="ident">new</span>()))<span class="question-mark">?</span>;
+ <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"requirements: {:?}"</span>, <span class="ident">requirements</span>);
+
+ <span class="kw">let</span> <span class="ident">version</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">builder</span>.<span class="ident">version</span> {
+ <span class="prelude-val">Some</span>(<span class="ident">tx_builder</span>::<span class="ident">Version</span>(<span class="number">0</span>)) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">Generic</span>(<span class="string">"Invalid version `0`"</span>.<span class="ident">into</span>()))
+ }
+ <span class="prelude-val">Some</span>(<span class="ident">tx_builder</span>::<span class="ident">Version</span>(<span class="number">1</span>)) <span class="kw">if</span> <span class="ident">requirements</span>.<span class="ident">csv</span>.<span class="ident">is_some</span>() <span class="op">=</span><span class="op">></span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">Generic</span>(
+ <span class="string">"TxBuilder requested version `1`, but at least `2` is needed to use OP_CSV"</span>
+ .<span class="ident">into</span>(),
+ ))
+ }
+ <span class="prelude-val">Some</span>(<span class="ident">tx_builder</span>::<span class="ident">Version</span>(<span class="ident">x</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">x</span>,
+ <span class="prelude-val">None</span> <span class="kw">if</span> <span class="ident">requirements</span>.<span class="ident">csv</span>.<span class="ident">is_some</span>() <span class="op">=</span><span class="op">></span> <span class="number">2</span>,
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="number">1</span>,
+ };
+
+ <span class="kw">let</span> <span class="ident">lock_time</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">builder</span>.<span class="ident">locktime</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="ident">requirements</span>.<span class="ident">timelock</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="kw">if</span> <span class="ident">requirements</span>.<span class="ident">timelock</span>.<span class="ident">is_none</span>() <span class="op">=</span><span class="op">></span> <span class="ident">x</span>,
+ <span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="kw">if</span> <span class="ident">requirements</span>.<span class="ident">timelock</span>.<span class="ident">unwrap</span>() <span class="op"><</span><span class="op">=</span> <span class="ident">x</span> <span class="op">=</span><span class="op">></span> <span class="ident">x</span>,
+ <span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">Generic</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"TxBuilder requested timelock of `{}`, but at least `{}` is required to spend from this script"</span>, <span class="ident">x</span>, <span class="ident">requirements</span>.<span class="ident">timelock</span>.<span class="ident">unwrap</span>())))
+ };
+
+ <span class="kw">let</span> <span class="ident">n_sequence</span> <span class="op">=</span> <span class="kw">match</span> (<span class="ident">builder</span>.<span class="ident">rbf</span>, <span class="ident">requirements</span>.<span class="ident">csv</span>) {
+ (<span class="prelude-val">None</span>, <span class="prelude-val">Some</span>(<span class="ident">csv</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">csv</span>,
+ (<span class="prelude-val">Some</span>(<span class="ident">rbf</span>), <span class="prelude-val">Some</span>(<span class="ident">csv</span>)) <span class="kw">if</span> <span class="ident">rbf</span> <span class="op"><</span> <span class="ident">csv</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">Generic</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"Cannot enable RBF with nSequence `{}`, since at least `{}` is required to spend with OP_CSV"</span>, <span class="ident">rbf</span>, <span class="ident">csv</span>))),
+ (<span class="prelude-val">None</span>, <span class="kw">_</span>) <span class="kw">if</span> <span class="ident">requirements</span>.<span class="ident">timelock</span>.<span class="ident">is_some</span>() <span class="op">=</span><span class="op">></span> <span class="number">0xFFFFFFFE</span>,
+ (<span class="prelude-val">Some</span>(<span class="ident">rbf</span>), <span class="kw">_</span>) <span class="kw">if</span> <span class="ident">rbf</span> <span class="op">></span><span class="op">=</span> <span class="number">0xFFFFFFFE</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">Generic</span>(<span class="string">"Cannot enable RBF with a nSequence >= 0xFFFFFFFE"</span>.<span class="ident">into</span>())),
+ (<span class="prelude-val">Some</span>(<span class="ident">rbf</span>), <span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="ident">rbf</span>,
+ (<span class="prelude-val">None</span>, <span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="number">0xFFFFFFFF</span>,
+ };
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">Transaction</span> {
+ <span class="ident">version</span>,
+ <span class="ident">lock_time</span>,
+ <span class="ident">input</span>: <span class="macro">vec</span><span class="macro">!</span>[],
+ <span class="ident">output</span>: <span class="macro">vec</span><span class="macro">!</span>[],
+ };
+
+ <span class="kw">let</span> <span class="ident">fee_rate</span> <span class="op">=</span> <span class="ident">builder</span>.<span class="ident">fee_rate</span>.<span class="ident">unwrap_or_default</span>();
+ <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">send_all</span> <span class="kw-2">&</span><span class="op">&</span> <span class="ident">builder</span>.<span class="ident">recipients</span>.<span class="ident">len</span>() <span class="op">!</span><span class="op">=</span> <span class="number">1</span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">SendAllMultipleOutputs</span>);
+ }
+
+ <span class="comment">// we keep it as a float while we accumulate it, and only round it at the end</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">fee_amount</span>: <span class="ident">f32</span> <span class="op">=</span> <span class="number">0.0</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">outgoing</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">received</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
+
+ <span class="kw">let</span> <span class="ident">calc_fee_bytes</span> <span class="op">=</span> <span class="op">|</span><span class="ident">wu</span><span class="op">|</span> (<span class="ident">wu</span> <span class="kw">as</span> <span class="ident">f32</span>) <span class="op">*</span> <span class="ident">fee_rate</span>.<span class="ident">as_sat_vb</span>() <span class="op">/</span> <span class="number">4.0</span>;
+ <span class="ident">fee_amount</span> <span class="op">+</span><span class="op">=</span> <span class="ident">calc_fee_bytes</span>(<span class="ident">tx</span>.<span class="ident">get_weight</span>());
+
+ <span class="kw">for</span> (<span class="ident">index</span>, (<span class="ident">script_pubkey</span>, <span class="ident">satoshi</span>)) <span class="kw">in</span> <span class="ident">builder</span>.<span class="ident">recipients</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
+ <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">builder</span>.<span class="ident">send_all</span> {
+ <span class="bool-val">true</span> <span class="op">=</span><span class="op">></span> <span class="number">0</span>,
+ <span class="bool-val">false</span> <span class="kw">if</span> <span class="ident">satoshi</span>.<span class="ident">is_dust</span>() <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">OutputBelowDustLimit</span>(<span class="ident">index</span>)),
+ <span class="bool-val">false</span> <span class="op">=</span><span class="op">></span> <span class="kw-2">*</span><span class="ident">satoshi</span>,
+ };
+
+ <span class="kw">if</span> <span class="self">self</span>.<span class="ident">is_mine</span>(<span class="ident">script_pubkey</span>)<span class="question-mark">?</span> {
+ <span class="ident">received</span> <span class="op">+</span><span class="op">=</span> <span class="ident">value</span>;
+ }
+
+ <span class="kw">let</span> <span class="ident">new_out</span> <span class="op">=</span> <span class="ident">TxOut</span> {
+ <span class="ident">script_pubkey</span>: <span class="ident">script_pubkey</span>.<span class="ident">clone</span>(),
+ <span class="ident">value</span>,
+ };
+ <span class="ident">fee_amount</span> <span class="op">+</span><span class="op">=</span> <span class="ident">calc_fee_bytes</span>(<span class="ident">serialize</span>(<span class="kw-2">&</span><span class="ident">new_out</span>).<span class="ident">len</span>() <span class="op">*</span> <span class="number">4</span>);
+
+ <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">push</span>(<span class="ident">new_out</span>);
+
+ <span class="ident">outgoing</span> <span class="op">+</span><span class="op">=</span> <span class="ident">value</span>;
+ }
+
+ <span class="comment">// TODO: use the right weight instead of the maximum, and only fall-back to it if the</span>
+ <span class="comment">// script is unknown in the database</span>
+ <span class="kw">let</span> <span class="ident">input_witness_weight</span> <span class="op">=</span> <span class="ident">std</span>::<span class="ident">cmp</span>::<span class="ident">max</span>(
+ <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>)
+ .<span class="number">0</span>
+ .<span class="ident">max_satisfaction_weight</span>(),
+ <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>)
+ .<span class="number">0</span>
+ .<span class="ident">max_satisfaction_weight</span>(),
+ );
+
+ <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">change_policy</span> <span class="op">!</span><span class="op">=</span> <span class="ident">tx_builder</span>::<span class="ident">ChangeSpendPolicy</span>::<span class="ident">ChangeAllowed</span>
+ <span class="kw-2">&</span><span class="op">&</span> <span class="self">self</span>.<span class="ident">change_descriptor</span>.<span class="ident">is_none</span>()
+ {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">Generic</span>(
+ <span class="string">"The `change_policy` can be set only if the wallet has a change_descriptor"</span>.<span class="ident">into</span>(),
+ ));
+ }
+
+ <span class="kw">let</span> (<span class="ident">available_utxos</span>, <span class="ident">use_all_utxos</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_available_utxos</span>(
+ <span class="ident">builder</span>.<span class="ident">change_policy</span>,
+ <span class="kw-2">&</span><span class="ident">builder</span>.<span class="ident">utxos</span>,
+ <span class="kw-2">&</span><span class="ident">builder</span>.<span class="ident">unspendable</span>,
+ <span class="ident">builder</span>.<span class="ident">send_all</span>,
+ )<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">coin_selection</span>::<span class="ident">CoinSelectionResult</span> {
+ <span class="ident">txin</span>,
+ <span class="ident">selected_amount</span>,
+ <span class="kw-2">mut</span> <span class="ident">fee_amount</span>,
+ } <span class="op">=</span> <span class="ident">builder</span>.<span class="ident">coin_selection</span>.<span class="ident">coin_select</span>(
+ <span class="ident">available_utxos</span>,
+ <span class="ident">use_all_utxos</span>,
+ <span class="ident">fee_rate</span>,
+ <span class="ident">outgoing</span>,
+ <span class="ident">input_witness_weight</span>,
+ <span class="ident">fee_amount</span>,
+ )<span class="question-mark">?</span>;
+ <span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">txin</span>, <span class="ident">prev_script_pubkeys</span>): (<span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>) <span class="op">=</span> <span class="ident">txin</span>.<span class="ident">into_iter</span>().<span class="ident">unzip</span>();
+ <span class="comment">// map that allows us to lookup the prev_script_pubkey for a given previous_output</span>
+ <span class="kw">let</span> <span class="ident">prev_script_pubkeys</span> <span class="op">=</span> <span class="ident">txin</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">zip</span>(<span class="ident">prev_script_pubkeys</span>.<span class="ident">into_iter</span>())
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">txin</span>, <span class="ident">script</span>)<span class="op">|</span> (<span class="ident">txin</span>.<span class="ident">previous_output</span>, <span class="ident">script</span>))
+ .<span class="ident">collect</span>::<span class="op"><</span><span class="ident">HashMap</span><span class="op"><</span><span class="kw">_</span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>();
+
+ <span class="ident">txin</span>.<span class="ident">iter_mut</span>().<span class="ident">for_each</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> <span class="ident">i</span>.<span class="ident">sequence</span> <span class="op">=</span> <span class="ident">n_sequence</span>);
+ <span class="ident">tx</span>.<span class="ident">input</span> <span class="op">=</span> <span class="ident">txin</span>;
+
+ <span class="comment">// prepare the change output</span>
+ <span class="kw">let</span> <span class="ident">change_output</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">builder</span>.<span class="ident">send_all</span> {
+ <span class="bool-val">true</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
+ <span class="bool-val">false</span> <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">change_script</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_change_address</span>()<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">change_output</span> <span class="op">=</span> <span class="ident">TxOut</span> {
+ <span class="ident">script_pubkey</span>: <span class="ident">change_script</span>,
+ <span class="ident">value</span>: <span class="number">0</span>,
+ };
+
+ <span class="comment">// take the change into account for fees</span>
+ <span class="ident">fee_amount</span> <span class="op">+</span><span class="op">=</span> <span class="ident">calc_fee_bytes</span>(<span class="ident">serialize</span>(<span class="kw-2">&</span><span class="ident">change_output</span>).<span class="ident">len</span>() <span class="op">*</span> <span class="number">4</span>);
+ <span class="prelude-val">Some</span>(<span class="ident">change_output</span>)
+ }
+ };
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">fee_amount</span> <span class="op">=</span> <span class="ident">fee_amount</span>.<span class="ident">ceil</span>() <span class="kw">as</span> <span class="ident">u64</span>;
+ <span class="kw">let</span> <span class="ident">change_val</span> <span class="op">=</span> <span class="ident">selected_amount</span> <span class="op">-</span> <span class="ident">outgoing</span> <span class="op">-</span> <span class="ident">fee_amount</span>;
+ <span class="kw">if</span> <span class="op">!</span><span class="ident">builder</span>.<span class="ident">send_all</span> <span class="kw-2">&</span><span class="op">&</span> <span class="op">!</span><span class="ident">change_val</span>.<span class="ident">is_dust</span>() {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">change_output</span> <span class="op">=</span> <span class="ident">change_output</span>.<span class="ident">unwrap</span>();
+ <span class="ident">change_output</span>.<span class="ident">value</span> <span class="op">=</span> <span class="ident">change_val</span>;
+ <span class="ident">received</span> <span class="op">+</span><span class="op">=</span> <span class="ident">change_val</span>;
+
+ <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">push</span>(<span class="ident">change_output</span>);
+ } <span class="kw">else</span> <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">send_all</span> <span class="kw-2">&</span><span class="op">&</span> <span class="op">!</span><span class="ident">change_val</span>.<span class="ident">is_dust</span>() {
+ <span class="comment">// there's only one output, send everything to it</span>
+ <span class="ident">tx</span>.<span class="ident">output</span>[<span class="number">0</span>].<span class="ident">value</span> <span class="op">=</span> <span class="ident">change_val</span>;
+
+ <span class="comment">// send_all to our address</span>
+ <span class="kw">if</span> <span class="self">self</span>.<span class="ident">is_mine</span>(<span class="kw-2">&</span><span class="ident">tx</span>.<span class="ident">output</span>[<span class="number">0</span>].<span class="ident">script_pubkey</span>)<span class="question-mark">?</span> {
+ <span class="ident">received</span> <span class="op">=</span> <span class="ident">change_val</span>;
+ }
+ } <span class="kw">else</span> <span class="kw">if</span> <span class="op">!</span><span class="ident">builder</span>.<span class="ident">send_all</span> <span class="kw-2">&</span><span class="op">&</span> <span class="ident">change_val</span>.<span class="ident">is_dust</span>() {
+ <span class="comment">// skip the change output because it's dust, this adds up to the fees</span>
+ <span class="ident">fee_amount</span> <span class="op">+</span><span class="op">=</span> <span class="ident">change_val</span>;
+ } <span class="kw">else</span> <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">send_all</span> {
+ <span class="comment">// send_all but the only output would be below dust limit</span>
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">InsufficientFunds</span>); <span class="comment">// TODO: or OutputBelowDustLimit?</span>
+ }
+
+ <span class="comment">// sort input/outputs according to the chosen algorithm</span>
+ <span class="ident">builder</span>.<span class="ident">ordering</span>.<span class="ident">sort_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>);
+
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
+ <span class="kw">let</span> <span class="ident">psbt</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">complete_transaction</span>(<span class="ident">tx</span>, <span class="ident">prev_script_pubkeys</span>, <span class="ident">builder</span>)<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="ident">transaction_details</span> <span class="op">=</span> <span class="ident">TransactionDetails</span> {
+ <span class="ident">transaction</span>: <span class="prelude-val">None</span>,
+ <span class="ident">txid</span>,
+ <span class="ident">timestamp</span>: <span class="ident">time</span>::<span class="ident">get_timestamp</span>(),
+ <span class="ident">received</span>,
+ <span class="ident">sent</span>: <span class="ident">selected_amount</span>,
+ <span class="ident">fees</span>: <span class="ident">fee_amount</span>,
+ <span class="ident">height</span>: <span class="prelude-val">None</span>,
+ };
+
+ <span class="prelude-val">Ok</span>((<span class="ident">psbt</span>, <span class="ident">transaction_details</span>))
+ }
+
+ <span class="doccomment">/// Bump the fee of a transaction following the options specified in the `builder`</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// Return an error if the transaction is already confirmed or doesn't explicitly signal RBF.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// **NOTE**: if the original transaction was made with [`TxBuilder::send_all`], the same</span>
+ <span class="doccomment">/// option must be enabled when bumping its fees to correctly reduce the only output's value to</span>
+ <span class="doccomment">/// increase the fees.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// ## Example</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// ```no_run</span>
+ <span class="doccomment">/// # use std::str::FromStr;</span>
+ <span class="doccomment">/// # use bitcoin::*;</span>
+ <span class="doccomment">/// # use bdk::*;</span>
+ <span class="doccomment">/// # use bdk::database::*;</span>
+ <span class="doccomment">/// # let descriptor = "wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)";</span>
+ <span class="doccomment">/// # let wallet: OfflineWallet<_> = Wallet::new_offline(descriptor, None, Network::Testnet, MemoryDatabase::default())?;</span>
+ <span class="doccomment">/// let txid = Txid::from_str("faff0a466b70f5d5f92bd757a92c1371d4838bdd5bc53a06764e2488e51ce8f8").unwrap();</span>
+ <span class="doccomment">/// let (psbt, details) = wallet.bump_fee(</span>
+ <span class="doccomment">/// &txid,</span>
+ <span class="doccomment">/// TxBuilder::new().fee_rate(FeeRate::from_sat_per_vb(5.0)),</span>
+ <span class="doccomment">/// )?;</span>
+ <span class="doccomment">/// // sign and broadcast ...</span>
+ <span class="doccomment">/// # Ok::<(), bdk::Error>(())</span>
+ <span class="doccomment">/// ```</span>
+ <span class="comment">// TODO: support for merging multiple transactions while bumping the fees</span>
+ <span class="comment">// TODO: option to force addition of an extra output? seems bad for privacy to update the</span>
+ <span class="comment">// change</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">bump_fee</span><span class="op"><</span><span class="ident">Cs</span>: <span class="ident">coin_selection</span>::<span class="ident">CoinSelectionAlgorithm</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>,
+ <span class="ident">builder</span>: <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">Cs</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">PSBT</span>, <span class="ident">TransactionDetails</span>), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">details</span> <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="ident">txid</span>, <span class="bool-val">true</span>)<span class="question-mark">?</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">TransactionNotFound</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">tx</span>) <span class="kw">if</span> <span class="ident">tx</span>.<span class="ident">transaction</span>.<span class="ident">is_none</span>() <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">TransactionNotFound</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">tx</span>) <span class="kw">if</span> <span class="ident">tx</span>.<span class="ident">height</span>.<span class="ident">is_some</span>() <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">TransactionConfirmed</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">tx</span>) <span class="op">=</span><span class="op">></span> <span class="ident">tx</span>,
+ };
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">details</span>.<span class="ident">transaction</span>.<span class="ident">take</span>().<span class="ident">unwrap</span>();
+ <span class="kw">if</span> <span class="op">!</span><span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">iter</span>().<span class="ident">any</span>(<span class="op">|</span><span class="ident">txin</span><span class="op">|</span> <span class="ident">txin</span>.<span class="ident">sequence</span> <span class="op"><</span><span class="op">=</span> <span class="number">0xFFFFFFFD</span>) {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">IrreplaceableTransaction</span>);
+ }
+
+ <span class="comment">// the new tx must "pay for its bandwidth"</span>
+ <span class="kw">let</span> <span class="ident">vbytes</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">get_weight</span>() <span class="kw">as</span> <span class="ident">f32</span> <span class="op">/</span> <span class="number">4.0</span>;
+ <span class="kw">let</span> <span class="ident">required_feerate</span> <span class="op">=</span> <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="ident">details</span>.<span class="ident">fees</span> <span class="kw">as</span> <span class="ident">f32</span> <span class="op">/</span> <span class="ident">vbytes</span> <span class="op">+</span> <span class="number">1.0</span>);
+ <span class="kw">let</span> <span class="ident">new_feerate</span> <span class="op">=</span> <span class="ident">builder</span>.<span class="ident">fee_rate</span>.<span class="ident">unwrap_or_default</span>();
+
+ <span class="kw">if</span> <span class="ident">new_feerate</span> <span class="op"><</span> <span class="ident">required_feerate</span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">FeeRateTooLow</span> {
+ <span class="ident">required</span>: <span class="ident">required_feerate</span>,
+ });
+ }
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">fee_difference</span> <span class="op">=</span>
+ (<span class="ident">new_feerate</span>.<span class="ident">as_sat_vb</span>() <span class="op">*</span> <span class="ident">tx</span>.<span class="ident">get_weight</span>() <span class="kw">as</span> <span class="ident">f32</span> <span class="op">/</span> <span class="number">4.0</span>).<span class="ident">ceil</span>() <span class="kw">as</span> <span class="ident">u64</span> <span class="op">-</span> <span class="ident">details</span>.<span class="ident">fees</span>;
+
+ <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">send_all</span> <span class="kw-2">&</span><span class="op">&</span> <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>() <span class="op">></span> <span class="number">1</span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">SendAllMultipleOutputs</span>);
+ }
+
+ <span class="comment">// find the index of the output that we can update. either the change or the only one if</span>
+ <span class="comment">// it's `send_all`</span>
+ <span class="kw">let</span> <span class="ident">updatable_output</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">send_all</span> {
+ <span class="number">0</span>
+ } <span class="kw">else</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">change_output</span> <span class="op">=</span> <span class="prelude-val">None</span>;
+ <span class="kw">for</span> (<span class="ident">index</span>, <span class="ident">txout</span>) <span class="kw">in</span> <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
+ <span class="comment">// look for an output that we know and that has the right ScriptType. We use</span>
+ <span class="comment">// `get_deget_descriptor_for` to find what's the ScriptType for `Internal`</span>
+ <span class="comment">// addresses really is, because if there's no change_descriptor it's actually equal</span>
+ <span class="comment">// to "External"</span>
+ <span class="kw">let</span> (<span class="kw">_</span>, <span class="ident">change_type</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>);
+ <span class="kw">match</span> <span class="self">self</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow</span>()
+ .<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">txout</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span>
+ {
+ <span class="prelude-val">Some</span>((<span class="ident">script_type</span>, <span class="kw">_</span>)) <span class="kw">if</span> <span class="ident">script_type</span> <span class="op">=</span><span class="op">=</span> <span class="ident">change_type</span> <span class="op">=</span><span class="op">></span> {
+ <span class="ident">change_output</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">index</span>);
+ <span class="kw">break</span>;
+ }
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> {}
+ }
+ }
+
+ <span class="comment">// we need a change output, add one here and take into account the extra fees for it</span>
+ <span class="kw">if</span> <span class="ident">change_output</span>.<span class="ident">is_none</span>() {
+ <span class="kw">let</span> <span class="ident">change_script</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_change_address</span>()<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">change_txout</span> <span class="op">=</span> <span class="ident">TxOut</span> {
+ <span class="ident">script_pubkey</span>: <span class="ident">change_script</span>,
+ <span class="ident">value</span>: <span class="number">0</span>,
+ };
+ <span class="ident">fee_difference</span> <span class="op">+</span><span class="op">=</span>
+ (<span class="ident">serialize</span>(<span class="kw-2">&</span><span class="ident">change_txout</span>).<span class="ident">len</span>() <span class="kw">as</span> <span class="ident">f32</span> <span class="op">*</span> <span class="ident">new_feerate</span>.<span class="ident">as_sat_vb</span>()).<span class="ident">ceil</span>() <span class="kw">as</span> <span class="ident">u64</span>;
+ <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">push</span>(<span class="ident">change_txout</span>);
+
+ <span class="ident">change_output</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>() <span class="op">-</span> <span class="number">1</span>);
+ }
+
+ <span class="ident">change_output</span>.<span class="ident">unwrap</span>()
+ };
+
+ <span class="comment">// if `builder.utxos` is Some(_) we have to add inputs and we skip down to the last branch</span>
+ <span class="kw">match</span> <span class="ident">tx</span>.<span class="ident">output</span>[<span class="ident">updatable_output</span>]
+ .<span class="ident">value</span>
+ .<span class="ident">checked_sub</span>(<span class="ident">fee_difference</span>)
+ {
+ <span class="prelude-val">Some</span>(<span class="ident">new_value</span>) <span class="kw">if</span> <span class="op">!</span><span class="ident">new_value</span>.<span class="ident">is_dust</span>() <span class="kw-2">&</span><span class="op">&</span> <span class="ident">builder</span>.<span class="ident">utxos</span>.<span class="ident">is_none</span>() <span class="op">=</span><span class="op">></span> {
+ <span class="comment">// try to reduce the "updatable output" amount</span>
+ <span class="ident">tx</span>.<span class="ident">output</span>[<span class="ident">updatable_output</span>].<span class="ident">value</span> <span class="op">=</span> <span class="ident">new_value</span>;
+ <span class="kw">if</span> <span class="self">self</span>.<span class="ident">is_mine</span>(<span class="kw-2">&</span><span class="ident">tx</span>.<span class="ident">output</span>[<span class="ident">updatable_output</span>].<span class="ident">script_pubkey</span>)<span class="question-mark">?</span> {
+ <span class="ident">details</span>.<span class="ident">received</span> <span class="op">-</span><span class="op">=</span> <span class="ident">fee_difference</span>;
+ }
+
+ <span class="ident">details</span>.<span class="ident">fees</span> <span class="op">+</span><span class="op">=</span> <span class="ident">fee_difference</span>;
+ }
+ <span class="kw">_</span> <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">send_all</span> <span class="kw-2">&</span><span class="op">&</span> <span class="ident">builder</span>.<span class="ident">utxos</span>.<span class="ident">is_none</span>() <span class="op">=</span><span class="op">></span> {
+ <span class="comment">// if the tx is "send_all" it doesn't make sense to either remove the only output</span>
+ <span class="comment">// or add more inputs</span>
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">InsufficientFunds</span>);
+ }
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> {
+ <span class="comment">// initially always remove the change output</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">removed_change_output</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">remove</span>(<span class="ident">updatable_output</span>);
+ <span class="kw">if</span> <span class="self">self</span>.<span class="ident">is_mine</span>(<span class="kw-2">&</span><span class="ident">removed_change_output</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span> {
+ <span class="ident">details</span>.<span class="ident">received</span> <span class="op">-</span><span class="op">=</span> <span class="ident">removed_change_output</span>.<span class="ident">value</span>;
+ }
+
+ <span class="comment">// we want to add more inputs if:</span>
+ <span class="comment">// - builder.utxos tells us to do so</span>
+ <span class="comment">// - the removed change value is lower than the fee_difference we want to add</span>
+ <span class="kw">let</span> <span class="ident">needs_more_inputs</span> <span class="op">=</span>
+ <span class="ident">builder</span>.<span class="ident">utxos</span>.<span class="ident">is_some</span>() <span class="op">|</span><span class="op">|</span> <span class="ident">removed_change_output</span>.<span class="ident">value</span> <span class="op"><</span><span class="op">=</span> <span class="ident">fee_difference</span>;
+ <span class="kw">let</span> <span class="ident">added_amount</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">needs_more_inputs</span> {
+ <span class="comment">// TODO: use the right weight instead of the maximum, and only fall-back to it if the</span>
+ <span class="comment">// script is unknown in the database</span>
+ <span class="kw">let</span> <span class="ident">input_witness_weight</span> <span class="op">=</span> <span class="ident">std</span>::<span class="ident">cmp</span>::<span class="ident">max</span>(
+ <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>)
+ .<span class="number">0</span>
+ .<span class="ident">max_satisfaction_weight</span>(),
+ <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>)
+ .<span class="number">0</span>
+ .<span class="ident">max_satisfaction_weight</span>(),
+ );
+
+ <span class="kw">let</span> (<span class="ident">available_utxos</span>, <span class="ident">use_all_utxos</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_available_utxos</span>(
+ <span class="ident">builder</span>.<span class="ident">change_policy</span>,
+ <span class="kw-2">&</span><span class="ident">builder</span>.<span class="ident">utxos</span>,
+ <span class="kw-2">&</span><span class="ident">builder</span>.<span class="ident">unspendable</span>,
+ <span class="bool-val">false</span>,
+ )<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">available_utxos</span> <span class="op">=</span> <span class="ident">rbf</span>::<span class="ident">filter_available</span>(
+ <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">deref</span>(),
+ <span class="ident">available_utxos</span>.<span class="ident">into_iter</span>(),
+ )<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">coin_selection</span>::<span class="ident">CoinSelectionResult</span> {
+ <span class="ident">txin</span>,
+ <span class="ident">selected_amount</span>,
+ <span class="ident">fee_amount</span>,
+ } <span class="op">=</span> <span class="ident">builder</span>.<span class="ident">coin_selection</span>.<span class="ident">coin_select</span>(
+ <span class="ident">available_utxos</span>,
+ <span class="ident">use_all_utxos</span>,
+ <span class="ident">new_feerate</span>,
+ <span class="ident">fee_difference</span>
+ .<span class="ident">checked_sub</span>(<span class="ident">removed_change_output</span>.<span class="ident">value</span>)
+ .<span class="ident">unwrap_or</span>(<span class="number">0</span>),
+ <span class="ident">input_witness_weight</span>,
+ <span class="number">0.0</span>,
+ )<span class="question-mark">?</span>;
+ <span class="ident">fee_difference</span> <span class="op">+</span><span class="op">=</span> <span class="ident">fee_amount</span>.<span class="ident">ceil</span>() <span class="kw">as</span> <span class="ident">u64</span>;
+
+ <span class="comment">// add the new inputs</span>
+ <span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">txin</span>, <span class="kw">_</span>): (<span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>) <span class="op">=</span> <span class="ident">txin</span>.<span class="ident">into_iter</span>().<span class="ident">unzip</span>();
+
+ <span class="comment">// TODO: use tx_builder.sequence ??</span>
+ <span class="comment">// copy the n_sequence from the inputs that were already in the transaction</span>
+ <span class="ident">txin</span>.<span class="ident">iter_mut</span>()
+ .<span class="ident">for_each</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> <span class="ident">i</span>.<span class="ident">sequence</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">sequence</span>);
+ <span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">txin</span>);
+
+ <span class="ident">details</span>.<span class="ident">sent</span> <span class="op">+</span><span class="op">=</span> <span class="ident">selected_amount</span>;
+ <span class="ident">selected_amount</span>
+ } <span class="kw">else</span> {
+ <span class="comment">// otherwise just remove the output and add 0 new coins</span>
+ <span class="number">0</span>
+ };
+
+ <span class="kw">match</span> (<span class="ident">removed_change_output</span>.<span class="ident">value</span> <span class="op">+</span> <span class="ident">added_amount</span>).<span class="ident">checked_sub</span>(<span class="ident">fee_difference</span>) {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">InsufficientFunds</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">new_value</span>) <span class="kw">if</span> <span class="ident">new_value</span>.<span class="ident">is_dust</span>() <span class="op">=</span><span class="op">></span> {
+ <span class="comment">// the change would be dust, add that to fees</span>
+ <span class="ident">details</span>.<span class="ident">fees</span> <span class="op">+</span><span class="op">=</span> <span class="ident">fee_difference</span> <span class="op">+</span> <span class="ident">new_value</span>;
+ }
+ <span class="prelude-val">Some</span>(<span class="ident">new_value</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="comment">// add the change back</span>
+ <span class="ident">removed_change_output</span>.<span class="ident">value</span> <span class="op">=</span> <span class="ident">new_value</span>;
+ <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">push</span>(<span class="ident">removed_change_output</span>);
+
+ <span class="ident">details</span>.<span class="ident">received</span> <span class="op">+</span><span class="op">=</span> <span class="ident">new_value</span>;
+ <span class="ident">details</span>.<span class="ident">fees</span> <span class="op">+</span><span class="op">=</span> <span class="ident">fee_difference</span>;
+ }
+ }
+ }
+ };
+
+ <span class="comment">// clear witnesses</span>
+ <span class="kw">for</span> <span class="ident">input</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
+ <span class="ident">input</span>.<span class="ident">script_sig</span> <span class="op">=</span> <span class="ident">Script</span>::<span class="ident">default</span>();
+ <span class="ident">input</span>.<span class="ident">witness</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
+ }
+
+ <span class="comment">// sort input/outputs according to the chosen algorithm</span>
+ <span class="ident">builder</span>.<span class="ident">ordering</span>.<span class="ident">sort_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>);
+
+ <span class="comment">// TODO: check that we are not replacing more than 100 txs from mempool</span>
+
+ <span class="ident">details</span>.<span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
+ <span class="ident">details</span>.<span class="ident">timestamp</span> <span class="op">=</span> <span class="ident">time</span>::<span class="ident">get_timestamp</span>();
+
+ <span class="kw">let</span> <span class="ident">prev_script_pubkeys</span> <span class="op">=</span> <span class="ident">tx</span>
+ .<span class="ident">input</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">txin</span><span class="op">|</span> {
+ <span class="prelude-val">Ok</span>((
+ <span class="ident">txin</span>.<span class="ident">previous_output</span>.<span class="ident">clone</span>(),
+ <span class="self">self</span>.<span class="ident">database</span>
+ .<span class="ident">borrow</span>()
+ .<span class="ident">get_previous_output</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">previous_output</span>)<span class="question-mark">?</span>,
+ ))
+ })
+ .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span><span class="op">></span>()<span class="question-mark">?</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">filter_map</span>(<span class="op">|</span>(<span class="ident">outpoint</span>, <span class="ident">txout</span>)<span class="op">|</span> <span class="kw">match</span> <span class="ident">txout</span> {
+ <span class="prelude-val">Some</span>(<span class="ident">txout</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>((<span class="ident">outpoint</span>, <span class="ident">txout</span>.<span class="ident">script_pubkey</span>)),
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
+ })
+ .<span class="ident">collect</span>();
+ <span class="kw">let</span> <span class="ident">psbt</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">complete_transaction</span>(<span class="ident">tx</span>, <span class="ident">prev_script_pubkeys</span>, <span class="ident">builder</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>((<span class="ident">psbt</span>, <span class="ident">details</span>))
+ }
+
+ <span class="doccomment">/// Sign a transaction with all the wallet's signers, in the order specified by every signer's</span>
+ <span class="doccomment">/// [`SignerOrdering`]</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// ## Example</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// ```no_run</span>
+ <span class="doccomment">/// # use std::str::FromStr;</span>
+ <span class="doccomment">/// # use bitcoin::*;</span>
+ <span class="doccomment">/// # use bdk::*;</span>
+ <span class="doccomment">/// # use bdk::database::*;</span>
+ <span class="doccomment">/// # let descriptor = "wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)";</span>
+ <span class="doccomment">/// # let wallet: OfflineWallet<_> = Wallet::new_offline(descriptor, None, Network::Testnet, MemoryDatabase::default())?;</span>
+ <span class="doccomment">/// # let (psbt, _) = wallet.create_tx(TxBuilder::new())?;</span>
+ <span class="doccomment">/// let (signed_psbt, finalized) = wallet.sign(psbt, None)?;</span>
+ <span class="doccomment">/// # Ok::<(), bdk::Error>(())</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">sign</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="kw-2">mut</span> <span class="ident">psbt</span>: <span class="ident">PSBT</span>, <span class="ident">assume_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">PSBT</span>, <span class="ident">bool</span>), <span class="ident">Error</span><span class="op">></span> {
+ <span class="comment">// this helps us doing our job later</span>
+ <span class="self">self</span>.<span class="ident">add_input_hd_keypaths</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">psbt</span>)<span class="question-mark">?</span>;
+
+ <span class="kw">for</span> <span class="ident">signer</span> <span class="kw">in</span> <span class="self">self</span>
+ .<span class="ident">signers</span>
+ .<span class="ident">signers</span>()
+ .<span class="ident">iter</span>()
+ .<span class="ident">chain</span>(<span class="self">self</span>.<span class="ident">change_signers</span>.<span class="ident">signers</span>().<span class="ident">iter</span>())
+ {
+ <span class="kw">if</span> <span class="ident">signer</span>.<span class="ident">sign_whole_tx</span>() {
+ <span class="ident">signer</span>.<span class="ident">sign</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">psbt</span>, <span class="prelude-val">None</span>)<span class="question-mark">?</span>;
+ } <span class="kw">else</span> {
+ <span class="kw">for</span> <span class="ident">index</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">len</span>() {
+ <span class="ident">signer</span>.<span class="ident">sign</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">psbt</span>, <span class="prelude-val">Some</span>(<span class="ident">index</span>))<span class="question-mark">?</span>;
+ }
+ }
+ }
+
+ <span class="comment">// attempt to finalize</span>
+ <span class="self">self</span>.<span class="ident">finalize_psbt</span>(<span class="ident">psbt</span>, <span class="ident">assume_height</span>)
+ }
+
+ <span class="doccomment">/// Return the spending policies for the wallet's descriptor</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">policies</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">match</span> (<span class="ident">script_type</span>, <span class="self">self</span>.<span class="ident">change_descriptor</span>.<span class="ident">as_ref</span>()) {
+ (<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="kw">_</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">descriptor</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">signers</span>))<span class="question-mark">?</span>)
+ }
+ (<span class="ident">ScriptType</span>::<span class="ident">Internal</span>, <span class="prelude-val">None</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
+ (<span class="ident">ScriptType</span>::<span class="ident">Internal</span>, <span class="prelude-val">Some</span>(<span class="ident">desc</span>)) <span class="op">=</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">desc</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">change_signers</span>))<span class="question-mark">?</span>)
+ }
+ }
+ }
+
+ <span class="doccomment">/// Return the "public" version of the wallet's descriptor, meaning a new descriptor that has</span>
+ <span class="doccomment">/// the same structure but with every secret key removed</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This can be used to build a watch-only version of a wallet</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">public_descriptor</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">ExtendedDescriptor</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">match</span> (<span class="ident">script_type</span>, <span class="self">self</span>.<span class="ident">change_descriptor</span>.<span class="ident">as_ref</span>()) {
+ (<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">descriptor</span>.<span class="ident">clone</span>())),
+ (<span class="ident">ScriptType</span>::<span class="ident">Internal</span>, <span class="prelude-val">None</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
+ (<span class="ident">ScriptType</span>::<span class="ident">Internal</span>, <span class="prelude-val">Some</span>(<span class="ident">desc</span>)) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">desc</span>.<span class="ident">clone</span>())),
+ }
+ }
+
+ <span class="doccomment">/// Try to finalize a PSBT</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">finalize_psbt</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="kw-2">mut</span> <span class="ident">psbt</span>: <span class="ident">PSBT</span>,
+ <span class="ident">assume_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">PSBT</span>, <span class="ident">bool</span>), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">clone</span>();
+
+ <span class="kw">for</span> (<span class="ident">n</span>, (<span class="ident">input</span>, <span class="ident">psbt_input</span>)) <span class="kw">in</span> <span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">iter_mut</span>().<span class="ident">zip</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">iter</span>()).<span class="ident">enumerate</span>() {
+ <span class="comment">// if the height is None in the database it means it's still unconfirmed, so consider</span>
+ <span class="comment">// that as a very high value</span>
+ <span class="kw">let</span> <span class="ident">create_height</span> <span class="op">=</span> <span class="self">self</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow</span>()
+ .<span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">previous_output</span>.<span class="ident">txid</span>, <span class="bool-val">false</span>)<span class="question-mark">?</span>
+ .<span class="ident">and_then</span>(<span class="op">|</span><span class="ident">tx</span><span class="op">|</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>.<span class="ident">height</span>.<span class="ident">unwrap_or</span>(<span class="ident">std</span>::<span class="ident">u32</span>::<span class="ident">MAX</span>)));
+ <span class="kw">let</span> <span class="ident">current_height</span> <span class="op">=</span> <span class="ident">assume_height</span>.<span class="ident">or</span>(<span class="self">self</span>.<span class="ident">current_height</span>);
+
+ <span class="macro">debug</span><span class="macro">!</span>(
+ <span class="string">"Input #{} - {}, using `create_height` = {:?}, `current_height` = {:?}"</span>,
+ <span class="ident">n</span>, <span class="ident">input</span>.<span class="ident">previous_output</span>, <span class="ident">create_height</span>, <span class="ident">current_height</span>
+ );
+
+ <span class="comment">// - Try to derive the descriptor by looking at the txout. If it's in our database, we</span>
+ <span class="comment">// know exactly which `script_type` to use, and which derivation index it is</span>
+ <span class="comment">// - If that fails, try to derive it by looking at the psbt input: the complete logic</span>
+ <span class="comment">// is in `src/descriptor/mod.rs`, but it will basically look at `hd_keypaths`,</span>
+ <span class="comment">// `redeem_script` and `witness_script` to determine the right derivation</span>
+ <span class="comment">// - If that also fails, it will try it on the internal descriptor, if present</span>
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">desc</span>) <span class="op">=</span> <span class="ident">psbt</span>
+ .<span class="ident">get_utxo_for</span>(<span class="ident">n</span>)
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_txout</span>(<span class="kw-2">&</span><span class="ident">txout</span>))
+ .<span class="ident">transpose</span>()<span class="question-mark">?</span>
+ .<span class="ident">flatten</span>()
+ {
+ <span class="ident">desc</span>
+ } <span class="kw">else</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">desc</span>) <span class="op">=</span> <span class="self">self</span>
+ .<span class="ident">descriptor</span>
+ .<span class="ident">derive_from_psbt_input</span>(<span class="ident">psbt_input</span>, <span class="ident">psbt</span>.<span class="ident">get_utxo_for</span>(<span class="ident">n</span>))
+ {
+ <span class="ident">desc</span>
+ } <span class="kw">else</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">desc</span>) <span class="op">=</span> <span class="self">self</span>
+ .<span class="ident">change_descriptor</span>
+ .<span class="ident">as_ref</span>()
+ .<span class="ident">and_then</span>(<span class="op">|</span><span class="ident">desc</span><span class="op">|</span> <span class="ident">desc</span>.<span class="ident">derive_from_psbt_input</span>(<span class="ident">psbt_input</span>, <span class="ident">psbt</span>.<span class="ident">get_utxo_for</span>(<span class="ident">n</span>)))
+ {
+ <span class="ident">desc</span>
+ } <span class="kw">else</span> {
+ <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"Couldn't find the right derived descriptor for input {}"</span>, <span class="ident">n</span>);
+ <span class="kw">return</span> <span class="prelude-val">Ok</span>((<span class="ident">psbt</span>, <span class="bool-val">false</span>));
+ };
+
+ <span class="kw">match</span> <span class="ident">desc</span>.<span class="ident">satisfy</span>(
+ <span class="ident">input</span>,
+ (
+ <span class="ident">psbt_input</span>.<span class="ident">clone</span>(),
+ <span class="ident">After</span>::<span class="ident">new</span>(<span class="ident">current_height</span>, <span class="bool-val">false</span>),
+ <span class="ident">Older</span>::<span class="ident">new</span>(<span class="ident">current_height</span>, <span class="ident">create_height</span>, <span class="bool-val">false</span>),
+ ),
+ ) {
+ <span class="prelude-val">Ok</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="kw">continue</span>,
+ <span class="prelude-val">Err</span>(<span class="ident">e</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"satisfy error {:?} for input {}"</span>, <span class="ident">e</span>, <span class="ident">n</span>);
+ <span class="kw">return</span> <span class="prelude-val">Ok</span>((<span class="ident">psbt</span>, <span class="bool-val">false</span>));
+ }
+ }
+ }
+
+ <span class="comment">// consume tx to extract its input's script_sig and witnesses and move them into the psbt</span>
+ <span class="kw">for</span> (<span class="ident">input</span>, <span class="ident">psbt_input</span>) <span class="kw">in</span> <span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">into_iter</span>().<span class="ident">zip</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">iter_mut</span>()) {
+ <span class="ident">psbt_input</span>.<span class="ident">final_script_sig</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">input</span>.<span class="ident">script_sig</span>);
+ <span class="ident">psbt_input</span>.<span class="ident">final_script_witness</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">input</span>.<span class="ident">witness</span>);
+ }
+
+ <span class="prelude-val">Ok</span>((<span class="ident">psbt</span>, <span class="bool-val">true</span>))
+ }
+
+ <span class="comment">// Internals</span>
+
+ <span class="kw">fn</span> <span class="ident">get_descriptor_for_script_type</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
+ ) <span class="op">-</span><span class="op">></span> (<span class="kw-2">&</span><span class="ident">ExtendedDescriptor</span>, <span class="ident">ScriptType</span>) {
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">script_type</span> {
+ <span class="ident">ScriptType</span>::<span class="ident">Internal</span> <span class="kw">if</span> <span class="self">self</span>.<span class="ident">change_descriptor</span>.<span class="ident">is_some</span>() <span class="op">=</span><span class="op">></span> (
+ <span class="self">self</span>.<span class="ident">change_descriptor</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap</span>(),
+ <span class="ident">ScriptType</span>::<span class="ident">Internal</span>,
+ ),
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> (<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">descriptor</span>, <span class="ident">ScriptType</span>::<span class="ident">External</span>),
+ };
+
+ <span class="ident">desc</span>
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_descriptor_for_txout</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txout</span>: <span class="kw-2">&</span><span class="ident">TxOut</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">ExtendedDescriptor</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow</span>()
+ .<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">txout</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span>
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">script_type</span>, <span class="ident">child</span>)<span class="op">|</span> (<span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">script_type</span>).<span class="number">0</span>, <span class="ident">child</span>))
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">desc</span>, <span class="ident">child</span>)<span class="op">|</span> <span class="ident">desc</span>.<span class="ident">derive</span>(<span class="kw-2">&</span>[<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">child</span>).<span class="ident">unwrap</span>()])))
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_change_address</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Script</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> (<span class="ident">desc</span>, <span class="ident">script_type</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>);
+ <span class="kw">let</span> <span class="ident">index</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">fetch_and_increment_index</span>(<span class="ident">script_type</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">desc</span>
+ .<span class="ident">derive</span>(<span class="kw-2">&</span>[<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">index</span>).<span class="ident">unwrap</span>()])
+ .<span class="ident">script_pubkey</span>())
+ }
+
+ <span class="kw">fn</span> <span class="ident">fetch_and_increment_index</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> (<span class="ident">descriptor</span>, <span class="ident">script_type</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">script_type</span>);
+ <span class="kw">let</span> <span class="ident">index</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">descriptor</span>.<span class="ident">is_fixed</span>() {
+ <span class="bool-val">true</span> <span class="op">=</span><span class="op">></span> <span class="number">0</span>,
+ <span class="bool-val">false</span> <span class="op">=</span><span class="op">></span> <span class="self">self</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">increment_last_index</span>(<span class="ident">script_type</span>)<span class="question-mark">?</span>,
+ };
+
+ <span class="kw">if</span> <span class="self">self</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow</span>()
+ .<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">script_type</span>, <span class="ident">index</span>)<span class="question-mark">?</span>
+ .<span class="ident">is_none</span>()
+ {
+ <span class="self">self</span>.<span class="ident">cache_addresses</span>(<span class="ident">script_type</span>, <span class="ident">index</span>, <span class="ident">CACHE_ADDR_BATCH_SIZE</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="kw">let</span> <span class="ident">hd_keypaths</span> <span class="op">=</span> <span class="ident">descriptor</span>.<span class="ident">get_hd_keypaths</span>(<span class="ident">index</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="ident">descriptor</span>
+ .<span class="ident">derive</span>(<span class="kw-2">&</span>[<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">index</span>).<span class="ident">unwrap</span>()])
+ .<span class="ident">script_pubkey</span>();
+ <span class="kw">for</span> <span class="ident">validator</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">address_validators</span> {
+ <span class="ident">validator</span>.<span class="ident">validate</span>(<span class="ident">script_type</span>, <span class="kw-2">&</span><span class="ident">hd_keypaths</span>, <span class="kw-2">&</span><span class="ident">script</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">index</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">cache_addresses</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
+ <span class="ident">from</span>: <span class="ident">u32</span>,
+ <span class="kw-2">mut</span> <span class="ident">count</span>: <span class="ident">u32</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> (<span class="ident">descriptor</span>, <span class="ident">script_type</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">script_type</span>);
+ <span class="kw">if</span> <span class="ident">descriptor</span>.<span class="ident">is_fixed</span>() {
+ <span class="kw">if</span> <span class="ident">from</span> <span class="op">></span> <span class="number">0</span> {
+ <span class="kw">return</span> <span class="prelude-val">Ok</span>(());
+ }
+
+ <span class="ident">count</span> <span class="op">=</span> <span class="number">1</span>;
+ }
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">address_batch</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">begin_batch</span>();
+
+ <span class="kw">let</span> <span class="ident">start_time</span> <span class="op">=</span> <span class="ident">time</span>::<span class="ident">Instant</span>::<span class="ident">new</span>();
+ <span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="ident">from</span>..(<span class="ident">from</span> <span class="op">+</span> <span class="ident">count</span>) {
+ <span class="ident">address_batch</span>.<span class="ident">set_script_pubkey</span>(
+ <span class="kw-2">&</span><span class="ident">descriptor</span>
+ .<span class="ident">derive</span>(<span class="kw-2">&</span>[<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">i</span>).<span class="ident">unwrap</span>()])
+ .<span class="ident">script_pubkey</span>(),
+ <span class="ident">script_type</span>,
+ <span class="ident">i</span>,
+ )<span class="question-mark">?</span>;
+ }
+
+ <span class="macro">info</span><span class="macro">!</span>(
+ <span class="string">"Derivation of {} addresses from {} took {} ms"</span>,
+ <span class="ident">count</span>,
+ <span class="ident">from</span>,
+ <span class="ident">start_time</span>.<span class="ident">elapsed</span>().<span class="ident">as_millis</span>()
+ );
+
+ <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">commit_batch</span>(<span class="ident">address_batch</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_available_utxos</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">change_policy</span>: <span class="ident">tx_builder</span>::<span class="ident">ChangeSpendPolicy</span>,
+ <span class="ident">utxo</span>: <span class="kw-2">&</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">OutPoint</span><span class="op">></span><span class="op">></span>,
+ <span class="ident">unspendable</span>: <span class="kw-2">&</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">OutPoint</span><span class="op">></span><span class="op">></span>,
+ <span class="ident">send_all</span>: <span class="ident">bool</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">bool</span>), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">unspendable_set</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">unspendable</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="ident">HashSet</span>::<span class="ident">new</span>(),
+ <span class="prelude-val">Some</span>(<span class="ident">vec</span>) <span class="op">=</span><span class="op">></span> <span class="ident">vec</span>.<span class="ident">into_iter</span>().<span class="ident">collect</span>(),
+ };
+
+ <span class="kw">match</span> <span class="ident">utxo</span> {
+ <span class="comment">// with manual coin selection we always want to spend all the selected utxos, no matter</span>
+ <span class="comment">// what (even if they are marked as unspendable)</span>
+ <span class="prelude-val">Some</span>(<span class="ident">raw_utxos</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">full_utxos</span> <span class="op">=</span> <span class="ident">raw_utxos</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">get_utxo</span>(<span class="kw-2">&</span><span class="ident">u</span>))
+ .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()<span class="question-mark">?</span>;
+ <span class="kw">if</span> <span class="op">!</span><span class="ident">full_utxos</span>.<span class="ident">iter</span>().<span class="ident">all</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="ident">u</span>.<span class="ident">is_some</span>()) {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">UnknownUTXO</span>);
+ }
+
+ <span class="prelude-val">Ok</span>((<span class="ident">full_utxos</span>.<span class="ident">into_iter</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span>.<span class="ident">unwrap</span>()).<span class="ident">collect</span>(), <span class="bool-val">true</span>))
+ }
+ <span class="comment">// otherwise limit ourselves to the spendable utxos for the selected policy, and the `send_all` setting</span>
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">utxos</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">list_unspent</span>()<span class="question-mark">?</span>.<span class="ident">into_iter</span>();
+ <span class="kw">let</span> <span class="ident">utxos</span> <span class="op">=</span> <span class="ident">change_policy</span>.<span class="ident">filter_utxos</span>(<span class="ident">utxos</span>).<span class="ident">into_iter</span>();
+
+ <span class="prelude-val">Ok</span>((
+ <span class="ident">utxos</span>
+ .<span class="ident">filter</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="op">!</span><span class="ident">unspendable_set</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">u</span>.<span class="ident">outpoint</span>))
+ .<span class="ident">collect</span>(),
+ <span class="ident">send_all</span>,
+ ))
+ }
+ }
+ }
+
+ <span class="kw">fn</span> <span class="ident">complete_transaction</span><span class="op"><</span><span class="ident">Cs</span>: <span class="ident">coin_selection</span>::<span class="ident">CoinSelectionAlgorithm</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">tx</span>: <span class="ident">Transaction</span>,
+ <span class="ident">prev_script_pubkeys</span>: <span class="ident">HashMap</span><span class="op"><</span><span class="ident">OutPoint</span>, <span class="ident">Script</span><span class="op">></span>,
+ <span class="ident">builder</span>: <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">Cs</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">PSBT</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">psbt</span> <span class="op">=</span> <span class="ident">PSBT</span>::<span class="ident">from_unsigned_tx</span>(<span class="ident">tx</span>)<span class="question-mark">?</span>;
+
+ <span class="comment">// add metadata for the inputs</span>
+ <span class="kw">for</span> (<span class="ident">psbt_input</span>, <span class="ident">input</span>) <span class="kw">in</span> <span class="ident">psbt</span>
+ .<span class="ident">inputs</span>
+ .<span class="ident">iter_mut</span>()
+ .<span class="ident">zip</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">input</span>.<span class="ident">iter</span>())
+ {
+ <span class="kw">let</span> <span class="ident">prev_script</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">prev_script_pubkeys</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">previous_output</span>) {
+ <span class="prelude-val">Some</span>(<span class="ident">prev_script</span>) <span class="op">=</span><span class="op">></span> <span class="ident">prev_script</span>,
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">continue</span>,
+ };
+
+ <span class="comment">// Add sighash, default is obviously "ALL"</span>
+ <span class="ident">psbt_input</span>.<span class="ident">sighash_type</span> <span class="op">=</span> <span class="ident">builder</span>.<span class="ident">sighash</span>.<span class="ident">or</span>(<span class="prelude-val">Some</span>(<span class="ident">SigHashType</span>::<span class="ident">All</span>));
+
+ <span class="comment">// Try to find the prev_script in our db to figure out if this is internal or external,</span>
+ <span class="comment">// and the derivation index</span>
+ <span class="kw">let</span> (<span class="ident">script_type</span>, <span class="ident">child</span>) <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow</span>()
+ .<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">prev_script</span>)<span class="question-mark">?</span>
+ {
+ <span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="op">=</span><span class="op">></span> <span class="ident">x</span>,
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">continue</span>,
+ };
+
+ <span class="kw">let</span> (<span class="ident">desc</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">script_type</span>);
+ <span class="ident">psbt_input</span>.<span class="ident">hd_keypaths</span> <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">get_hd_keypaths</span>(<span class="ident">child</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">derived_descriptor</span> <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">derive</span>(<span class="kw-2">&</span>[<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">child</span>).<span class="ident">unwrap</span>()]);
+
+ <span class="ident">psbt_input</span>.<span class="ident">redeem_script</span> <span class="op">=</span> <span class="ident">derived_descriptor</span>.<span class="ident">psbt_redeem_script</span>();
+ <span class="ident">psbt_input</span>.<span class="ident">witness_script</span> <span class="op">=</span> <span class="ident">derived_descriptor</span>.<span class="ident">psbt_witness_script</span>();
+
+ <span class="kw">let</span> <span class="ident">prev_output</span> <span class="op">=</span> <span class="ident">input</span>.<span class="ident">previous_output</span>;
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">prev_tx</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="ident">prev_output</span>.<span class="ident">txid</span>)<span class="question-mark">?</span> {
+ <span class="kw">if</span> <span class="ident">derived_descriptor</span>.<span class="ident">is_witness</span>() {
+ <span class="ident">psbt_input</span>.<span class="ident">witness_utxo</span> <span class="op">=</span>
+ <span class="prelude-val">Some</span>(<span class="ident">prev_tx</span>.<span class="ident">output</span>[<span class="ident">prev_output</span>.<span class="ident">vout</span> <span class="kw">as</span> <span class="ident">usize</span>].<span class="ident">clone</span>());
+ }
+ <span class="kw">if</span> <span class="op">!</span><span class="ident">derived_descriptor</span>.<span class="ident">is_witness</span>() <span class="op">|</span><span class="op">|</span> <span class="ident">builder</span>.<span class="ident">force_non_witness_utxo</span> {
+ <span class="ident">psbt_input</span>.<span class="ident">non_witness_utxo</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">prev_tx</span>);
+ }
+ }
+ }
+
+ <span class="comment">// probably redundant but it doesn't hurt...</span>
+ <span class="self">self</span>.<span class="ident">add_input_hd_keypaths</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">psbt</span>)<span class="question-mark">?</span>;
+
+ <span class="comment">// add metadata for the outputs</span>
+ <span class="kw">for</span> (<span class="ident">psbt_output</span>, <span class="ident">tx_output</span>) <span class="kw">in</span> <span class="ident">psbt</span>
+ .<span class="ident">outputs</span>
+ .<span class="ident">iter_mut</span>()
+ .<span class="ident">zip</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>.<span class="ident">iter</span>())
+ {
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">script_type</span>, <span class="ident">child</span>)) <span class="op">=</span> <span class="self">self</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow</span>()
+ .<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">tx_output</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span>
+ {
+ <span class="kw">let</span> (<span class="ident">desc</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">script_type</span>);
+ <span class="ident">psbt_output</span>.<span class="ident">hd_keypaths</span> <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">get_hd_keypaths</span>(<span class="ident">child</span>)<span class="question-mark">?</span>;
+ }
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">psbt</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">add_input_hd_keypaths</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">psbt</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">PSBT</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">input_utxos</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">len</span>());
+ <span class="kw">for</span> <span class="ident">n</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">len</span>() {
+ <span class="ident">input_utxos</span>.<span class="ident">push</span>(<span class="ident">psbt</span>.<span class="ident">get_utxo_for</span>(<span class="ident">n</span>).<span class="ident">clone</span>());
+ }
+
+ <span class="comment">// try to add hd_keypaths if we've already seen the output</span>
+ <span class="kw">for</span> (<span class="ident">psbt_input</span>, <span class="ident">out</span>) <span class="kw">in</span> <span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">iter_mut</span>().<span class="ident">zip</span>(<span class="ident">input_utxos</span>.<span class="ident">iter</span>()) {
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">out</span>) <span class="op">=</span> <span class="ident">out</span> {
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">script_type</span>, <span class="ident">child</span>)) <span class="op">=</span> <span class="self">self</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow</span>()
+ .<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">out</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span>
+ {
+ <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"Found descriptor {:?}/{}"</span>, <span class="ident">script_type</span>, <span class="ident">child</span>);
+
+ <span class="comment">// merge hd_keypaths</span>
+ <span class="kw">let</span> (<span class="ident">desc</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">script_type</span>);
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">hd_keypaths</span> <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">get_hd_keypaths</span>(<span class="ident">child</span>)<span class="question-mark">?</span>;
+ <span class="ident">psbt_input</span>.<span class="ident">hd_keypaths</span>.<span class="ident">append</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">hd_keypaths</span>);
+ }
+ }
+ }
+
+ <span class="prelude-val">Ok</span>(())
+ }
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">B</span>, <span class="ident">D</span><span class="op">></span> <span class="ident">Wallet</span><span class="op"><</span><span class="ident">B</span>, <span class="ident">D</span><span class="op">></span>
+<span class="kw">where</span>
+ <span class="ident">B</span>: <span class="ident">Blockchain</span>,
+ <span class="ident">D</span>: <span class="ident">BatchDatabase</span>,
+{
+ <span class="doccomment">/// Create a new "online" wallet</span>
+ <span class="attribute">#[<span class="ident">maybe_async</span>]</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(
+ <span class="ident">descriptor</span>: <span class="kw-2">&</span><span class="ident">str</span>,
+ <span class="ident">change_descriptor</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">str</span><span class="op">></span>,
+ <span class="ident">network</span>: <span class="ident">Network</span>,
+ <span class="ident">database</span>: <span class="ident">D</span>,
+ <span class="ident">client</span>: <span class="ident">B</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">wallet</span> <span class="op">=</span> <span class="self">Self</span>::<span class="ident">new_offline</span>(<span class="ident">descriptor</span>, <span class="ident">change_descriptor</span>, <span class="ident">network</span>, <span class="ident">database</span>)<span class="question-mark">?</span>;
+
+ <span class="ident">wallet</span>.<span class="ident">current_height</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="macro">maybe_await</span><span class="macro">!</span>(<span class="ident">client</span>.<span class="ident">get_height</span>())<span class="question-mark">?</span> <span class="kw">as</span> <span class="ident">u32</span>);
+ <span class="ident">wallet</span>.<span class="ident">client</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">client</span>);
+
+ <span class="prelude-val">Ok</span>(<span class="ident">wallet</span>)
+ }
+
+ <span class="doccomment">/// Sync the internal database with the blockchain</span>
+ <span class="attribute">#[<span class="ident">maybe_async</span>]</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">sync</span><span class="op"><</span><span class="ident">P</span>: <span class="lifetime">'static</span> <span class="op">+</span> <span class="ident">Progress</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">progress_update</span>: <span class="ident">P</span>,
+ <span class="ident">max_address_param</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
+ <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"Begin sync..."</span>);
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">run_setup</span> <span class="op">=</span> <span class="bool-val">false</span>;
+
+ <span class="kw">let</span> <span class="ident">max_address</span> <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span>.<span class="ident">descriptor</span>.<span class="ident">is_fixed</span>() {
+ <span class="bool-val">true</span> <span class="op">=</span><span class="op">></span> <span class="number">0</span>,
+ <span class="bool-val">false</span> <span class="op">=</span><span class="op">></span> <span class="ident">max_address_param</span>.<span class="ident">unwrap_or</span>(<span class="ident">CACHE_ADDR_BATCH_SIZE</span>),
+ };
+ <span class="kw">if</span> <span class="self">self</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow</span>()
+ .<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="ident">max_address</span>)<span class="question-mark">?</span>
+ .<span class="ident">is_none</span>()
+ {
+ <span class="ident">run_setup</span> <span class="op">=</span> <span class="bool-val">true</span>;
+ <span class="self">self</span>.<span class="ident">cache_addresses</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="number">0</span>, <span class="ident">max_address</span>)<span class="question-mark">?</span>;
+ }
+
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>) <span class="op">=</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">change_descriptor</span> {
+ <span class="kw">let</span> <span class="ident">max_address</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">change_descriptor</span>.<span class="ident">is_fixed</span>() {
+ <span class="bool-val">true</span> <span class="op">=</span><span class="op">></span> <span class="number">0</span>,
+ <span class="bool-val">false</span> <span class="op">=</span><span class="op">></span> <span class="ident">max_address_param</span>.<span class="ident">unwrap_or</span>(<span class="ident">CACHE_ADDR_BATCH_SIZE</span>),
+ };
+
+ <span class="kw">if</span> <span class="self">self</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow</span>()
+ .<span class="ident">get_script_pubkey_from_path</span>(
+ <span class="ident">ScriptType</span>::<span class="ident">Internal</span>,
+ <span class="ident">max_address</span>.<span class="ident">checked_sub</span>(<span class="number">1</span>).<span class="ident">unwrap_or</span>(<span class="number">0</span>),
+ )<span class="question-mark">?</span>
+ .<span class="ident">is_none</span>()
+ {
+ <span class="ident">run_setup</span> <span class="op">=</span> <span class="bool-val">true</span>;
+ <span class="self">self</span>.<span class="ident">cache_addresses</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>, <span class="number">0</span>, <span class="ident">max_address</span>)<span class="question-mark">?</span>;
+ }
+ }
+
+ <span class="comment">// TODO: what if i generate an address first and cache some addresses?</span>
+ <span class="comment">// TODO: we should sync if generating an address triggers a new batch to be stored</span>
+ <span class="kw">if</span> <span class="ident">run_setup</span> {
+ <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">client</span>.<span class="ident">as_ref</span>().<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">OfflineClient</span>)<span class="question-mark">?</span>.<span class="ident">setup</span>(
+ <span class="prelude-val">None</span>,
+ <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">deref_mut</span>(),
+ <span class="ident">progress_update</span>,
+ ))
+ } <span class="kw">else</span> {
+ <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">client</span>.<span class="ident">as_ref</span>().<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">OfflineClient</span>)<span class="question-mark">?</span>.<span class="ident">sync</span>(
+ <span class="prelude-val">None</span>,
+ <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">deref_mut</span>(),
+ <span class="ident">progress_update</span>,
+ ))
+ }
+ }
+
+ <span class="doccomment">/// Return a reference to the internal blockchain client</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">client</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">B</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">client</span>.<span class="ident">as_ref</span>()
+ }
+
+ <span class="doccomment">/// Broadcast a transaction to the network</span>
+ <span class="attribute">#[<span class="ident">maybe_async</span>]</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">broadcast</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Txid</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>
+ .<span class="ident">client</span>
+ .<span class="ident">as_ref</span>()
+ .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">OfflineClient</span>)<span class="question-mark">?</span>
+ .<span class="ident">broadcast</span>(<span class="kw-2">&</span><span class="ident">tx</span>))<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">tx</span>.<span class="ident">txid</span>())
+ }
+}
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="kw">mod</span> <span class="ident">test</span> {
+ <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
+
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">Network</span>;
+
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">memory</span>::<span class="ident">MemoryDatabase</span>;
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">Database</span>;
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">ScriptType</span>;
+
+ <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_cache_addresses_fixed</span>() {
+ <span class="kw">let</span> <span class="ident">db</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">new</span>();
+ <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(
+ <span class="string">"wpkh(L5EZftvrYaSudiozVRzTqLcHLNDoVn7H5HSfM9BAN6tMJX8oTWz6)"</span>,
+ <span class="prelude-val">None</span>,
+ <span class="ident">Network</span>::<span class="ident">Testnet</span>,
+ <span class="ident">db</span>,
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>().<span class="ident">to_string</span>(),
+ <span class="string">"tb1qj08ys4ct2hzzc2hcz6h2hgrvlmsjynaw43s835"</span>
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>().<span class="ident">to_string</span>(),
+ <span class="string">"tb1qj08ys4ct2hzzc2hcz6h2hgrvlmsjynaw43s835"</span>
+ );
+
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="number">0</span>)
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">is_some</span>());
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>, <span class="number">0</span>)
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">is_none</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_cache_addresses</span>() {
+ <span class="kw">let</span> <span class="ident">db</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">new</span>();
+ <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(<span class="string">"wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)"</span>, <span class="prelude-val">None</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>, <span class="ident">db</span>).<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>().<span class="ident">to_string</span>(),
+ <span class="string">"tb1q6yn66vajcctph75pvylgkksgpp6nq04ppwct9a"</span>
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>().<span class="ident">to_string</span>(),
+ <span class="string">"tb1q4er7kxx6sssz3q7qp7zsqsdx4erceahhax77d7"</span>
+ );
+
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="ident">CACHE_ADDR_BATCH_SIZE</span> <span class="op">-</span> <span class="number">1</span>)
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">is_some</span>());
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="ident">CACHE_ADDR_BATCH_SIZE</span>)
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">is_none</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_cache_addresses_refill</span>() {
+ <span class="kw">let</span> <span class="ident">db</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">new</span>();
+ <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(<span class="string">"wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)"</span>, <span class="prelude-val">None</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>, <span class="ident">db</span>).<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>().<span class="ident">to_string</span>(),
+ <span class="string">"tb1q6yn66vajcctph75pvylgkksgpp6nq04ppwct9a"</span>
+ );
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="ident">CACHE_ADDR_BATCH_SIZE</span> <span class="op">-</span> <span class="number">1</span>)
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">is_some</span>());
+
+ <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">CACHE_ADDR_BATCH_SIZE</span> {
+ <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ }
+
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="ident">CACHE_ADDR_BATCH_SIZE</span> <span class="op">*</span> <span class="number">2</span> <span class="op">-</span> <span class="number">1</span>)
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">is_some</span>());
+ }
+
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">get_test_wpkh</span>() <span class="op">-</span><span class="op">></span> <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span> {
+ <span class="string">"wpkh(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW)"</span>
+ }
+
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">get_test_single_sig_csv</span>() <span class="op">-</span><span class="op">></span> <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span> {
+ <span class="comment">// and(pk(Alice),older(6))</span>
+ <span class="string">"wsh(and_v(v:pk(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW),older(6)))"</span>
+ }
+
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">get_test_single_sig_cltv</span>() <span class="op">-</span><span class="op">></span> <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span> {
+ <span class="comment">// and(pk(Alice),after(100000))</span>
+ <span class="string">"wsh(and_v(v:pk(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW),after(100000)))"</span>
+ }
+
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">get_funded_wallet</span>(
+ <span class="ident">descriptor</span>: <span class="kw-2">&</span><span class="ident">str</span>,
+ ) <span class="op">-</span><span class="op">></span> (
+ <span class="ident">OfflineWallet</span><span class="op"><</span><span class="ident">MemoryDatabase</span><span class="op">></span>,
+ (<span class="ident">String</span>, <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>),
+ <span class="ident">bitcoin</span>::<span class="ident">Txid</span>,
+ ) {
+ <span class="kw">let</span> <span class="ident">descriptors</span> <span class="op">=</span> <span class="macro">testutils</span><span class="macro">!</span>(@<span class="ident">descriptors</span> (<span class="ident">descriptor</span>));
+ <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(
+ <span class="kw-2">&</span><span class="ident">descriptors</span>.<span class="number">0</span>,
+ <span class="prelude-val">None</span>,
+ <span class="ident">Network</span>::<span class="ident">Regtest</span>,
+ <span class="ident">MemoryDatabase</span>::<span class="ident">new</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">received_tx</span>(
+ <span class="macro">testutils</span><span class="macro">!</span> {
+ @<span class="ident">tx</span> ( (@<span class="ident">external</span> <span class="ident">descriptors</span>, <span class="number">0</span>) <span class="op">=</span><span class="op">></span> <span class="number">50_000</span> ) (@<span class="ident">confirmations</span> <span class="number">1</span>)
+ },
+ <span class="prelude-val">Some</span>(<span class="number">100</span>),
+ );
+
+ (<span class="ident">wallet</span>, <span class="ident">descriptors</span>, <span class="ident">txid</span>)
+ }
+
+ <span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">assert_fee_rate</span> {
+ (<span class="macro-nonterminal">$</span><span class="macro-nonterminal">tx</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">fees</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">fee_rate</span>:<span class="ident">expr</span> $( ,@<span class="ident">dust_change</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">dust_change</span>:<span class="ident">expr</span> )<span class="op">*</span> )<span class="op">*</span> $( ,@<span class="ident">add_signature</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">add_signature</span>:<span class="ident">expr</span> )<span class="op">*</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">tx</span>.<span class="ident">clone</span>();
+ $(
+ $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">add_signature</span> )<span class="op">*</span>
+ <span class="kw">for</span> <span class="ident">txin</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
+ <span class="ident">txin</span>.<span class="ident">witness</span>.<span class="ident">push</span>([<span class="number">0x00</span>; <span class="number">108</span>].<span class="ident">to_vec</span>()); <span class="comment">// fake signature</span>
+ }
+ )<span class="op">*</span>
+
+ <span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_mut</span>)]</span>
+ <span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_assignments</span>)]</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">dust_change</span> <span class="op">=</span> <span class="bool-val">false</span>;
+ $(
+ $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">dust_change</span> )<span class="op">*</span>
+ <span class="ident">dust_change</span> <span class="op">=</span> <span class="bool-val">true</span>;
+ )<span class="op">*</span>
+
+ <span class="kw">let</span> <span class="ident">tx_fee_rate</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">fees</span> <span class="kw">as</span> <span class="ident">f32</span> <span class="op">/</span> (<span class="ident">tx</span>.<span class="ident">get_weight</span>() <span class="kw">as</span> <span class="ident">f32</span> <span class="op">/</span> <span class="number">4.0</span>);
+ <span class="kw">let</span> <span class="ident">fee_rate</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">fee_rate</span>.<span class="ident">as_sat_vb</span>();
+
+ <span class="kw">if</span> <span class="op">!</span><span class="ident">dust_change</span> {
+ <span class="macro">assert</span><span class="macro">!</span>((<span class="ident">tx_fee_rate</span> <span class="op">-</span> <span class="ident">fee_rate</span>).<span class="ident">abs</span>() <span class="op"><</span> <span class="number">0.5</span>, <span class="macro">format</span><span class="macro">!</span>(<span class="string">"Expected fee rate of {}, the tx has {}"</span>, <span class="ident">fee_rate</span>, <span class="ident">tx_fee_rate</span>));
+ } <span class="kw">else</span> {
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">tx_fee_rate</span> <span class="op">></span><span class="op">=</span> <span class="ident">fee_rate</span>, <span class="macro">format</span><span class="macro">!</span>(<span class="string">"Expected fee rate of at least {}, the tx has {}"</span>, <span class="ident">fee_rate</span>, <span class="ident">tx_fee_rate</span>));
+ }
+ });
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"NoAddressees"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_empty_recipients</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[]).<span class="ident">version</span>(<span class="number">0</span>))
+ .<span class="ident">unwrap</span>();
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"Invalid version `0`"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_version_0</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">version</span>(<span class="number">0</span>))
+ .<span class="ident">unwrap</span>();
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(
+ <span class="ident">expected</span> <span class="op">=</span> <span class="string">"TxBuilder requested version `1`, but at least `2` is needed to use OP_CSV"</span>
+ )]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_version_1_csv</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_single_sig_csv</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">version</span>(<span class="number">1</span>))
+ .<span class="ident">unwrap</span>();
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_custom_version</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">version</span>(<span class="number">42</span>))
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">version</span>, <span class="number">42</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_default_locktime</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
+ <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
+ <span class="number">25_000</span>,
+ )]))
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">lock_time</span>, <span class="number">0</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_default_locktime_cltv</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_single_sig_cltv</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
+ <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
+ <span class="number">25_000</span>,
+ )]))
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">lock_time</span>, <span class="number">100_000</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_custom_locktime</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">nlocktime</span>(<span class="number">630_000</span>),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">lock_time</span>, <span class="number">630_000</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_custom_locktime_compatible_with_cltv</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_single_sig_cltv</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">nlocktime</span>(<span class="number">630_000</span>),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">lock_time</span>, <span class="number">630_000</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(
+ <span class="ident">expected</span> <span class="op">=</span> <span class="string">"TxBuilder requested timelock of `50000`, but at least `100000` is required to spend from this script"</span>
+ )]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_custom_locktime_incompatible_with_cltv</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_single_sig_cltv</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">nlocktime</span>(<span class="number">50000</span>),
+ )
+ .<span class="ident">unwrap</span>();
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_no_rbf_csv</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_single_sig_csv</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
+ <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
+ <span class="number">25_000</span>,
+ )]))
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">sequence</span>, <span class="number">6</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_with_default_rbf_csv</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_single_sig_csv</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">enable_rbf</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">sequence</span>, <span class="number">0xFFFFFFFD</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(
+ <span class="ident">expected</span> <span class="op">=</span> <span class="string">"Cannot enable RBF with nSequence `3`, since at least `6` is required to spend with OP_CSV"</span>
+ )]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_with_custom_rbf_csv</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_single_sig_csv</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)])
+ .<span class="ident">enable_rbf_with_sequence</span>(<span class="number">3</span>),
+ )
+ .<span class="ident">unwrap</span>();
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_no_rbf_cltv</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_single_sig_cltv</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
+ <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
+ <span class="number">25_000</span>,
+ )]))
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">sequence</span>, <span class="number">0xFFFFFFFE</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"Cannot enable RBF with a nSequence >= 0xFFFFFFFE"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_invalid_rbf_sequence</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)])
+ .<span class="ident">enable_rbf_with_sequence</span>(<span class="number">0xFFFFFFFE</span>),
+ )
+ .<span class="ident">unwrap</span>();
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_custom_rbf_sequence</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)])
+ .<span class="ident">enable_rbf_with_sequence</span>(<span class="number">0xDEADBEEF</span>),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">sequence</span>, <span class="number">0xDEADBEEF</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_default_sequence</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
+ <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
+ <span class="number">25_000</span>,
+ )]))
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">sequence</span>, <span class="number">0xFFFFFFFF</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(
+ <span class="ident">expected</span> <span class="op">=</span> <span class="string">"The `change_policy` can be set only if the wallet has a change_descriptor"</span>
+ )]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_change_policy_no_internal</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)])
+ .<span class="ident">do_not_spend_change</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"SendAllMultipleOutputs"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_send_all_multiple_outputs</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[
+ (<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>),
+ (<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">10_000</span>),
+ ])
+ .<span class="ident">send_all</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_send_all</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">1</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>[<span class="number">0</span>].<span class="ident">value</span>,
+ <span class="number">50_000</span> <span class="op">-</span> <span class="ident">details</span>.<span class="ident">fees</span>
+ );
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_default_fee_rate</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_fee_rate</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">extract_tx</span>(), <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">FeeRate</span>::<span class="ident">default</span>(), @<span class="ident">add_signature</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_custom_fee_rate</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)])
+ .<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">5.0</span>))
+ .<span class="ident">send_all</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_fee_rate</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">extract_tx</span>(), <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">5.0</span>), @<span class="ident">add_signature</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_add_change</span>() {
+ <span class="kw">use</span> <span class="kw">super</span>::<span class="ident">tx_builder</span>::<span class="ident">TxOrdering</span>;
+
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)])
+ .<span class="ident">ordering</span>(<span class="ident">TxOrdering</span>::<span class="ident">Untouched</span>),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">2</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>[<span class="number">0</span>].<span class="ident">value</span>, <span class="number">25_000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>[<span class="number">1</span>].<span class="ident">value</span>,
+ <span class="number">25_000</span> <span class="op">-</span> <span class="ident">details</span>.<span class="ident">fees</span>
+ );
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_skip_change_dust</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
+ <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
+ <span class="number">49_800</span>,
+ )]))
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">1</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>[<span class="number">0</span>].<span class="ident">value</span>, <span class="number">49_800</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"InsufficientFunds"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_send_all_dust_amount</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="comment">// very high fee rate, so that the only output would be below dust</span>
+ <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)])
+ .<span class="ident">send_all</span>()
+ .<span class="ident">fee_rate</span>(<span class="kw">crate</span>::<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">453.0</span>)),
+ )
+ .<span class="ident">unwrap</span>();
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_ordering_respected</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[
+ (<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">30_000</span>),
+ (<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">10_000</span>),
+ ])
+ .<span class="ident">ordering</span>(<span class="kw">super</span>::<span class="ident">tx_builder</span>::<span class="ident">TxOrdering</span>::<span class="ident">BIP69Lexicographic</span>),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">3</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>[<span class="number">0</span>].<span class="ident">value</span>,
+ <span class="number">10_000</span> <span class="op">-</span> <span class="ident">details</span>.<span class="ident">fees</span>
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>[<span class="number">1</span>].<span class="ident">value</span>, <span class="number">10_000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>[<span class="number">2</span>].<span class="ident">value</span>, <span class="number">30_000</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_default_sighash</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
+ <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
+ <span class="number">30_000</span>,
+ )]))
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">sighash_type</span>, <span class="prelude-val">Some</span>(<span class="ident">bitcoin</span>::<span class="ident">SigHashType</span>::<span class="ident">All</span>));
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_custom_sighash</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">30_000</span>)])
+ .<span class="ident">sighash</span>(<span class="ident">bitcoin</span>::<span class="ident">SigHashType</span>::<span class="ident">Single</span>),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">sighash_type</span>,
+ <span class="prelude-val">Some</span>(<span class="ident">bitcoin</span>::<span class="ident">SigHashType</span>::<span class="ident">Single</span>)
+ );
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_input_hd_keypaths</span>() {
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::{<span class="ident">DerivationPath</span>, <span class="ident">Fingerprint</span>};
+ <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
+
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="string">"wpkh([d34db33f/44'/0'/0']xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL/0/*)"</span>);
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">hd_keypaths</span>.<span class="ident">len</span>(), <span class="number">1</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">hd_keypaths</span>.<span class="ident">values</span>().<span class="ident">nth</span>(<span class="number">0</span>).<span class="ident">unwrap</span>(),
+ <span class="kw-2">&</span>(
+ <span class="ident">Fingerprint</span>::<span class="ident">from_str</span>(<span class="string">"d34db33f"</span>).<span class="ident">unwrap</span>(),
+ <span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/44'/0'/0'/0/0"</span>).<span class="ident">unwrap</span>()
+ )
+ );
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_output_hd_keypaths</span>() {
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::{<span class="ident">DerivationPath</span>, <span class="ident">Fingerprint</span>};
+ <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
+
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="ident">descriptors</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="string">"wpkh([d34db33f/44'/0'/0']xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL/0/*)"</span>);
+ <span class="comment">// cache some addresses</span>
+ <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="macro">testutils</span><span class="macro">!</span>(@<span class="ident">external</span> <span class="ident">descriptors</span>, <span class="number">5</span>);
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">outputs</span>[<span class="number">0</span>].<span class="ident">hd_keypaths</span>.<span class="ident">len</span>(), <span class="number">1</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">psbt</span>.<span class="ident">outputs</span>[<span class="number">0</span>].<span class="ident">hd_keypaths</span>.<span class="ident">values</span>().<span class="ident">nth</span>(<span class="number">0</span>).<span class="ident">unwrap</span>(),
+ <span class="kw-2">&</span>(
+ <span class="ident">Fingerprint</span>::<span class="ident">from_str</span>(<span class="string">"d34db33f"</span>).<span class="ident">unwrap</span>(),
+ <span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/44'/0'/0'/0/5"</span>).<span class="ident">unwrap</span>()
+ )
+ );
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_set_redeem_script_p2sh</span>() {
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">FromHex</span>;
+
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span>
+ <span class="ident">get_funded_wallet</span>(<span class="string">"sh(pk(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW))"</span>);
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">redeem_script</span>,
+ <span class="prelude-val">Some</span>(<span class="ident">Script</span>::<span class="ident">from</span>(
+ <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(
+ <span class="string">"21032b0558078bec38694a84933d659303e2575dae7e91685911454115bfd64487e3ac"</span>
+ )
+ .<span class="ident">unwrap</span>()
+ ))
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">witness_script</span>, <span class="prelude-val">None</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_set_witness_script_p2wsh</span>() {
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">FromHex</span>;
+
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span>
+ <span class="ident">get_funded_wallet</span>(<span class="string">"wsh(pk(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW))"</span>);
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">redeem_script</span>, <span class="prelude-val">None</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">witness_script</span>,
+ <span class="prelude-val">Some</span>(<span class="ident">Script</span>::<span class="ident">from</span>(
+ <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(
+ <span class="string">"21032b0558078bec38694a84933d659303e2575dae7e91685911454115bfd64487e3ac"</span>
+ )
+ .<span class="ident">unwrap</span>()
+ ))
+ );
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_set_redeem_witness_script_p2wsh_p2sh</span>() {
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">FromHex</span>;
+
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span>
+ <span class="ident">get_funded_wallet</span>(<span class="string">"sh(wsh(pk(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW)))"</span>);
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
+ .<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="ident">Script</span>::<span class="ident">from</span>(
+ <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(
+ <span class="string">"21032b0558078bec38694a84933d659303e2575dae7e91685911454115bfd64487e3ac"</span>,
+ )
+ .<span class="ident">unwrap</span>(),
+ );
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">redeem_script</span>, <span class="prelude-val">Some</span>(<span class="ident">script</span>.<span class="ident">to_v0_p2wsh</span>()));
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">witness_script</span>, <span class="prelude-val">Some</span>(<span class="ident">script</span>));
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_non_witness_utxo</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span>
+ <span class="ident">get_funded_wallet</span>(<span class="string">"sh(pk(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW))"</span>);
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">non_witness_utxo</span>.<span class="ident">is_some</span>());
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">witness_utxo</span>.<span class="ident">is_none</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_only_witness_utxo</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span>
+ <span class="ident">get_funded_wallet</span>(<span class="string">"wsh(pk(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW))"</span>);
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">non_witness_utxo</span>.<span class="ident">is_none</span>());
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">witness_utxo</span>.<span class="ident">is_some</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_both_non_witness_utxo_and_witness_utxo</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span>
+ <span class="ident">get_funded_wallet</span>(<span class="string">"wsh(pk(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW))"</span>);
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)])
+ .<span class="ident">force_non_witness_utxo</span>()
+ .<span class="ident">send_all</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">non_witness_utxo</span>.<span class="ident">is_some</span>());
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">witness_utxo</span>.<span class="ident">is_some</span>());
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"IrreplaceableTransaction"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_bump_fee_irreplaceable_tx</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
+ <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
+ <span class="number">25_000</span>,
+ )]))
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
+ <span class="comment">// skip saving the utxos, we know they can't be used anyways</span>
+ <span class="ident">details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
+ <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">details</span>).<span class="ident">unwrap</span>();
+
+ <span class="ident">wallet</span>.<span class="ident">bump_fee</span>(<span class="kw-2">&</span><span class="ident">txid</span>, <span class="ident">TxBuilder</span>::<span class="ident">new</span>()).<span class="ident">unwrap</span>();
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"TransactionConfirmed"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_bump_fee_confirmed_tx</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
+ <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
+ <span class="number">25_000</span>,
+ )]))
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
+ <span class="comment">// skip saving the utxos, we know they can't be used anyways</span>
+ <span class="ident">details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
+ <span class="ident">details</span>.<span class="ident">height</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="number">42</span>);
+ <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">details</span>).<span class="ident">unwrap</span>();
+
+ <span class="ident">wallet</span>.<span class="ident">bump_fee</span>(<span class="kw-2">&</span><span class="ident">txid</span>, <span class="ident">TxBuilder</span>::<span class="ident">new</span>()).<span class="ident">unwrap</span>();
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"FeeRateTooLow"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_bump_fee_low_fee_rate</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">enable_rbf</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
+ <span class="comment">// skip saving the utxos, we know they can't be used anyways</span>
+ <span class="ident">details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
+ <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">details</span>).<span class="ident">unwrap</span>();
+
+ <span class="ident">wallet</span>
+ .<span class="ident">bump_fee</span>(
+ <span class="kw-2">&</span><span class="ident">txid</span>,
+ <span class="ident">TxBuilder</span>::<span class="ident">new</span>().<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">1.0</span>)),
+ )
+ .<span class="ident">unwrap</span>();
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bump_fee_reduce_change</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="string">"2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">original_details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">enable_rbf</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
+ <span class="comment">// skip saving the new utxos, we know they can't be used anyways</span>
+ <span class="kw">for</span> <span class="ident">txin</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
+ <span class="ident">txin</span>.<span class="ident">witness</span>.<span class="ident">push</span>([<span class="number">0x00</span>; <span class="number">108</span>].<span class="ident">to_vec</span>()); <span class="comment">// fake signature</span>
+ <span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">previous_output</span>)
+ .<span class="ident">unwrap</span>();
+ }
+ <span class="ident">original_details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
+ <span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">original_details</span>)
+ .<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">bump_fee</span>(
+ <span class="kw-2">&</span><span class="ident">txid</span>,
+ <span class="ident">TxBuilder</span>::<span class="ident">new</span>().<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">2.5</span>)),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">sent</span>, <span class="ident">original_details</span>.<span class="ident">sent</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">details</span>.<span class="ident">received</span> <span class="op">+</span> <span class="ident">details</span>.<span class="ident">fees</span>,
+ <span class="ident">original_details</span>.<span class="ident">received</span> <span class="op">+</span> <span class="ident">original_details</span>.<span class="ident">fees</span>
+ );
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">fees</span> <span class="op">></span> <span class="ident">original_details</span>.<span class="ident">fees</span>);
+
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>;
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">2</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tx</span>.<span class="ident">output</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">=</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">value</span>,
+ <span class="number">25_000</span>
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tx</span>.<span class="ident">output</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">!</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">value</span>,
+ <span class="ident">details</span>.<span class="ident">received</span>
+ );
+
+ <span class="macro">assert_fee_rate</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">extract_tx</span>(), <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">2.5</span>), @<span class="ident">add_signature</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bump_fee_reduce_send_all</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="string">"2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">original_details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)])
+ .<span class="ident">send_all</span>()
+ .<span class="ident">enable_rbf</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
+ <span class="kw">for</span> <span class="ident">txin</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
+ <span class="ident">txin</span>.<span class="ident">witness</span>.<span class="ident">push</span>([<span class="number">0x00</span>; <span class="number">108</span>].<span class="ident">to_vec</span>()); <span class="comment">// fake signature</span>
+ <span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">previous_output</span>)
+ .<span class="ident">unwrap</span>();
+ }
+ <span class="ident">original_details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
+ <span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">original_details</span>)
+ .<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">bump_fee</span>(
+ <span class="kw-2">&</span><span class="ident">txid</span>,
+ <span class="ident">TxBuilder</span>::<span class="ident">new</span>()
+ .<span class="ident">send_all</span>()
+ .<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">2.5</span>)),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">sent</span>, <span class="ident">original_details</span>.<span class="ident">sent</span>);
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">fees</span> <span class="op">></span> <span class="ident">original_details</span>.<span class="ident">fees</span>);
+
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>;
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">1</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>[<span class="number">0</span>].<span class="ident">value</span> <span class="op">+</span> <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">details</span>.<span class="ident">sent</span>);
+
+ <span class="macro">assert_fee_rate</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">extract_tx</span>(), <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">2.5</span>), @<span class="ident">add_signature</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"InsufficientFunds"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_bump_fee_remove_send_all_output</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="ident">descriptors</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="comment">// receive an extra tx, to make sure that in case of "send_all" we get an error and it</span>
+ <span class="comment">// doesn't try to pick more inputs</span>
+ <span class="kw">let</span> <span class="ident">incoming_txid</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">received_tx</span>(
+ <span class="macro">testutils</span><span class="macro">!</span> (@<span class="ident">tx</span> ( (@<span class="ident">external</span> <span class="ident">descriptors</span>, <span class="number">0</span>) <span class="op">=</span><span class="op">></span> <span class="number">25_000</span> ) (@<span class="ident">confirmations</span> <span class="number">1</span>)),
+ <span class="prelude-val">Some</span>(<span class="number">100</span>),
+ );
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="string">"2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">original_details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)])
+ .<span class="ident">utxos</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">OutPoint</span> {
+ <span class="ident">txid</span>: <span class="ident">incoming_txid</span>,
+ <span class="ident">vout</span>: <span class="number">0</span>,
+ }])
+ .<span class="ident">send_all</span>()
+ .<span class="ident">enable_rbf</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
+ <span class="kw">for</span> <span class="ident">txin</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
+ <span class="ident">txin</span>.<span class="ident">witness</span>.<span class="ident">push</span>([<span class="number">0x00</span>; <span class="number">108</span>].<span class="ident">to_vec</span>()); <span class="comment">// fake signature</span>
+ <span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">previous_output</span>)
+ .<span class="ident">unwrap</span>();
+ }
+ <span class="ident">original_details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
+ <span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">original_details</span>)
+ .<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">original_details</span>.<span class="ident">sent</span>, <span class="number">25_000</span>);
+
+ <span class="ident">wallet</span>
+ .<span class="ident">bump_fee</span>(
+ <span class="kw-2">&</span><span class="ident">txid</span>,
+ <span class="ident">TxBuilder</span>::<span class="ident">new</span>()
+ .<span class="ident">send_all</span>()
+ .<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">225.0</span>)),
+ )
+ .<span class="ident">unwrap</span>();
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bump_fee_add_input</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="ident">descriptors</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">received_tx</span>(
+ <span class="macro">testutils</span><span class="macro">!</span> (@<span class="ident">tx</span> ( (@<span class="ident">external</span> <span class="ident">descriptors</span>, <span class="number">0</span>) <span class="op">=</span><span class="op">></span> <span class="number">25_000</span> ) (@<span class="ident">confirmations</span> <span class="number">1</span>)),
+ <span class="prelude-val">Some</span>(<span class="number">100</span>),
+ );
+
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="string">"2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">original_details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">45_000</span>)]).<span class="ident">enable_rbf</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
+ <span class="comment">// skip saving the new utxos, we know they can't be used anyways</span>
+ <span class="kw">for</span> <span class="ident">txin</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
+ <span class="ident">txin</span>.<span class="ident">witness</span>.<span class="ident">push</span>([<span class="number">0x00</span>; <span class="number">108</span>].<span class="ident">to_vec</span>()); <span class="comment">// fake signature</span>
+ <span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">previous_output</span>)
+ .<span class="ident">unwrap</span>();
+ }
+ <span class="ident">original_details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
+ <span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">original_details</span>)
+ .<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">bump_fee</span>(
+ <span class="kw-2">&</span><span class="ident">txid</span>,
+ <span class="ident">TxBuilder</span>::<span class="ident">new</span>().<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">50.0</span>)),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">sent</span>, <span class="ident">original_details</span>.<span class="ident">sent</span> <span class="op">+</span> <span class="number">25_000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">fees</span> <span class="op">+</span> <span class="ident">details</span>.<span class="ident">received</span>, <span class="number">30_000</span>);
+
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>;
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">len</span>(), <span class="number">2</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">2</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tx</span>.<span class="ident">output</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">=</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">value</span>,
+ <span class="number">45_000</span>
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tx</span>.<span class="ident">output</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">!</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">value</span>,
+ <span class="ident">details</span>.<span class="ident">received</span>
+ );
+
+ <span class="macro">assert_fee_rate</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">extract_tx</span>(), <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">50.0</span>), @<span class="ident">add_signature</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bump_fee_no_change_add_input_and_change</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="ident">descriptors</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">incoming_txid</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">received_tx</span>(
+ <span class="macro">testutils</span><span class="macro">!</span> (@<span class="ident">tx</span> ( (@<span class="ident">external</span> <span class="ident">descriptors</span>, <span class="number">0</span>) <span class="op">=</span><span class="op">></span> <span class="number">25_000</span> ) (@<span class="ident">confirmations</span> <span class="number">1</span>)),
+ <span class="prelude-val">Some</span>(<span class="number">100</span>),
+ );
+
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="string">"2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">original_details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)])
+ .<span class="ident">send_all</span>()
+ .<span class="ident">add_utxo</span>(<span class="ident">OutPoint</span> {
+ <span class="ident">txid</span>: <span class="ident">incoming_txid</span>,
+ <span class="ident">vout</span>: <span class="number">0</span>,
+ })
+ .<span class="ident">enable_rbf</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
+ <span class="comment">// skip saving the new utxos, we know they can't be used anyways</span>
+ <span class="kw">for</span> <span class="ident">txin</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
+ <span class="ident">txin</span>.<span class="ident">witness</span>.<span class="ident">push</span>([<span class="number">0x00</span>; <span class="number">108</span>].<span class="ident">to_vec</span>()); <span class="comment">// fake signature</span>
+ <span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">previous_output</span>)
+ .<span class="ident">unwrap</span>();
+ }
+ <span class="ident">original_details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
+ <span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">original_details</span>)
+ .<span class="ident">unwrap</span>();
+
+ <span class="comment">// NOTE: we don't set "send_all" here. so we have a transaction with only one input, but</span>
+ <span class="comment">// here we are allowed to add more, and we will also have to add a change</span>
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">bump_fee</span>(
+ <span class="kw-2">&</span><span class="ident">txid</span>,
+ <span class="ident">TxBuilder</span>::<span class="ident">new</span>().<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">50.0</span>)),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">original_send_all_amount</span> <span class="op">=</span> <span class="ident">original_details</span>.<span class="ident">sent</span> <span class="op">-</span> <span class="ident">original_details</span>.<span class="ident">fees</span>;
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">sent</span>, <span class="ident">original_details</span>.<span class="ident">sent</span> <span class="op">+</span> <span class="number">50_000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">details</span>.<span class="ident">received</span>,
+ <span class="number">75_000</span> <span class="op">-</span> <span class="ident">original_send_all_amount</span> <span class="op">-</span> <span class="ident">details</span>.<span class="ident">fees</span>
+ );
+
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>;
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">len</span>(), <span class="number">2</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">2</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tx</span>.<span class="ident">output</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">=</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">value</span>,
+ <span class="ident">original_send_all_amount</span>
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tx</span>.<span class="ident">output</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">!</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">value</span>,
+ <span class="number">75_000</span> <span class="op">-</span> <span class="ident">original_send_all_amount</span> <span class="op">-</span> <span class="ident">details</span>.<span class="ident">fees</span>
+ );
+
+ <span class="macro">assert_fee_rate</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">extract_tx</span>(), <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">50.0</span>), @<span class="ident">add_signature</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bump_fee_add_input_change_dust</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="ident">descriptors</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">received_tx</span>(
+ <span class="macro">testutils</span><span class="macro">!</span> (@<span class="ident">tx</span> ( (@<span class="ident">external</span> <span class="ident">descriptors</span>, <span class="number">0</span>) <span class="op">=</span><span class="op">></span> <span class="number">25_000</span> ) (@<span class="ident">confirmations</span> <span class="number">1</span>)),
+ <span class="prelude-val">Some</span>(<span class="number">100</span>),
+ );
+
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="string">"2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">original_details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">45_000</span>)]).<span class="ident">enable_rbf</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">len</span>(), <span class="number">1</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">2</span>);
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
+ <span class="comment">// skip saving the new utxos, we know they can't be used anyways</span>
+ <span class="kw">for</span> <span class="ident">txin</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
+ <span class="ident">txin</span>.<span class="ident">witness</span>.<span class="ident">push</span>([<span class="number">0x00</span>; <span class="number">108</span>].<span class="ident">to_vec</span>()); <span class="comment">// fake signature</span>
+ <span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">previous_output</span>)
+ .<span class="ident">unwrap</span>();
+ }
+ <span class="ident">original_details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
+ <span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">original_details</span>)
+ .<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">bump_fee</span>(
+ <span class="kw-2">&</span><span class="ident">txid</span>,
+ <span class="ident">TxBuilder</span>::<span class="ident">new</span>().<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">140.0</span>)),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">original_details</span>.<span class="ident">received</span>, <span class="number">5_000</span> <span class="op">-</span> <span class="ident">original_details</span>.<span class="ident">fees</span>);
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">sent</span>, <span class="ident">original_details</span>.<span class="ident">sent</span> <span class="op">+</span> <span class="number">25_000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">fees</span>, <span class="number">30_000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">received</span>, <span class="number">0</span>);
+
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>;
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">len</span>(), <span class="number">2</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">1</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tx</span>.<span class="ident">output</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">=</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">value</span>,
+ <span class="number">45_000</span>
+ );
+
+ <span class="macro">assert_fee_rate</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">extract_tx</span>(), <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">140.0</span>), @<span class="ident">dust_change</span>, @<span class="ident">add_signature</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bump_fee_force_add_input</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="ident">descriptors</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
+ <span class="kw">let</span> <span class="ident">incoming_txid</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">received_tx</span>(
+ <span class="macro">testutils</span><span class="macro">!</span> (@<span class="ident">tx</span> ( (@<span class="ident">external</span> <span class="ident">descriptors</span>, <span class="number">0</span>) <span class="op">=</span><span class="op">></span> <span class="number">25_000</span> ) (@<span class="ident">confirmations</span> <span class="number">1</span>)),
+ <span class="prelude-val">Some</span>(<span class="number">100</span>),
+ );
+
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="string">"2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">original_details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(
+ <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">45_000</span>)]).<span class="ident">enable_rbf</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
+ <span class="comment">// skip saving the new utxos, we know they can't be used anyways</span>
+ <span class="kw">for</span> <span class="ident">txin</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
+ <span class="ident">txin</span>.<span class="ident">witness</span>.<span class="ident">push</span>([<span class="number">0x00</span>; <span class="number">108</span>].<span class="ident">to_vec</span>()); <span class="comment">// fake signature</span>
+ <span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">previous_output</span>)
+ .<span class="ident">unwrap</span>();
+ }
+ <span class="ident">original_details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
+ <span class="ident">wallet</span>
+ .<span class="ident">database</span>
+ .<span class="ident">borrow_mut</span>()
+ .<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">original_details</span>)
+ .<span class="ident">unwrap</span>();
+
+ <span class="comment">// the new fee_rate is low enough that just reducing the change would be fine, but we force</span>
+ <span class="comment">// the addition of an extra input with `add_utxo()`</span>
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">bump_fee</span>(
+ <span class="kw-2">&</span><span class="ident">txid</span>,
+ <span class="ident">TxBuilder</span>::<span class="ident">new</span>()
+ .<span class="ident">add_utxo</span>(<span class="ident">OutPoint</span> {
+ <span class="ident">txid</span>: <span class="ident">incoming_txid</span>,
+ <span class="ident">vout</span>: <span class="number">0</span>,
+ })
+ .<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">5.0</span>)),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">sent</span>, <span class="ident">original_details</span>.<span class="ident">sent</span> <span class="op">+</span> <span class="number">25_000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">fees</span> <span class="op">+</span> <span class="ident">details</span>.<span class="ident">received</span>, <span class="number">30_000</span>);
+
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>;
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">len</span>(), <span class="number">2</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">2</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tx</span>.<span class="ident">output</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">=</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">value</span>,
+ <span class="number">45_000</span>
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tx</span>.<span class="ident">output</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">!</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">value</span>,
+ <span class="ident">details</span>.<span class="ident">received</span>
+ );
+
+ <span class="macro">assert_fee_rate</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">extract_tx</span>(), <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">5.0</span>), @<span class="ident">add_signature</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_sign_single_xprv</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="string">"wpkh(tprv8ZgxMBicQKsPd3EupYiPRhaMooHKUHJxNsTfYuScep13go8QFfHdtkG9nRkFGb7busX4isf6X9dURGCoKgitaApQ6MupRhZMcELAxTBRJgS/*)"</span>);
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
+ .<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> (<span class="ident">signed_psbt</span>, <span class="ident">finalized</span>) <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">sign</span>(<span class="ident">psbt</span>, <span class="prelude-val">None</span>).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">finalized</span>, <span class="bool-val">true</span>);
+
+ <span class="kw">let</span> <span class="ident">extracted</span> <span class="op">=</span> <span class="ident">signed_psbt</span>.<span class="ident">extract_tx</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">extracted</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">witness</span>.<span class="ident">len</span>(), <span class="number">2</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_sign_single_wif</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span>
+ <span class="ident">get_funded_wallet</span>(<span class="string">"wpkh(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW)"</span>);
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
+ .<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> (<span class="ident">signed_psbt</span>, <span class="ident">finalized</span>) <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">sign</span>(<span class="ident">psbt</span>, <span class="prelude-val">None</span>).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">finalized</span>, <span class="bool-val">true</span>);
+
+ <span class="kw">let</span> <span class="ident">extracted</span> <span class="op">=</span> <span class="ident">signed_psbt</span>.<span class="ident">extract_tx</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">extracted</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">witness</span>.<span class="ident">len</span>(), <span class="number">2</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_sign_single_xprv_no_hd_keypaths</span>() {
+ <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="string">"wpkh(tprv8ZgxMBicQKsPd3EupYiPRhaMooHKUHJxNsTfYuScep13go8QFfHdtkG9nRkFGb7busX4isf6X9dURGCoKgitaApQ6MupRhZMcELAxTBRJgS/*)"</span>);
+ <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
+ .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
+ .<span class="ident">unwrap</span>();
+
+ <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">hd_keypaths</span>.<span class="ident">clear</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">hd_keypaths</span>.<span class="ident">len</span>(), <span class="number">0</span>);
+
+ <span class="kw">let</span> (<span class="ident">signed_psbt</span>, <span class="ident">finalized</span>) <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">sign</span>(<span class="ident">psbt</span>, <span class="prelude-val">None</span>).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">finalized</span>, <span class="bool-val">true</span>);
+
+ <span class="kw">let</span> <span class="ident">extracted</span> <span class="op">=</span> <span class="ident">signed_psbt</span>.<span class="ident">extract_tx</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">extracted</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">witness</span>.<span class="ident">len</span>(), <span class="number">2</span>);
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/wallet/rbf.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>rbf.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">Database</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="kw-2">*</span>;
+
+<span class="doccomment">/// Filters unspent utxos</span>
+<span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">fn</span> <span class="ident">filter_available</span><span class="op"><</span><span class="ident">I</span>: <span class="ident">Iterator</span><span class="op"><</span><span class="ident">Item</span> <span class="op">=</span> <span class="ident">UTXO</span><span class="op">></span>, <span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span>(
+ <span class="ident">database</span>: <span class="kw-2">&</span><span class="ident">D</span>,
+ <span class="ident">iter</span>: <span class="ident">I</span>,
+) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">iter</span>
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">utxo</span><span class="op">|</span> {
+ <span class="prelude-val">Ok</span>(<span class="kw">match</span> <span class="ident">database</span>.<span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="ident">utxo</span>.<span class="ident">outpoint</span>.<span class="ident">txid</span>, <span class="bool-val">true</span>)<span class="question-mark">?</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
+ <span class="prelude-val">Some</span>(<span class="ident">tx</span>) <span class="kw">if</span> <span class="ident">tx</span>.<span class="ident">height</span>.<span class="ident">is_none</span>() <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
+ <span class="prelude-val">Some</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">utxo</span>),
+ })
+ })
+ .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span><span class="op">></span>()<span class="question-mark">?</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">filter_map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span>)
+ .<span class="ident">collect</span>())
+}
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="kw">mod</span> <span class="ident">test</span> {
+ <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
+
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">OutPoint</span>, <span class="ident">Transaction</span>, <span class="ident">TxIn</span>, <span class="ident">TxOut</span>, <span class="ident">Txid</span>};
+
+ <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::{<span class="ident">BatchOperations</span>, <span class="ident">MemoryDatabase</span>};
+
+ <span class="kw">fn</span> <span class="ident">add_transaction</span>(
+ <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">MemoryDatabase</span>,
+ <span class="ident">spend</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">OutPoint</span><span class="op">></span>,
+ <span class="ident">outputs</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">u64</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="ident">Txid</span> {
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">Transaction</span> {
+ <span class="ident">version</span>: <span class="number">1</span>,
+ <span class="ident">lock_time</span>: <span class="number">0</span>,
+ <span class="ident">input</span>: <span class="ident">spend</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">cloned</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">previous_output</span><span class="op">|</span> <span class="ident">TxIn</span> {
+ <span class="ident">previous_output</span>,
+ ..<span class="ident">Default</span>::<span class="ident">default</span>()
+ })
+ .<span class="ident">collect</span>(),
+ <span class="ident">output</span>: <span class="ident">outputs</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">cloned</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">value</span><span class="op">|</span> <span class="ident">TxOut</span> {
+ <span class="ident">value</span>,
+ ..<span class="ident">Default</span>::<span class="ident">default</span>()
+ })
+ .<span class="ident">collect</span>(),
+ };
+ <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
+
+ <span class="kw">for</span> <span class="ident">input</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">spend</span> {
+ <span class="ident">database</span>.<span class="ident">del_utxo</span>(<span class="ident">input</span>).<span class="ident">unwrap</span>();
+ }
+ <span class="kw">for</span> <span class="ident">vout</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">outputs</span>.<span class="ident">len</span>() {
+ <span class="ident">database</span>
+ .<span class="ident">set_utxo</span>(<span class="kw-2">&</span><span class="ident">UTXO</span> {
+ <span class="ident">txout</span>: <span class="ident">tx</span>.<span class="ident">output</span>[<span class="ident">vout</span>].<span class="ident">clone</span>(),
+ <span class="ident">outpoint</span>: <span class="ident">OutPoint</span> {
+ <span class="ident">txid</span>,
+ <span class="ident">vout</span>: <span class="ident">vout</span> <span class="kw">as</span> <span class="ident">u32</span>,
+ },
+ <span class="ident">is_internal</span>: <span class="bool-val">true</span>,
+ })
+ .<span class="ident">unwrap</span>();
+ }
+ <span class="ident">database</span>
+ .<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">TransactionDetails</span> {
+ <span class="ident">txid</span>,
+ <span class="ident">transaction</span>: <span class="prelude-val">Some</span>(<span class="ident">tx</span>),
+ <span class="ident">height</span>: <span class="prelude-val">None</span>,
+ ..<span class="ident">Default</span>::<span class="ident">default</span>()
+ })
+ .<span class="ident">unwrap</span>();
+
+ <span class="ident">txid</span>
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_filter_available</span>() {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">database</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">new</span>();
+ <span class="ident">add_transaction</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">database</span>,
+ <span class="macro">vec</span><span class="macro">!</span>[<span class="ident">OutPoint</span>::<span class="ident">from_str</span>(
+ <span class="string">"aad194c72fd5cfd16d23da9462930ca91e35df1cfee05242b62f4034f50c3d41:5"</span>,
+ )
+ .<span class="ident">unwrap</span>()],
+ <span class="macro">vec</span><span class="macro">!</span>[<span class="number">50_000</span>],
+ );
+
+ <span class="kw">let</span> <span class="ident">filtered</span> <span class="op">=</span>
+ <span class="ident">filter_available</span>(<span class="kw-2">&</span><span class="ident">database</span>, <span class="ident">database</span>.<span class="ident">iter_utxos</span>().<span class="ident">unwrap</span>().<span class="ident">into_iter</span>()).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">filtered</span>, <span class="kw-2">&</span>[]);
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/wallet/signer.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>signer.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+<span id="163">163</span>
+<span id="164">164</span>
+<span id="165">165</span>
+<span id="166">166</span>
+<span id="167">167</span>
+<span id="168">168</span>
+<span id="169">169</span>
+<span id="170">170</span>
+<span id="171">171</span>
+<span id="172">172</span>
+<span id="173">173</span>
+<span id="174">174</span>
+<span id="175">175</span>
+<span id="176">176</span>
+<span id="177">177</span>
+<span id="178">178</span>
+<span id="179">179</span>
+<span id="180">180</span>
+<span id="181">181</span>
+<span id="182">182</span>
+<span id="183">183</span>
+<span id="184">184</span>
+<span id="185">185</span>
+<span id="186">186</span>
+<span id="187">187</span>
+<span id="188">188</span>
+<span id="189">189</span>
+<span id="190">190</span>
+<span id="191">191</span>
+<span id="192">192</span>
+<span id="193">193</span>
+<span id="194">194</span>
+<span id="195">195</span>
+<span id="196">196</span>
+<span id="197">197</span>
+<span id="198">198</span>
+<span id="199">199</span>
+<span id="200">200</span>
+<span id="201">201</span>
+<span id="202">202</span>
+<span id="203">203</span>
+<span id="204">204</span>
+<span id="205">205</span>
+<span id="206">206</span>
+<span id="207">207</span>
+<span id="208">208</span>
+<span id="209">209</span>
+<span id="210">210</span>
+<span id="211">211</span>
+<span id="212">212</span>
+<span id="213">213</span>
+<span id="214">214</span>
+<span id="215">215</span>
+<span id="216">216</span>
+<span id="217">217</span>
+<span id="218">218</span>
+<span id="219">219</span>
+<span id="220">220</span>
+<span id="221">221</span>
+<span id="222">222</span>
+<span id="223">223</span>
+<span id="224">224</span>
+<span id="225">225</span>
+<span id="226">226</span>
+<span id="227">227</span>
+<span id="228">228</span>
+<span id="229">229</span>
+<span id="230">230</span>
+<span id="231">231</span>
+<span id="232">232</span>
+<span id="233">233</span>
+<span id="234">234</span>
+<span id="235">235</span>
+<span id="236">236</span>
+<span id="237">237</span>
+<span id="238">238</span>
+<span id="239">239</span>
+<span id="240">240</span>
+<span id="241">241</span>
+<span id="242">242</span>
+<span id="243">243</span>
+<span id="244">244</span>
+<span id="245">245</span>
+<span id="246">246</span>
+<span id="247">247</span>
+<span id="248">248</span>
+<span id="249">249</span>
+<span id="250">250</span>
+<span id="251">251</span>
+<span id="252">252</span>
+<span id="253">253</span>
+<span id="254">254</span>
+<span id="255">255</span>
+<span id="256">256</span>
+<span id="257">257</span>
+<span id="258">258</span>
+<span id="259">259</span>
+<span id="260">260</span>
+<span id="261">261</span>
+<span id="262">262</span>
+<span id="263">263</span>
+<span id="264">264</span>
+<span id="265">265</span>
+<span id="266">266</span>
+<span id="267">267</span>
+<span id="268">268</span>
+<span id="269">269</span>
+<span id="270">270</span>
+<span id="271">271</span>
+<span id="272">272</span>
+<span id="273">273</span>
+<span id="274">274</span>
+<span id="275">275</span>
+<span id="276">276</span>
+<span id="277">277</span>
+<span id="278">278</span>
+<span id="279">279</span>
+<span id="280">280</span>
+<span id="281">281</span>
+<span id="282">282</span>
+<span id="283">283</span>
+<span id="284">284</span>
+<span id="285">285</span>
+<span id="286">286</span>
+<span id="287">287</span>
+<span id="288">288</span>
+<span id="289">289</span>
+<span id="290">290</span>
+<span id="291">291</span>
+<span id="292">292</span>
+<span id="293">293</span>
+<span id="294">294</span>
+<span id="295">295</span>
+<span id="296">296</span>
+<span id="297">297</span>
+<span id="298">298</span>
+<span id="299">299</span>
+<span id="300">300</span>
+<span id="301">301</span>
+<span id="302">302</span>
+<span id="303">303</span>
+<span id="304">304</span>
+<span id="305">305</span>
+<span id="306">306</span>
+<span id="307">307</span>
+<span id="308">308</span>
+<span id="309">309</span>
+<span id="310">310</span>
+<span id="311">311</span>
+<span id="312">312</span>
+<span id="313">313</span>
+<span id="314">314</span>
+<span id="315">315</span>
+<span id="316">316</span>
+<span id="317">317</span>
+<span id="318">318</span>
+<span id="319">319</span>
+<span id="320">320</span>
+<span id="321">321</span>
+<span id="322">322</span>
+<span id="323">323</span>
+<span id="324">324</span>
+<span id="325">325</span>
+<span id="326">326</span>
+<span id="327">327</span>
+<span id="328">328</span>
+<span id="329">329</span>
+<span id="330">330</span>
+<span id="331">331</span>
+<span id="332">332</span>
+<span id="333">333</span>
+<span id="334">334</span>
+<span id="335">335</span>
+<span id="336">336</span>
+<span id="337">337</span>
+<span id="338">338</span>
+<span id="339">339</span>
+<span id="340">340</span>
+<span id="341">341</span>
+<span id="342">342</span>
+<span id="343">343</span>
+<span id="344">344</span>
+<span id="345">345</span>
+<span id="346">346</span>
+<span id="347">347</span>
+<span id="348">348</span>
+<span id="349">349</span>
+<span id="350">350</span>
+<span id="351">351</span>
+<span id="352">352</span>
+<span id="353">353</span>
+<span id="354">354</span>
+<span id="355">355</span>
+<span id="356">356</span>
+<span id="357">357</span>
+<span id="358">358</span>
+<span id="359">359</span>
+<span id="360">360</span>
+<span id="361">361</span>
+<span id="362">362</span>
+<span id="363">363</span>
+<span id="364">364</span>
+<span id="365">365</span>
+<span id="366">366</span>
+<span id="367">367</span>
+<span id="368">368</span>
+<span id="369">369</span>
+<span id="370">370</span>
+<span id="371">371</span>
+<span id="372">372</span>
+<span id="373">373</span>
+<span id="374">374</span>
+<span id="375">375</span>
+<span id="376">376</span>
+<span id="377">377</span>
+<span id="378">378</span>
+<span id="379">379</span>
+<span id="380">380</span>
+<span id="381">381</span>
+<span id="382">382</span>
+<span id="383">383</span>
+<span id="384">384</span>
+<span id="385">385</span>
+<span id="386">386</span>
+<span id="387">387</span>
+<span id="388">388</span>
+<span id="389">389</span>
+<span id="390">390</span>
+<span id="391">391</span>
+<span id="392">392</span>
+<span id="393">393</span>
+<span id="394">394</span>
+<span id="395">395</span>
+<span id="396">396</span>
+<span id="397">397</span>
+<span id="398">398</span>
+<span id="399">399</span>
+<span id="400">400</span>
+<span id="401">401</span>
+<span id="402">402</span>
+<span id="403">403</span>
+<span id="404">404</span>
+<span id="405">405</span>
+<span id="406">406</span>
+<span id="407">407</span>
+<span id="408">408</span>
+<span id="409">409</span>
+<span id="410">410</span>
+<span id="411">411</span>
+<span id="412">412</span>
+<span id="413">413</span>
+<span id="414">414</span>
+<span id="415">415</span>
+<span id="416">416</span>
+<span id="417">417</span>
+<span id="418">418</span>
+<span id="419">419</span>
+<span id="420">420</span>
+<span id="421">421</span>
+<span id="422">422</span>
+<span id="423">423</span>
+<span id="424">424</span>
+<span id="425">425</span>
+<span id="426">426</span>
+<span id="427">427</span>
+<span id="428">428</span>
+<span id="429">429</span>
+<span id="430">430</span>
+<span id="431">431</span>
+<span id="432">432</span>
+<span id="433">433</span>
+<span id="434">434</span>
+<span id="435">435</span>
+<span id="436">436</span>
+<span id="437">437</span>
+<span id="438">438</span>
+<span id="439">439</span>
+<span id="440">440</span>
+<span id="441">441</span>
+<span id="442">442</span>
+<span id="443">443</span>
+<span id="444">444</span>
+<span id="445">445</span>
+<span id="446">446</span>
+<span id="447">447</span>
+<span id="448">448</span>
+<span id="449">449</span>
+<span id="450">450</span>
+<span id="451">451</span>
+<span id="452">452</span>
+<span id="453">453</span>
+<span id="454">454</span>
+<span id="455">455</span>
+<span id="456">456</span>
+<span id="457">457</span>
+<span id="458">458</span>
+<span id="459">459</span>
+<span id="460">460</span>
+<span id="461">461</span>
+<span id="462">462</span>
+<span id="463">463</span>
+<span id="464">464</span>
+<span id="465">465</span>
+<span id="466">466</span>
+<span id="467">467</span>
+<span id="468">468</span>
+<span id="469">469</span>
+<span id="470">470</span>
+<span id="471">471</span>
+<span id="472">472</span>
+<span id="473">473</span>
+<span id="474">474</span>
+<span id="475">475</span>
+<span id="476">476</span>
+<span id="477">477</span>
+<span id="478">478</span>
+<span id="479">479</span>
+<span id="480">480</span>
+<span id="481">481</span>
+<span id="482">482</span>
+<span id="483">483</span>
+<span id="484">484</span>
+<span id="485">485</span>
+<span id="486">486</span>
+<span id="487">487</span>
+<span id="488">488</span>
+<span id="489">489</span>
+<span id="490">490</span>
+<span id="491">491</span>
+<span id="492">492</span>
+<span id="493">493</span>
+<span id="494">494</span>
+<span id="495">495</span>
+<span id="496">496</span>
+<span id="497">497</span>
+<span id="498">498</span>
+<span id="499">499</span>
+<span id="500">500</span>
+<span id="501">501</span>
+<span id="502">502</span>
+<span id="503">503</span>
+<span id="504">504</span>
+<span id="505">505</span>
+<span id="506">506</span>
+<span id="507">507</span>
+<span id="508">508</span>
+<span id="509">509</span>
+<span id="510">510</span>
+<span id="511">511</span>
+<span id="512">512</span>
+<span id="513">513</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="doccomment">//! Generalized signers</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! This module provides the ability to add customized signers to a [`Wallet`](super::Wallet)</span>
+<span class="doccomment">//! through the [`Wallet::add_signer`](super::Wallet::add_signer) function.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ```</span>
+<span class="doccomment">//! # use std::sync::Arc;</span>
+<span class="doccomment">//! # use std::str::FromStr;</span>
+<span class="doccomment">//! # use bitcoin::*;</span>
+<span class="doccomment">//! # use bitcoin::util::psbt;</span>
+<span class="doccomment">//! # use bitcoin::util::bip32::Fingerprint;</span>
+<span class="doccomment">//! # use bdk::signer::*;</span>
+<span class="doccomment">//! # use bdk::database::*;</span>
+<span class="doccomment">//! # use bdk::*;</span>
+<span class="doccomment">//! # #[derive(Debug)]</span>
+<span class="doccomment">//! # struct CustomHSM;</span>
+<span class="doccomment">//! # impl CustomHSM {</span>
+<span class="doccomment">//! # fn sign_input(&self, _psbt: &mut psbt::PartiallySignedTransaction, _input: usize) -> Result<(), SignerError> {</span>
+<span class="doccomment">//! # Ok(())</span>
+<span class="doccomment">//! # }</span>
+<span class="doccomment">//! # fn connect() -> Self {</span>
+<span class="doccomment">//! # CustomHSM</span>
+<span class="doccomment">//! # }</span>
+<span class="doccomment">//! # }</span>
+<span class="doccomment">//! #[derive(Debug)]</span>
+<span class="doccomment">//! struct CustomSigner {</span>
+<span class="doccomment">//! device: CustomHSM,</span>
+<span class="doccomment">//! }</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! impl CustomSigner {</span>
+<span class="doccomment">//! fn connect() -> Self {</span>
+<span class="doccomment">//! CustomSigner { device: CustomHSM::connect() }</span>
+<span class="doccomment">//! }</span>
+<span class="doccomment">//! }</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! impl Signer for CustomSigner {</span>
+<span class="doccomment">//! fn sign(</span>
+<span class="doccomment">//! &self,</span>
+<span class="doccomment">//! psbt: &mut psbt::PartiallySignedTransaction,</span>
+<span class="doccomment">//! input_index: Option<usize>,</span>
+<span class="doccomment">//! ) -> Result<(), SignerError> {</span>
+<span class="doccomment">//! let input_index = input_index.ok_or(SignerError::InputIndexOutOfRange)?;</span>
+<span class="doccomment">//! self.device.sign_input(psbt, input_index)?;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! Ok(())</span>
+<span class="doccomment">//! }</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! fn sign_whole_tx(&self) -> bool {</span>
+<span class="doccomment">//! false</span>
+<span class="doccomment">//! }</span>
+<span class="doccomment">//! }</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! let custom_signer = CustomSigner::connect();</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! let descriptor = "wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)";</span>
+<span class="doccomment">//! let mut wallet: OfflineWallet<_> = Wallet::new_offline(descriptor, None, Network::Testnet, MemoryDatabase::default())?;</span>
+<span class="doccomment">//! wallet.add_signer(</span>
+<span class="doccomment">//! ScriptType::External,</span>
+<span class="doccomment">//! Fingerprint::from_str("e30f11b8").unwrap().into(),</span>
+<span class="doccomment">//! SignerOrdering(200),</span>
+<span class="doccomment">//! Arc::new(Box::new(custom_signer))</span>
+<span class="doccomment">//! );</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! # Ok::<_, bdk::Error>(())</span>
+<span class="doccomment">//! ```</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">cmp</span>::<span class="ident">Ordering</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ops</span>::<span class="ident">Bound</span>::<span class="ident">Included</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>;
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">blockdata</span>::<span class="ident">opcodes</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">blockdata</span>::<span class="ident">script</span>::<span class="ident">Builder</span> <span class="kw">as</span> <span class="ident">ScriptBuilder</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::{<span class="ident">hash160</span>, <span class="ident">Hash</span>};
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">secp256k1</span>::{<span class="ident">Message</span>, <span class="ident">Secp256k1</span>};
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::{<span class="ident">ExtendedPrivKey</span>, <span class="ident">Fingerprint</span>};
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::{<span class="ident">bip143</span>, <span class="ident">psbt</span>};
+<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">PrivateKey</span>, <span class="ident">SigHash</span>, <span class="ident">SigHashType</span>};
+
+<span class="kw">use</span> <span class="ident">miniscript</span>::<span class="ident">descriptor</span>::{<span class="ident">DescriptorPublicKey</span>, <span class="ident">DescriptorSecretKey</span>, <span class="ident">DescriptorXKey</span>, <span class="ident">KeyMap</span>};
+<span class="kw">use</span> <span class="ident">miniscript</span>::{<span class="ident">Legacy</span>, <span class="ident">MiniscriptKey</span>, <span class="ident">Segwitv0</span>};
+
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">XKeyUtils</span>;
+
+<span class="doccomment">/// Identifier of a signer in the `SignersContainers`. Used as a key to find the right signer among</span>
+<span class="doccomment">/// multiple of them</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>, <span class="ident">Hash</span>)]</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">SignerId</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> {
+ <span class="ident">PkHash</span>(<span class="op"><</span><span class="ident">Pk</span> <span class="kw">as</span> <span class="ident">MiniscriptKey</span><span class="op">></span>::<span class="ident">Hash</span>),
+ <span class="ident">Fingerprint</span>(<span class="ident">Fingerprint</span>),
+}
+
+<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">hash160</span>::<span class="ident">Hash</span><span class="op">></span> <span class="kw">for</span> <span class="ident">SignerId</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">hash</span>: <span class="ident">hash160</span>::<span class="ident">Hash</span>) <span class="op">-</span><span class="op">></span> <span class="ident">SignerId</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
+ <span class="ident">SignerId</span>::<span class="ident">PkHash</span>(<span class="ident">hash</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">Fingerprint</span><span class="op">></span> <span class="kw">for</span> <span class="ident">SignerId</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">fing</span>: <span class="ident">Fingerprint</span>) <span class="op">-</span><span class="op">></span> <span class="ident">SignerId</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
+ <span class="ident">SignerId</span>::<span class="ident">Fingerprint</span>(<span class="ident">fing</span>)
+ }
+}
+
+<span class="doccomment">/// Signing error</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>, <span class="ident">Clone</span>)]</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">SignerError</span> {
+ <span class="doccomment">/// The private key is missing for the required public key</span>
+ <span class="ident">MissingKey</span>,
+ <span class="doccomment">/// The user canceled the operation</span>
+ <span class="ident">UserCanceled</span>,
+ <span class="doccomment">/// The sighash is missing in the PSBT input</span>
+ <span class="ident">MissingSighash</span>,
+ <span class="doccomment">/// Input index is out of range</span>
+ <span class="ident">InputIndexOutOfRange</span>,
+ <span class="doccomment">/// The `non_witness_utxo` field of the transaction is required to sign this input</span>
+ <span class="ident">MissingNonWitnessUtxo</span>,
+ <span class="doccomment">/// The `non_witness_utxo` specified is invalid</span>
+ <span class="ident">InvalidNonWitnessUtxo</span>,
+ <span class="doccomment">/// The `witness_utxo` field of the transaction is required to sign this input</span>
+ <span class="ident">MissingWitnessUtxo</span>,
+ <span class="doccomment">/// The `witness_script` field of the transaction is requied to sign this input</span>
+ <span class="ident">MissingWitnessScript</span>,
+ <span class="doccomment">/// The fingerprint and derivation path are missing from the psbt input</span>
+ <span class="ident">MissingHDKeypath</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">SignerError</span> {
+ <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
+ <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"{:?}"</span>, <span class="self">self</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span> <span class="kw">for</span> <span class="ident">SignerError</span> {}
+
+<span class="doccomment">/// Trait for signers</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This trait can be implemented to provide customized signers to the wallet. For an example see</span>
+<span class="doccomment">/// [`this module`](crate::wallet::signer)'s documentation.</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">Signer</span>: <span class="ident">fmt</span>::<span class="ident">Debug</span> {
+ <span class="doccomment">/// Sign a PSBT</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// The `input_index` argument is only provided if the wallet doesn't declare to sign the whole</span>
+ <span class="doccomment">/// transaction in one go (see [`Signer::sign_whole_tx`]). Otherwise its value is `None` and</span>
+ <span class="doccomment">/// can be ignored.</span>
+ <span class="kw">fn</span> <span class="ident">sign</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">psbt</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span>,
+ <span class="ident">input_index</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">SignerError</span><span class="op">></span>;
+
+ <span class="doccomment">/// Return whether or not the signer signs the whole transaction in one go instead of every</span>
+ <span class="doccomment">/// input individually</span>
+ <span class="kw">fn</span> <span class="ident">sign_whole_tx</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span>;
+
+ <span class="doccomment">/// Return the secret key for the signer</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This is used internally to reconstruct the original descriptor that may contain secrets.</span>
+ <span class="doccomment">/// External signers that are meant to keep key isolated should just return `None` here (which</span>
+ <span class="doccomment">/// is the default for this method, if not overridden).</span>
+ <span class="kw">fn</span> <span class="ident">descriptor_secret_key</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">DescriptorSecretKey</span><span class="op">></span> {
+ <span class="prelude-val">None</span>
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">Signer</span> <span class="kw">for</span> <span class="ident">DescriptorXKey</span><span class="op"><</span><span class="ident">ExtendedPrivKey</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">sign</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">psbt</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span>,
+ <span class="ident">input_index</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">SignerError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">input_index</span> <span class="op">=</span> <span class="ident">input_index</span>.<span class="ident">unwrap</span>();
+ <span class="kw">if</span> <span class="ident">input_index</span> <span class="op">></span><span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">len</span>() {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">SignerError</span>::<span class="ident">InputIndexOutOfRange</span>);
+ }
+
+ <span class="kw">let</span> <span class="ident">deriv_path</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="ident">input_index</span>]
+ .<span class="ident">hd_keypaths</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">filter_map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="kw-2">&</span>(<span class="ident">fingerprint</span>, <span class="kw-2">ref</span> <span class="ident">path</span>))<span class="op">|</span> <span class="self">self</span>.<span class="ident">matches</span>(<span class="ident">fingerprint</span>.<span class="ident">clone</span>(), <span class="kw-2">&</span><span class="ident">path</span>))
+ .<span class="ident">next</span>()
+ {
+ <span class="prelude-val">Some</span>(<span class="ident">deriv_path</span>) <span class="op">=</span><span class="op">></span> <span class="ident">deriv_path</span>,
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Ok</span>(()), <span class="comment">// TODO: should report an error maybe?</span>
+ };
+
+ <span class="kw">let</span> <span class="ident">ctx</span> <span class="op">=</span> <span class="ident">Secp256k1</span>::<span class="ident">signing_only</span>();
+
+ <span class="kw">let</span> <span class="ident">derived_key</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">xkey</span>.<span class="ident">derive_priv</span>(<span class="kw-2">&</span><span class="ident">ctx</span>, <span class="kw-2">&</span><span class="ident">deriv_path</span>).<span class="ident">unwrap</span>();
+ <span class="ident">derived_key</span>.<span class="ident">private_key</span>.<span class="ident">sign</span>(<span class="ident">psbt</span>, <span class="prelude-val">Some</span>(<span class="ident">input_index</span>))
+ }
+
+ <span class="kw">fn</span> <span class="ident">sign_whole_tx</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="bool-val">false</span>
+ }
+
+ <span class="kw">fn</span> <span class="ident">descriptor_secret_key</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">DescriptorSecretKey</span><span class="op">></span> {
+ <span class="prelude-val">Some</span>(<span class="ident">DescriptorSecretKey</span>::<span class="ident">XPrv</span>(<span class="self">self</span>.<span class="ident">clone</span>()))
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">Signer</span> <span class="kw">for</span> <span class="ident">PrivateKey</span> {
+ <span class="kw">fn</span> <span class="ident">sign</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">psbt</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span>,
+ <span class="ident">input_index</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">SignerError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">input_index</span> <span class="op">=</span> <span class="ident">input_index</span>.<span class="ident">unwrap</span>();
+ <span class="kw">if</span> <span class="ident">input_index</span> <span class="op">></span><span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">len</span>() {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">SignerError</span>::<span class="ident">InputIndexOutOfRange</span>);
+ }
+
+ <span class="kw">let</span> <span class="ident">ctx</span> <span class="op">=</span> <span class="ident">Secp256k1</span>::<span class="ident">signing_only</span>();
+
+ <span class="kw">let</span> <span class="ident">pubkey</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">public_key</span>(<span class="kw-2">&</span><span class="ident">ctx</span>);
+ <span class="kw">if</span> <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="ident">input_index</span>].<span class="ident">partial_sigs</span>.<span class="ident">contains_key</span>(<span class="kw-2">&</span><span class="ident">pubkey</span>) {
+ <span class="kw">return</span> <span class="prelude-val">Ok</span>(());
+ }
+
+ <span class="comment">// FIXME: use the presence of `witness_utxo` as an indication that we should make a bip143</span>
+ <span class="comment">// sig. Does this make sense? Should we add an extra argument to explicitly swith between</span>
+ <span class="comment">// these? The original idea was to declare sign() as sign<Ctx: ScriptContex>() and use Ctx,</span>
+ <span class="comment">// but that violates the rules for trait-objects, so we can't do it.</span>
+ <span class="kw">let</span> (<span class="ident">hash</span>, <span class="ident">sighash</span>) <span class="op">=</span> <span class="kw">match</span> <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="ident">input_index</span>].<span class="ident">witness_utxo</span> {
+ <span class="prelude-val">Some</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Segwitv0</span>::<span class="ident">sighash</span>(<span class="ident">psbt</span>, <span class="ident">input_index</span>)<span class="question-mark">?</span>,
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="ident">Legacy</span>::<span class="ident">sighash</span>(<span class="ident">psbt</span>, <span class="ident">input_index</span>)<span class="question-mark">?</span>,
+ };
+
+ <span class="kw">let</span> <span class="ident">signature</span> <span class="op">=</span> <span class="ident">ctx</span>.<span class="ident">sign</span>(
+ <span class="kw-2">&</span><span class="ident">Message</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">hash</span>.<span class="ident">into_inner</span>()[..]).<span class="ident">unwrap</span>(),
+ <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">key</span>,
+ );
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">final_signature</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="number">75</span>);
+ <span class="ident">final_signature</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">signature</span>.<span class="ident">serialize_der</span>());
+ <span class="ident">final_signature</span>.<span class="ident">push</span>(<span class="ident">sighash</span>.<span class="ident">as_u32</span>() <span class="kw">as</span> <span class="ident">u8</span>);
+
+ <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="ident">input_index</span>]
+ .<span class="ident">partial_sigs</span>
+ .<span class="ident">insert</span>(<span class="ident">pubkey</span>, <span class="ident">final_signature</span>);
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">fn</span> <span class="ident">sign_whole_tx</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="bool-val">false</span>
+ }
+
+ <span class="kw">fn</span> <span class="ident">descriptor_secret_key</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">DescriptorSecretKey</span><span class="op">></span> {
+ <span class="prelude-val">Some</span>(<span class="ident">DescriptorSecretKey</span>::<span class="ident">PrivKey</span>(<span class="self">self</span>.<span class="ident">clone</span>()))
+ }
+}
+
+<span class="doccomment">/// Defines the order in which signers are called</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// The default value is `100`. Signers with an ordering above that will be called later,</span>
+<span class="doccomment">/// and they will thus see the partial signatures added to the transaction once they get to sign</span>
+<span class="doccomment">/// themselves.</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">PartialOrd</span>, <span class="ident">PartialEq</span>, <span class="ident">Ord</span>, <span class="ident">Eq</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">SignerOrdering</span>(<span class="kw">pub</span> <span class="ident">usize</span>);
+
+<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">default</span>::<span class="ident">Default</span> <span class="kw">for</span> <span class="ident">SignerOrdering</span> {
+ <span class="kw">fn</span> <span class="ident">default</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">SignerOrdering</span>(<span class="number">100</span>)
+ }
+}
+
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>)]</span>
+<span class="kw">struct</span> <span class="ident">SignersContainerKey</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> {
+ <span class="ident">id</span>: <span class="ident">SignerId</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span>,
+ <span class="ident">ordering</span>: <span class="ident">SignerOrdering</span>,
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> <span class="ident">From</span><span class="op"><</span>(<span class="ident">SignerId</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span>, <span class="ident">SignerOrdering</span>)<span class="op">></span> <span class="kw">for</span> <span class="ident">SignersContainerKey</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">tuple</span>: (<span class="ident">SignerId</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span>, <span class="ident">SignerOrdering</span>)) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">SignersContainerKey</span> {
+ <span class="ident">id</span>: <span class="ident">tuple</span>.<span class="number">0</span>,
+ <span class="ident">ordering</span>: <span class="ident">tuple</span>.<span class="number">1</span>,
+ }
+ }
+}
+
+<span class="doccomment">/// Container for multiple signers</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Default</span>, <span class="ident">Clone</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span>(
+ <span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">SignersContainerKey</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span>, <span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Signer</span><span class="op">></span><span class="op">></span><span class="op">></span>,
+);
+
+<span class="kw">impl</span> <span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">as_key_map</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">KeyMap</span> {
+ <span class="self">self</span>.<span class="number">0</span>
+ .<span class="ident">values</span>()
+ .<span class="ident">filter_map</span>(<span class="op">|</span><span class="ident">signer</span><span class="op">|</span> <span class="ident">signer</span>.<span class="ident">descriptor_secret_key</span>())
+ .<span class="ident">filter_map</span>(<span class="op">|</span><span class="ident">secret</span><span class="op">|</span> <span class="ident">secret</span>.<span class="ident">as_public</span>().<span class="ident">ok</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">public</span><span class="op">|</span> (<span class="ident">public</span>, <span class="ident">secret</span>)))
+ .<span class="ident">collect</span>()
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">KeyMap</span><span class="op">></span> <span class="kw">for</span> <span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">keymap</span>: <span class="ident">KeyMap</span>) <span class="op">-</span><span class="op">></span> <span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">container</span> <span class="op">=</span> <span class="ident">SignersContainer</span>::<span class="ident">new</span>();
+
+ <span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">secret</span>) <span class="kw">in</span> <span class="ident">keymap</span> {
+ <span class="kw">match</span> <span class="ident">secret</span> {
+ <span class="ident">DescriptorSecretKey</span>::<span class="ident">PrivKey</span>(<span class="ident">private_key</span>) <span class="op">=</span><span class="op">></span> <span class="ident">container</span>.<span class="ident">add_external</span>(
+ <span class="ident">SignerId</span>::<span class="ident">from</span>(
+ <span class="ident">private_key</span>
+ .<span class="ident">public_key</span>(<span class="kw-2">&</span><span class="ident">Secp256k1</span>::<span class="ident">signing_only</span>())
+ .<span class="ident">to_pubkeyhash</span>(),
+ ),
+ <span class="ident">SignerOrdering</span>::<span class="ident">default</span>(),
+ <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">private_key</span>)),
+ ),
+ <span class="ident">DescriptorSecretKey</span>::<span class="ident">XPrv</span>(<span class="ident">xprv</span>) <span class="op">=</span><span class="op">></span> <span class="ident">container</span>.<span class="ident">add_external</span>(
+ <span class="ident">SignerId</span>::<span class="ident">from</span>(<span class="ident">xprv</span>.<span class="ident">root_fingerprint</span>()),
+ <span class="ident">SignerOrdering</span>::<span class="ident">default</span>(),
+ <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">xprv</span>)),
+ ),
+ };
+ }
+
+ <span class="ident">container</span>
+ }
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> <span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span> {
+ <span class="doccomment">/// Default constructor</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">SignersContainer</span>(<span class="ident">Default</span>::<span class="ident">default</span>())
+ }
+
+ <span class="doccomment">/// Adds an external signer to the container for the specified id. Optionally returns the</span>
+ <span class="doccomment">/// signer that was previosuly in the container, if any</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">add_external</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
+ <span class="ident">id</span>: <span class="ident">SignerId</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span>,
+ <span class="ident">ordering</span>: <span class="ident">SignerOrdering</span>,
+ <span class="ident">signer</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Signer</span><span class="op">></span><span class="op">></span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Signer</span><span class="op">></span><span class="op">></span><span class="op">></span> {
+ <span class="self">self</span>.<span class="number">0</span>.<span class="ident">insert</span>((<span class="ident">id</span>, <span class="ident">ordering</span>).<span class="ident">into</span>(), <span class="ident">signer</span>)
+ }
+
+ <span class="doccomment">/// Removes a signer from the container and returns it</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">remove</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
+ <span class="ident">id</span>: <span class="ident">SignerId</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span>,
+ <span class="ident">ordering</span>: <span class="ident">SignerOrdering</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Signer</span><span class="op">></span><span class="op">></span><span class="op">></span> {
+ <span class="self">self</span>.<span class="number">0</span>.<span class="ident">remove</span>(<span class="kw-2">&</span>(<span class="ident">id</span>, <span class="ident">ordering</span>).<span class="ident">into</span>())
+ }
+
+ <span class="doccomment">/// Returns the list of identifiers of all the signers in the container</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">ids</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">SignerId</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span><span class="op">></span> {
+ <span class="self">self</span>.<span class="number">0</span>
+ .<span class="ident">keys</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">SignersContainerKey</span> { <span class="ident">id</span>, .. }<span class="op">|</span> <span class="ident">id</span>)
+ .<span class="ident">collect</span>()
+ }
+
+ <span class="doccomment">/// Returns the list of signers in the container, sorted by lowest to highest `ordering`</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">signers</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Signer</span><span class="op">></span><span class="op">></span><span class="op">></span> {
+ <span class="self">self</span>.<span class="number">0</span>.<span class="ident">values</span>().<span class="ident">collect</span>()
+ }
+
+ <span class="doccomment">/// Finds the signer with lowest ordering for a given id in the container.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">find</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">id</span>: <span class="ident">SignerId</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Signer</span><span class="op">></span><span class="op">></span><span class="op">></span> {
+ <span class="self">self</span>.<span class="number">0</span>
+ .<span class="ident">range</span>((
+ <span class="ident">Included</span>(<span class="kw-2">&</span>(<span class="ident">id</span>.<span class="ident">clone</span>(), <span class="ident">SignerOrdering</span>(<span class="number">0</span>)).<span class="ident">into</span>()),
+ <span class="ident">Included</span>(<span class="kw-2">&</span>(<span class="ident">id</span>, <span class="ident">SignerOrdering</span>(<span class="ident">usize</span>::<span class="ident">MAX</span>)).<span class="ident">into</span>()),
+ ))
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">v</span>)<span class="op">|</span> <span class="ident">v</span>)
+ .<span class="ident">nth</span>(<span class="number">0</span>)
+ }
+}
+
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">trait</span> <span class="ident">ComputeSighash</span> {
+ <span class="kw">fn</span> <span class="ident">sighash</span>(
+ <span class="ident">psbt</span>: <span class="kw-2">&</span><span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span>,
+ <span class="ident">input_index</span>: <span class="ident">usize</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">SigHash</span>, <span class="ident">SigHashType</span>), <span class="ident">SignerError</span><span class="op">></span>;
+}
+
+<span class="kw">impl</span> <span class="ident">ComputeSighash</span> <span class="kw">for</span> <span class="ident">Legacy</span> {
+ <span class="kw">fn</span> <span class="ident">sighash</span>(
+ <span class="ident">psbt</span>: <span class="kw-2">&</span><span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span>,
+ <span class="ident">input_index</span>: <span class="ident">usize</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">SigHash</span>, <span class="ident">SigHashType</span>), <span class="ident">SignerError</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="ident">input_index</span> <span class="op">></span><span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">len</span>() {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">SignerError</span>::<span class="ident">InputIndexOutOfRange</span>);
+ }
+
+ <span class="kw">let</span> <span class="ident">psbt_input</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="ident">input_index</span>];
+ <span class="kw">let</span> <span class="ident">tx_input</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">input</span>[<span class="ident">input_index</span>];
+
+ <span class="kw">let</span> <span class="ident">sighash</span> <span class="op">=</span> <span class="ident">psbt_input</span>.<span class="ident">sighash_type</span>.<span class="ident">ok_or</span>(<span class="ident">SignerError</span>::<span class="ident">MissingSighash</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="kw">match</span> <span class="kw-2">&</span><span class="ident">psbt_input</span>.<span class="ident">redeem_script</span> {
+ <span class="kw-2">&</span><span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">redeem_script</span>) <span class="op">=</span><span class="op">></span> <span class="ident">redeem_script</span>.<span class="ident">clone</span>(),
+ <span class="kw-2">&</span><span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">non_witness_utxo</span> <span class="op">=</span> <span class="ident">psbt_input</span>
+ .<span class="ident">non_witness_utxo</span>
+ .<span class="ident">as_ref</span>()
+ .<span class="ident">ok_or</span>(<span class="ident">SignerError</span>::<span class="ident">MissingNonWitnessUtxo</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">prev_out</span> <span class="op">=</span> <span class="ident">non_witness_utxo</span>
+ .<span class="ident">output</span>
+ .<span class="ident">get</span>(<span class="ident">tx_input</span>.<span class="ident">previous_output</span>.<span class="ident">vout</span> <span class="kw">as</span> <span class="ident">usize</span>)
+ .<span class="ident">ok_or</span>(<span class="ident">SignerError</span>::<span class="ident">InvalidNonWitnessUtxo</span>)<span class="question-mark">?</span>;
+
+ <span class="ident">prev_out</span>.<span class="ident">script_pubkey</span>.<span class="ident">clone</span>()
+ }
+ };
+
+ <span class="prelude-val">Ok</span>((
+ <span class="ident">psbt</span>.<span class="ident">global</span>
+ .<span class="ident">unsigned_tx</span>
+ .<span class="ident">signature_hash</span>(<span class="ident">input_index</span>, <span class="kw-2">&</span><span class="ident">script</span>, <span class="ident">sighash</span>.<span class="ident">as_u32</span>()),
+ <span class="ident">sighash</span>,
+ ))
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">ComputeSighash</span> <span class="kw">for</span> <span class="ident">Segwitv0</span> {
+ <span class="kw">fn</span> <span class="ident">sighash</span>(
+ <span class="ident">psbt</span>: <span class="kw-2">&</span><span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span>,
+ <span class="ident">input_index</span>: <span class="ident">usize</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">SigHash</span>, <span class="ident">SigHashType</span>), <span class="ident">SignerError</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="ident">input_index</span> <span class="op">></span><span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">len</span>() {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">SignerError</span>::<span class="ident">InputIndexOutOfRange</span>);
+ }
+
+ <span class="kw">let</span> <span class="ident">psbt_input</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="ident">input_index</span>];
+
+ <span class="kw">let</span> <span class="ident">sighash</span> <span class="op">=</span> <span class="ident">psbt_input</span>.<span class="ident">sighash_type</span>.<span class="ident">ok_or</span>(<span class="ident">SignerError</span>::<span class="ident">MissingSighash</span>)<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="ident">witness_utxo</span> <span class="op">=</span> <span class="ident">psbt_input</span>
+ .<span class="ident">witness_utxo</span>
+ .<span class="ident">as_ref</span>()
+ .<span class="ident">ok_or</span>(<span class="ident">SignerError</span>::<span class="ident">MissingNonWitnessUtxo</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="ident">witness_utxo</span>.<span class="ident">value</span>;
+
+ <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="kw">match</span> <span class="kw-2">&</span><span class="ident">psbt_input</span>.<span class="ident">witness_script</span> {
+ <span class="kw-2">&</span><span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">witness_script</span>) <span class="op">=</span><span class="op">></span> <span class="ident">witness_script</span>.<span class="ident">clone</span>(),
+ <span class="kw-2">&</span><span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="ident">witness_utxo</span>.<span class="ident">script_pubkey</span>.<span class="ident">is_v0_p2wpkh</span>() {
+ <span class="ident">ScriptBuilder</span>::<span class="ident">new</span>()
+ .<span class="ident">push_opcode</span>(<span class="ident">opcodes</span>::<span class="ident">all</span>::<span class="ident">OP_DUP</span>)
+ .<span class="ident">push_opcode</span>(<span class="ident">opcodes</span>::<span class="ident">all</span>::<span class="ident">OP_HASH160</span>)
+ .<span class="ident">push_slice</span>(<span class="kw-2">&</span><span class="ident">witness_utxo</span>.<span class="ident">script_pubkey</span>[<span class="number">2</span>..])
+ .<span class="ident">push_opcode</span>(<span class="ident">opcodes</span>::<span class="ident">all</span>::<span class="ident">OP_EQUALVERIFY</span>)
+ .<span class="ident">push_opcode</span>(<span class="ident">opcodes</span>::<span class="ident">all</span>::<span class="ident">OP_CHECKSIG</span>)
+ .<span class="ident">into_script</span>()
+ } <span class="kw">else</span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">SignerError</span>::<span class="ident">MissingWitnessScript</span>);
+ }
+ }
+ };
+
+ <span class="prelude-val">Ok</span>((
+ <span class="ident">bip143</span>::<span class="ident">SigHashCache</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>).<span class="ident">signature_hash</span>(
+ <span class="ident">input_index</span>,
+ <span class="kw-2">&</span><span class="ident">script</span>,
+ <span class="ident">value</span>,
+ <span class="ident">sighash</span>,
+ ),
+ <span class="ident">sighash</span>,
+ ))
+ }
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> <span class="ident">PartialOrd</span> <span class="kw">for</span> <span class="ident">SignersContainerKey</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">partial_cmp</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">other</span>: <span class="kw-2">&</span><span class="self">Self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Ordering</span><span class="op">></span> {
+ <span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">cmp</span>(<span class="ident">other</span>))
+ }
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> <span class="ident">Ord</span> <span class="kw">for</span> <span class="ident">SignersContainerKey</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">cmp</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">other</span>: <span class="kw-2">&</span><span class="self">Self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Ordering</span> {
+ <span class="self">self</span>.<span class="ident">ordering</span>.<span class="ident">cmp</span>(<span class="kw-2">&</span><span class="ident">other</span>.<span class="ident">ordering</span>)
+ }
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> <span class="ident">PartialEq</span> <span class="kw">for</span> <span class="ident">SignersContainerKey</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">eq</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">other</span>: <span class="kw-2">&</span><span class="self">Self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="self">self</span>.<span class="ident">ordering</span> <span class="op">=</span><span class="op">=</span> <span class="ident">other</span>.<span class="ident">ordering</span>
+ }
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> <span class="ident">Eq</span> <span class="kw">for</span> <span class="ident">SignersContainerKey</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span> {}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/wallet/time.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>time.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10">10</span>
+<span id="11">11</span>
+<span id="12">12</span>
+<span id="13">13</span>
+<span id="14">14</span>
+<span id="15">15</span>
+<span id="16">16</span>
+<span id="17">17</span>
+<span id="18">18</span>
+<span id="19">19</span>
+<span id="20">20</span>
+<span id="21">21</span>
+<span id="22">22</span>
+<span id="23">23</span>
+<span id="24">24</span>
+<span id="25">25</span>
+<span id="26">26</span>
+<span id="27">27</span>
+<span id="28">28</span>
+<span id="29">29</span>
+<span id="30">30</span>
+<span id="31">31</span>
+<span id="32">32</span>
+<span id="33">33</span>
+<span id="34">34</span>
+<span id="35">35</span>
+<span id="36">36</span>
+<span id="37">37</span>
+<span id="38">38</span>
+<span id="39">39</span>
+<span id="40">40</span>
+<span id="41">41</span>
+<span id="42">42</span>
+<span id="43">43</span>
+<span id="44">44</span>
+<span id="45">45</span>
+<span id="46">46</span>
+<span id="47">47</span>
+<span id="48">48</span>
+<span id="49">49</span>
+<span id="50">50</span>
+<span id="51">51</span>
+<span id="52">52</span>
+<span id="53">53</span>
+<span id="54">54</span>
+<span id="55">55</span>
+<span id="56">56</span>
+<span id="57">57</span>
+<span id="58">58</span>
+<span id="59">59</span>
+<span id="60">60</span>
+<span id="61">61</span>
+<span id="62">62</span>
+<span id="63">63</span>
+<span id="64">64</span>
+<span id="65">65</span>
+<span id="66">66</span>
+<span id="67">67</span>
+<span id="68">68</span>
+<span id="69">69</span>
+<span id="70">70</span>
+<span id="71">71</span>
+<span id="72">72</span>
+<span id="73">73</span>
+<span id="74">74</span>
+<span id="75">75</span>
+<span id="76">76</span>
+<span id="77">77</span>
+<span id="78">78</span>
+<span id="79">79</span>
+<span id="80">80</span>
+<span id="81">81</span>
+<span id="82">82</span>
+<span id="83">83</span>
+<span id="84">84</span>
+<span id="85">85</span>
+<span id="86">86</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="doccomment">//! Cross-platform time</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! This module provides a function to get the current timestamp that works on all the platforms</span>
+<span class="doccomment">//! supported by the library.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! It can be useful to compare it with the timestamps found in</span>
+<span class="doccomment">//! [`TransactionDetails`](crate::types::TransactionDetails).</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">Duration</span>;
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>)]</span>
+<span class="kw">use</span> <span class="ident">js_sys</span>::<span class="ident">Date</span>;
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">not</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>))]</span>
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::{<span class="ident">Instant</span> <span class="kw">as</span> <span class="ident">SystemInstant</span>, <span class="ident">SystemTime</span>, <span class="ident">UNIX_EPOCH</span>};
+
+<span class="doccomment">/// Return the current timestamp in seconds</span>
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">not</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>))]</span>
+<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_timestamp</span>() <span class="op">-</span><span class="op">></span> <span class="ident">u64</span> {
+ <span class="ident">SystemTime</span>::<span class="ident">now</span>()
+ .<span class="ident">duration_since</span>(<span class="ident">UNIX_EPOCH</span>)
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">as_secs</span>()
+}
+<span class="doccomment">/// Return the current timestamp in seconds</span>
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>)]</span>
+<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_timestamp</span>() <span class="op">-</span><span class="op">></span> <span class="ident">u64</span> {
+ <span class="kw">let</span> <span class="ident">millis</span> <span class="op">=</span> <span class="ident">Date</span>::<span class="ident">now</span>();
+
+ (<span class="ident">millis</span> <span class="op">/</span> <span class="number">1000.0</span>) <span class="kw">as</span> <span class="ident">u64</span>
+}
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">not</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>))]</span>
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">struct</span> <span class="ident">Instant</span>(<span class="ident">SystemInstant</span>);
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>)]</span>
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">struct</span> <span class="ident">Instant</span>(<span class="ident">Duration</span>);
+
+<span class="kw">impl</span> <span class="ident">Instant</span> {
+ <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">not</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>))]</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">Instant</span>(<span class="ident">SystemInstant</span>::<span class="ident">now</span>())
+ }
+ <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>)]</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="kw">let</span> <span class="ident">millis</span> <span class="op">=</span> <span class="ident">Date</span>::<span class="ident">now</span>();
+
+ <span class="kw">let</span> <span class="ident">secs</span> <span class="op">=</span> <span class="ident">millis</span> <span class="op">/</span> <span class="number">1000.0</span>;
+ <span class="kw">let</span> <span class="ident">nanos</span> <span class="op">=</span> (<span class="ident">millis</span> <span class="op">%</span> <span class="number">1000.0</span>) <span class="op">*</span> <span class="number">1e6</span>;
+
+ <span class="ident">Instant</span>(<span class="ident">Duration</span>::<span class="ident">new</span>(<span class="ident">secs</span> <span class="kw">as</span> <span class="ident">u64</span>, <span class="ident">nanos</span> <span class="kw">as</span> <span class="ident">u32</span>))
+ }
+
+ <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">not</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>))]</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">elapsed</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Duration</span> {
+ <span class="self">self</span>.<span class="number">0</span>.<span class="ident">elapsed</span>()
+ }
+ <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>)]</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">elapsed</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Duration</span> {
+ <span class="kw">let</span> <span class="ident">now</span> <span class="op">=</span> <span class="ident">Instant</span>::<span class="ident">new</span>();
+
+ <span class="ident">now</span>.<span class="number">0</span>.<span class="ident">checked_sub</span>(<span class="self">self</span>.<span class="number">0</span>).<span class="ident">unwrap_or</span>(<span class="ident">Duration</span>::<span class="ident">new</span>(<span class="number">0</span>, <span class="number">0</span>))
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/wallet/tx_builder.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>tx_builder.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+<span id="155">155</span>
+<span id="156">156</span>
+<span id="157">157</span>
+<span id="158">158</span>
+<span id="159">159</span>
+<span id="160">160</span>
+<span id="161">161</span>
+<span id="162">162</span>
+<span id="163">163</span>
+<span id="164">164</span>
+<span id="165">165</span>
+<span id="166">166</span>
+<span id="167">167</span>
+<span id="168">168</span>
+<span id="169">169</span>
+<span id="170">170</span>
+<span id="171">171</span>
+<span id="172">172</span>
+<span id="173">173</span>
+<span id="174">174</span>
+<span id="175">175</span>
+<span id="176">176</span>
+<span id="177">177</span>
+<span id="178">178</span>
+<span id="179">179</span>
+<span id="180">180</span>
+<span id="181">181</span>
+<span id="182">182</span>
+<span id="183">183</span>
+<span id="184">184</span>
+<span id="185">185</span>
+<span id="186">186</span>
+<span id="187">187</span>
+<span id="188">188</span>
+<span id="189">189</span>
+<span id="190">190</span>
+<span id="191">191</span>
+<span id="192">192</span>
+<span id="193">193</span>
+<span id="194">194</span>
+<span id="195">195</span>
+<span id="196">196</span>
+<span id="197">197</span>
+<span id="198">198</span>
+<span id="199">199</span>
+<span id="200">200</span>
+<span id="201">201</span>
+<span id="202">202</span>
+<span id="203">203</span>
+<span id="204">204</span>
+<span id="205">205</span>
+<span id="206">206</span>
+<span id="207">207</span>
+<span id="208">208</span>
+<span id="209">209</span>
+<span id="210">210</span>
+<span id="211">211</span>
+<span id="212">212</span>
+<span id="213">213</span>
+<span id="214">214</span>
+<span id="215">215</span>
+<span id="216">216</span>
+<span id="217">217</span>
+<span id="218">218</span>
+<span id="219">219</span>
+<span id="220">220</span>
+<span id="221">221</span>
+<span id="222">222</span>
+<span id="223">223</span>
+<span id="224">224</span>
+<span id="225">225</span>
+<span id="226">226</span>
+<span id="227">227</span>
+<span id="228">228</span>
+<span id="229">229</span>
+<span id="230">230</span>
+<span id="231">231</span>
+<span id="232">232</span>
+<span id="233">233</span>
+<span id="234">234</span>
+<span id="235">235</span>
+<span id="236">236</span>
+<span id="237">237</span>
+<span id="238">238</span>
+<span id="239">239</span>
+<span id="240">240</span>
+<span id="241">241</span>
+<span id="242">242</span>
+<span id="243">243</span>
+<span id="244">244</span>
+<span id="245">245</span>
+<span id="246">246</span>
+<span id="247">247</span>
+<span id="248">248</span>
+<span id="249">249</span>
+<span id="250">250</span>
+<span id="251">251</span>
+<span id="252">252</span>
+<span id="253">253</span>
+<span id="254">254</span>
+<span id="255">255</span>
+<span id="256">256</span>
+<span id="257">257</span>
+<span id="258">258</span>
+<span id="259">259</span>
+<span id="260">260</span>
+<span id="261">261</span>
+<span id="262">262</span>
+<span id="263">263</span>
+<span id="264">264</span>
+<span id="265">265</span>
+<span id="266">266</span>
+<span id="267">267</span>
+<span id="268">268</span>
+<span id="269">269</span>
+<span id="270">270</span>
+<span id="271">271</span>
+<span id="272">272</span>
+<span id="273">273</span>
+<span id="274">274</span>
+<span id="275">275</span>
+<span id="276">276</span>
+<span id="277">277</span>
+<span id="278">278</span>
+<span id="279">279</span>
+<span id="280">280</span>
+<span id="281">281</span>
+<span id="282">282</span>
+<span id="283">283</span>
+<span id="284">284</span>
+<span id="285">285</span>
+<span id="286">286</span>
+<span id="287">287</span>
+<span id="288">288</span>
+<span id="289">289</span>
+<span id="290">290</span>
+<span id="291">291</span>
+<span id="292">292</span>
+<span id="293">293</span>
+<span id="294">294</span>
+<span id="295">295</span>
+<span id="296">296</span>
+<span id="297">297</span>
+<span id="298">298</span>
+<span id="299">299</span>
+<span id="300">300</span>
+<span id="301">301</span>
+<span id="302">302</span>
+<span id="303">303</span>
+<span id="304">304</span>
+<span id="305">305</span>
+<span id="306">306</span>
+<span id="307">307</span>
+<span id="308">308</span>
+<span id="309">309</span>
+<span id="310">310</span>
+<span id="311">311</span>
+<span id="312">312</span>
+<span id="313">313</span>
+<span id="314">314</span>
+<span id="315">315</span>
+<span id="316">316</span>
+<span id="317">317</span>
+<span id="318">318</span>
+<span id="319">319</span>
+<span id="320">320</span>
+<span id="321">321</span>
+<span id="322">322</span>
+<span id="323">323</span>
+<span id="324">324</span>
+<span id="325">325</span>
+<span id="326">326</span>
+<span id="327">327</span>
+<span id="328">328</span>
+<span id="329">329</span>
+<span id="330">330</span>
+<span id="331">331</span>
+<span id="332">332</span>
+<span id="333">333</span>
+<span id="334">334</span>
+<span id="335">335</span>
+<span id="336">336</span>
+<span id="337">337</span>
+<span id="338">338</span>
+<span id="339">339</span>
+<span id="340">340</span>
+<span id="341">341</span>
+<span id="342">342</span>
+<span id="343">343</span>
+<span id="344">344</span>
+<span id="345">345</span>
+<span id="346">346</span>
+<span id="347">347</span>
+<span id="348">348</span>
+<span id="349">349</span>
+<span id="350">350</span>
+<span id="351">351</span>
+<span id="352">352</span>
+<span id="353">353</span>
+<span id="354">354</span>
+<span id="355">355</span>
+<span id="356">356</span>
+<span id="357">357</span>
+<span id="358">358</span>
+<span id="359">359</span>
+<span id="360">360</span>
+<span id="361">361</span>
+<span id="362">362</span>
+<span id="363">363</span>
+<span id="364">364</span>
+<span id="365">365</span>
+<span id="366">366</span>
+<span id="367">367</span>
+<span id="368">368</span>
+<span id="369">369</span>
+<span id="370">370</span>
+<span id="371">371</span>
+<span id="372">372</span>
+<span id="373">373</span>
+<span id="374">374</span>
+<span id="375">375</span>
+<span id="376">376</span>
+<span id="377">377</span>
+<span id="378">378</span>
+<span id="379">379</span>
+<span id="380">380</span>
+<span id="381">381</span>
+<span id="382">382</span>
+<span id="383">383</span>
+<span id="384">384</span>
+<span id="385">385</span>
+<span id="386">386</span>
+<span id="387">387</span>
+<span id="388">388</span>
+<span id="389">389</span>
+<span id="390">390</span>
+<span id="391">391</span>
+<span id="392">392</span>
+<span id="393">393</span>
+<span id="394">394</span>
+<span id="395">395</span>
+<span id="396">396</span>
+<span id="397">397</span>
+<span id="398">398</span>
+<span id="399">399</span>
+<span id="400">400</span>
+<span id="401">401</span>
+<span id="402">402</span>
+<span id="403">403</span>
+<span id="404">404</span>
+<span id="405">405</span>
+<span id="406">406</span>
+<span id="407">407</span>
+<span id="408">408</span>
+<span id="409">409</span>
+<span id="410">410</span>
+<span id="411">411</span>
+<span id="412">412</span>
+<span id="413">413</span>
+<span id="414">414</span>
+<span id="415">415</span>
+<span id="416">416</span>
+<span id="417">417</span>
+<span id="418">418</span>
+<span id="419">419</span>
+<span id="420">420</span>
+<span id="421">421</span>
+<span id="422">422</span>
+<span id="423">423</span>
+<span id="424">424</span>
+<span id="425">425</span>
+<span id="426">426</span>
+<span id="427">427</span>
+<span id="428">428</span>
+<span id="429">429</span>
+<span id="430">430</span>
+<span id="431">431</span>
+<span id="432">432</span>
+<span id="433">433</span>
+<span id="434">434</span>
+<span id="435">435</span>
+<span id="436">436</span>
+<span id="437">437</span>
+<span id="438">438</span>
+<span id="439">439</span>
+<span id="440">440</span>
+<span id="441">441</span>
+<span id="442">442</span>
+<span id="443">443</span>
+<span id="444">444</span>
+<span id="445">445</span>
+<span id="446">446</span>
+<span id="447">447</span>
+<span id="448">448</span>
+<span id="449">449</span>
+<span id="450">450</span>
+<span id="451">451</span>
+<span id="452">452</span>
+<span id="453">453</span>
+<span id="454">454</span>
+<span id="455">455</span>
+<span id="456">456</span>
+<span id="457">457</span>
+<span id="458">458</span>
+<span id="459">459</span>
+<span id="460">460</span>
+<span id="461">461</span>
+<span id="462">462</span>
+<span id="463">463</span>
+<span id="464">464</span>
+<span id="465">465</span>
+<span id="466">466</span>
+<span id="467">467</span>
+<span id="468">468</span>
+<span id="469">469</span>
+<span id="470">470</span>
+<span id="471">471</span>
+<span id="472">472</span>
+<span id="473">473</span>
+<span id="474">474</span>
+<span id="475">475</span>
+<span id="476">476</span>
+<span id="477">477</span>
+<span id="478">478</span>
+<span id="479">479</span>
+<span id="480">480</span>
+<span id="481">481</span>
+<span id="482">482</span>
+<span id="483">483</span>
+<span id="484">484</span>
+<span id="485">485</span>
+<span id="486">486</span>
+<span id="487">487</span>
+<span id="488">488</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="doccomment">//! Transaction builder</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ## Example</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ```</span>
+<span class="doccomment">//! # use std::str::FromStr;</span>
+<span class="doccomment">//! # use bitcoin::*;</span>
+<span class="doccomment">//! # use bdk::*;</span>
+<span class="doccomment">//! # let to_address = Address::from_str("2N4eQYCbKUHCCTUjBJeHcJp9ok6J2GZsTDt").unwrap();</span>
+<span class="doccomment">//! // Create a transaction with one output to `to_address` of 50_000 satoshi, with a custom fee rate</span>
+<span class="doccomment">//! // of 5.0 satoshi/vbyte, only spending non-change outputs and with RBF signaling</span>
+<span class="doccomment">//! // enabled</span>
+<span class="doccomment">//! let builder = TxBuilder::with_recipients(vec![(to_address.script_pubkey(), 50_000)])</span>
+<span class="doccomment">//! .fee_rate(FeeRate::from_sat_per_vb(5.0))</span>
+<span class="doccomment">//! .do_not_spend_change()</span>
+<span class="doccomment">//! .enable_rbf();</span>
+<span class="doccomment">//! ```</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">default</span>::<span class="ident">Default</span>;
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">OutPoint</span>, <span class="ident">Script</span>, <span class="ident">SigHashType</span>, <span class="ident">Transaction</span>};
+
+<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">coin_selection</span>::{<span class="ident">CoinSelectionAlgorithm</span>, <span class="ident">DefaultCoinSelectionAlgorithm</span>};
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::{<span class="ident">FeeRate</span>, <span class="ident">UTXO</span>};
+
+<span class="doccomment">/// A transaction builder</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This structure contains the configuration that the wallet must follow to build a transaction.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// For an example see [this module](super::tx_builder)'s documentation;</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Default</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">Cs</span>: <span class="ident">CoinSelectionAlgorithm</span><span class="op">></span> {
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">recipients</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">Script</span>, <span class="ident">u64</span>)<span class="op">></span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">send_all</span>: <span class="ident">bool</span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">fee_rate</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">FeeRate</span><span class="op">></span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">policy_path</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span><span class="op">></span><span class="op">></span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">utxos</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">OutPoint</span><span class="op">></span><span class="op">></span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">unspendable</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">OutPoint</span><span class="op">></span><span class="op">></span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">sighash</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">SigHashType</span><span class="op">></span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">ordering</span>: <span class="ident">TxOrdering</span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">locktime</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">rbf</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">version</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Version</span><span class="op">></span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">change_policy</span>: <span class="ident">ChangeSpendPolicy</span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">force_non_witness_utxo</span>: <span class="ident">bool</span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">coin_selection</span>: <span class="ident">Cs</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">DefaultCoinSelectionAlgorithm</span><span class="op">></span> {
+ <span class="doccomment">/// Create an empty builder</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">Self</span>::<span class="ident">default</span>()
+ }
+
+ <span class="doccomment">/// Create a builder starting from a list of recipients</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">with_recipients</span>(<span class="ident">recipients</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">Script</span>, <span class="ident">u64</span>)<span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">Self</span>::<span class="ident">default</span>().<span class="ident">set_recipients</span>(<span class="ident">recipients</span>)
+ }
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">Cs</span>: <span class="ident">CoinSelectionAlgorithm</span><span class="op">></span> <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">Cs</span><span class="op">></span> {
+ <span class="doccomment">/// Replace the recipients already added with a new list</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">set_recipients</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">recipients</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">Script</span>, <span class="ident">u64</span>)<span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">recipients</span> <span class="op">=</span> <span class="ident">recipients</span>;
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Add a recipient to the internal list</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">add_recipient</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_pubkey</span>: <span class="ident">Script</span>, <span class="ident">amount</span>: <span class="ident">u64</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">recipients</span>.<span class="ident">push</span>((<span class="ident">script_pubkey</span>, <span class="ident">amount</span>));
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Send all the selected utxos to a single output</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// Adding more than one recipients with this option enabled will result in an error.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// The value associated with the only recipient is irrelevant and will be replaced by the wallet.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">send_all</span>(<span class="kw-2">mut</span> <span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">send_all</span> <span class="op">=</span> <span class="bool-val">true</span>;
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Set a custom fee rate</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">fee_rate</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">fee_rate</span>: <span class="ident">FeeRate</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">fee_rate</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">fee_rate</span>);
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Set the policy path to use while creating the transaction</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This method accepts a map where the key is the policy node id (see</span>
+ <span class="doccomment">/// [`Policy::id`](crate::descriptor::Policy::id)) and the value is the list of the indexes of</span>
+ <span class="doccomment">/// the items that are intended to be satisfied from the policy node (see</span>
+ <span class="doccomment">/// [`SatisfiableItem::Thresh::items`](crate::descriptor::policy::SatisfiableItem::Thresh::items)).</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">policy_path</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">policy_path</span>: <span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">policy_path</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">policy_path</span>);
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Replace the internal list of utxos that **must** be spent with a new list</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// These have priority over the "unspendable" utxos, meaning that if a utxo is present both in</span>
+ <span class="doccomment">/// the "utxos" and the "unspendable" list, it will be spent.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">utxos</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">OutPoint</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">utxos</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">utxos</span>);
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Add a utxo to the internal list of utxos that **must** be spent</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// These have priority over the "unspendable" utxos, meaning that if a utxo is present both in</span>
+ <span class="doccomment">/// the "utxos" and the "unspendable" list, it will be spent.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">add_utxo</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">utxo</span>: <span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">utxos</span>.<span class="ident">get_or_insert</span>(<span class="macro">vec</span><span class="macro">!</span>[]).<span class="ident">push</span>(<span class="ident">utxo</span>);
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Replace the internal list of unspendable utxos with a new list</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// It's important to note that the "must-be-spent" utxos added with [`TxBuilder::utxos`] and</span>
+ <span class="doccomment">/// [`TxBuilder::add_utxo`] have priority over these. See the docs of the two linked methods</span>
+ <span class="doccomment">/// for more details.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">unspendable</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">unspendable</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">OutPoint</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">unspendable</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">unspendable</span>);
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Add a utxo to the internal list of unspendable utxos</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// It's important to note that the "must-be-spent" utxos added with [`TxBuilder::utxos`] and</span>
+ <span class="doccomment">/// [`TxBuilder::add_utxo`] have priority over this. See the docs of the two linked methods</span>
+ <span class="doccomment">/// for more details.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">add_unspendable</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">unspendable</span>: <span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">unspendable</span>.<span class="ident">get_or_insert</span>(<span class="macro">vec</span><span class="macro">!</span>[]).<span class="ident">push</span>(<span class="ident">unspendable</span>);
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Sign with a specific sig hash</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// **Use this option very carefully**</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">sighash</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">sighash</span>: <span class="ident">SigHashType</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">sighash</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">sighash</span>);
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Choose the ordering for inputs and outputs of the transaction</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">ordering</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">ordering</span>: <span class="ident">TxOrdering</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">ordering</span> <span class="op">=</span> <span class="ident">ordering</span>;
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Use a specific nLockTime while creating the transaction</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This can cause conflicts if the wallet's descriptors contain an "after" (OP_CLTV) operator.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">nlocktime</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">locktime</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">locktime</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">locktime</span>);
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Enable signaling RBF</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This will use the default nSequence value of `0xFFFFFFFD`.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">enable_rbf</span>(<span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">enable_rbf_with_sequence</span>(<span class="number">0xFFFFFFFD</span>)
+ }
+
+ <span class="doccomment">/// Enable signaling RBF with a specific nSequence value</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This can cause conflicts if the wallet's descriptors contain an "older" (OP_CSV) operator</span>
+ <span class="doccomment">/// and the given `nsequence` is lower than the CSV value.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// If the `nsequence` is higher than `0xFFFFFFFD` an error will be thrown, since it would not</span>
+ <span class="doccomment">/// be a valid nSequence to signal RBF.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">enable_rbf_with_sequence</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">nsequence</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">rbf</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">nsequence</span>);
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Build a transaction with a specific version</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// The `version` should always be greater than `0` and greater than `1` if the wallet's</span>
+ <span class="doccomment">/// descriptors contain an "older" (OP_CSV) operator.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">version</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">version</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">version</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">Version</span>(<span class="ident">version</span>));
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Do not spend change outputs</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This effectively adds all the change outputs to the "unspendable" list. See</span>
+ <span class="doccomment">/// [`TxBuilder::unspendable`].</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">do_not_spend_change</span>(<span class="kw-2">mut</span> <span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">change_policy</span> <span class="op">=</span> <span class="ident">ChangeSpendPolicy</span>::<span class="ident">ChangeForbidden</span>;
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Only spend change outputs</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This effectively adds all the non-change outputs to the "unspendable" list. See</span>
+ <span class="doccomment">/// [`TxBuilder::unspendable`].</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">only_spend_change</span>(<span class="kw-2">mut</span> <span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">change_policy</span> <span class="op">=</span> <span class="ident">ChangeSpendPolicy</span>::<span class="ident">OnlyChange</span>;
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Set a specific [`ChangeSpendPolicy`]. See [`TxBuilder::do_not_spend_change`] and</span>
+ <span class="doccomment">/// [`TxBuilder::only_spend_change`] for some shortcuts.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">change_policy</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">change_policy</span>: <span class="ident">ChangeSpendPolicy</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">change_policy</span> <span class="op">=</span> <span class="ident">change_policy</span>;
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Fill-in the [`psbt::Input::non_witness_utxo`](bitcoin::util::psbt::Input::non_witness_utxo) field even if the wallet only has SegWit</span>
+ <span class="doccomment">/// descriptors.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This is useful for signers which always require it, like Trezor hardware wallets.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">force_non_witness_utxo</span>(<span class="kw-2">mut</span> <span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">force_non_witness_utxo</span> <span class="op">=</span> <span class="bool-val">true</span>;
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Choose the coin selection algorithm</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// Overrides the [`DefaultCoinSelectionAlgorithm`](super::coin_selection::DefaultCoinSelectionAlgorithm).</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">coin_selection</span><span class="op"><</span><span class="ident">P</span>: <span class="ident">CoinSelectionAlgorithm</span><span class="op">></span>(<span class="self">self</span>, <span class="ident">coin_selection</span>: <span class="ident">P</span>) <span class="op">-</span><span class="op">></span> <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">P</span><span class="op">></span> {
+ <span class="ident">TxBuilder</span> {
+ <span class="ident">recipients</span>: <span class="self">self</span>.<span class="ident">recipients</span>,
+ <span class="ident">send_all</span>: <span class="self">self</span>.<span class="ident">send_all</span>,
+ <span class="ident">fee_rate</span>: <span class="self">self</span>.<span class="ident">fee_rate</span>,
+ <span class="ident">policy_path</span>: <span class="self">self</span>.<span class="ident">policy_path</span>,
+ <span class="ident">utxos</span>: <span class="self">self</span>.<span class="ident">utxos</span>,
+ <span class="ident">unspendable</span>: <span class="self">self</span>.<span class="ident">unspendable</span>,
+ <span class="ident">sighash</span>: <span class="self">self</span>.<span class="ident">sighash</span>,
+ <span class="ident">ordering</span>: <span class="self">self</span>.<span class="ident">ordering</span>,
+ <span class="ident">locktime</span>: <span class="self">self</span>.<span class="ident">locktime</span>,
+ <span class="ident">rbf</span>: <span class="self">self</span>.<span class="ident">rbf</span>,
+ <span class="ident">version</span>: <span class="self">self</span>.<span class="ident">version</span>,
+ <span class="ident">change_policy</span>: <span class="self">self</span>.<span class="ident">change_policy</span>,
+ <span class="ident">force_non_witness_utxo</span>: <span class="self">self</span>.<span class="ident">force_non_witness_utxo</span>,
+ <span class="ident">coin_selection</span>,
+ }
+ }
+}
+
+<span class="doccomment">/// Ordering of the transaction's inputs and outputs</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Ord</span>, <span class="ident">PartialOrd</span>, <span class="ident">Eq</span>, <span class="ident">PartialEq</span>, <span class="ident">Hash</span>, <span class="ident">Clone</span>, <span class="ident">Copy</span>)]</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">TxOrdering</span> {
+ <span class="doccomment">/// Randomized (default)</span>
+ <span class="ident">Shuffle</span>,
+ <span class="doccomment">/// Unchanged</span>
+ <span class="ident">Untouched</span>,
+ <span class="doccomment">/// BIP69 / Lexicographic</span>
+ <span class="ident">BIP69Lexicographic</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">Default</span> <span class="kw">for</span> <span class="ident">TxOrdering</span> {
+ <span class="kw">fn</span> <span class="ident">default</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">TxOrdering</span>::<span class="ident">Shuffle</span>
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">TxOrdering</span> {
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">sort_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">Transaction</span>) {
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">TxOrdering</span>::<span class="ident">Untouched</span> <span class="op">=</span><span class="op">></span> {}
+ <span class="ident">TxOrdering</span>::<span class="ident">Shuffle</span> <span class="op">=</span><span class="op">></span> {
+ <span class="kw">use</span> <span class="ident">rand</span>::<span class="ident">seq</span>::<span class="ident">SliceRandom</span>;
+ <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+ <span class="kw">use</span> <span class="ident">rand</span>::<span class="ident">SeedableRng</span>;
+
+ <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">not</span>(<span class="ident">test</span>))]</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">rng</span> <span class="op">=</span> <span class="ident">rand</span>::<span class="ident">thread_rng</span>();
+ <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">rng</span> <span class="op">=</span> <span class="ident">rand</span>::<span class="ident">rngs</span>::<span class="ident">StdRng</span>::<span class="ident">seed_from_u64</span>(<span class="number">0</span>);
+
+ <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">shuffle</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">rng</span>);
+ }
+ <span class="ident">TxOrdering</span>::<span class="ident">BIP69Lexicographic</span> <span class="op">=</span><span class="op">></span> {
+ <span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">sort_unstable_by_key</span>(<span class="op">|</span><span class="ident">txin</span><span class="op">|</span> {
+ (<span class="ident">txin</span>.<span class="ident">previous_output</span>.<span class="ident">txid</span>, <span class="ident">txin</span>.<span class="ident">previous_output</span>.<span class="ident">vout</span>)
+ });
+ <span class="ident">tx</span>.<span class="ident">output</span>
+ .<span class="ident">sort_unstable_by_key</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> (<span class="ident">txout</span>.<span class="ident">value</span>, <span class="ident">txout</span>.<span class="ident">script_pubkey</span>.<span class="ident">clone</span>()));
+ }
+ }
+ }
+}
+
+<span class="doccomment">/// Transaction version</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Has a default value of `1`</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Ord</span>, <span class="ident">PartialOrd</span>, <span class="ident">Eq</span>, <span class="ident">PartialEq</span>, <span class="ident">Hash</span>, <span class="ident">Clone</span>, <span class="ident">Copy</span>)]</span>
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">struct</span> <span class="ident">Version</span>(<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">u32</span>);
+
+<span class="kw">impl</span> <span class="ident">Default</span> <span class="kw">for</span> <span class="ident">Version</span> {
+ <span class="kw">fn</span> <span class="ident">default</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">Version</span>(<span class="number">1</span>)
+ }
+}
+
+<span class="doccomment">/// Policy regarding the use of change outputs when creating a transaction</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Ord</span>, <span class="ident">PartialOrd</span>, <span class="ident">Eq</span>, <span class="ident">PartialEq</span>, <span class="ident">Hash</span>, <span class="ident">Clone</span>, <span class="ident">Copy</span>)]</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">ChangeSpendPolicy</span> {
+ <span class="doccomment">/// Use both change and non-change outputs (default)</span>
+ <span class="ident">ChangeAllowed</span>,
+ <span class="doccomment">/// Only use change outputs (see [`TxBuilder::only_spend_change`])</span>
+ <span class="ident">OnlyChange</span>,
+ <span class="doccomment">/// Only use non-change outputs (see [`TxBuilder::do_not_spend_change`])</span>
+ <span class="ident">ChangeForbidden</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">Default</span> <span class="kw">for</span> <span class="ident">ChangeSpendPolicy</span> {
+ <span class="kw">fn</span> <span class="ident">default</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">ChangeSpendPolicy</span>::<span class="ident">ChangeAllowed</span>
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">ChangeSpendPolicy</span> {
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">filter_utxos</span><span class="op"><</span><span class="ident">I</span>: <span class="ident">Iterator</span><span class="op"><</span><span class="ident">Item</span> <span class="op">=</span> <span class="ident">UTXO</span><span class="op">></span><span class="op">></span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">iter</span>: <span class="ident">I</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span> {
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">ChangeSpendPolicy</span>::<span class="ident">ChangeAllowed</span> <span class="op">=</span><span class="op">></span> <span class="ident">iter</span>.<span class="ident">collect</span>(),
+ <span class="ident">ChangeSpendPolicy</span>::<span class="ident">OnlyChange</span> <span class="op">=</span><span class="op">></span> <span class="ident">iter</span>.<span class="ident">filter</span>(<span class="op">|</span><span class="ident">utxo</span><span class="op">|</span> <span class="ident">utxo</span>.<span class="ident">is_internal</span>).<span class="ident">collect</span>(),
+ <span class="ident">ChangeSpendPolicy</span>::<span class="ident">ChangeForbidden</span> <span class="op">=</span><span class="op">></span> <span class="ident">iter</span>.<span class="ident">filter</span>(<span class="op">|</span><span class="ident">utxo</span><span class="op">|</span> <span class="op">!</span><span class="ident">utxo</span>.<span class="ident">is_internal</span>).<span class="ident">collect</span>(),
+ }
+ }
+}
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="kw">mod</span> <span class="ident">test</span> {
+ <span class="kw">const</span> <span class="ident">ORDERING_TEST_TX</span>: <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span> <span class="op">=</span> <span class="string">"0200000003c26f3eb7932f7acddc5ddd26602b77e7516079b03090a16e2c2f54\
+ 85d1fd600f0100000000ffffffffc26f3eb7932f7acddc5ddd26602b77e75160\
+ 79b03090a16e2c2f5485d1fd600f0000000000ffffffff571fb3e02278217852\
+ dd5d299947e2b7354a639adc32ec1fa7b82cfb5dec530e0500000000ffffffff\
+ 03e80300000000000002aaeee80300000000000001aa200300000000000001ff\
+ 00000000"</span>;
+ <span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">ordering_test_tx</span> {
+ () <span class="op">=</span><span class="op">></span> {
+ <span class="ident">deserialize</span>::<span class="op"><</span><span class="ident">bitcoin</span>::<span class="ident">Transaction</span><span class="op">></span>(<span class="kw-2">&</span><span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="ident">ORDERING_TEST_TX</span>).<span class="ident">unwrap</span>())
+ .<span class="ident">unwrap</span>()
+ };
+ }
+
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">deserialize</span>;
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">FromHex</span>;
+
+ <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_output_ordering_default_shuffle</span>() {
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">TxOrdering</span>::<span class="ident">default</span>(), <span class="ident">TxOrdering</span>::<span class="ident">Shuffle</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_output_ordering_untouched</span>() {
+ <span class="kw">let</span> <span class="ident">original_tx</span> <span class="op">=</span> <span class="macro">ordering_test_tx</span><span class="macro">!</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">original_tx</span>.<span class="ident">clone</span>();
+
+ <span class="ident">TxOrdering</span>::<span class="ident">Untouched</span>.<span class="ident">sort_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>);
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">original_tx</span>, <span class="ident">tx</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_output_ordering_shuffle</span>() {
+ <span class="kw">let</span> <span class="ident">original_tx</span> <span class="op">=</span> <span class="macro">ordering_test_tx</span><span class="macro">!</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">original_tx</span>.<span class="ident">clone</span>();
+
+ <span class="ident">TxOrdering</span>::<span class="ident">Shuffle</span>.<span class="ident">sort_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>);
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">original_tx</span>.<span class="ident">input</span>, <span class="ident">tx</span>.<span class="ident">input</span>);
+ <span class="macro">assert_ne</span><span class="macro">!</span>(<span class="ident">original_tx</span>.<span class="ident">output</span>, <span class="ident">tx</span>.<span class="ident">output</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_output_ordering_bip69</span>() {
+ <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
+
+ <span class="kw">let</span> <span class="ident">original_tx</span> <span class="op">=</span> <span class="macro">ordering_test_tx</span><span class="macro">!</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">original_tx</span>.<span class="ident">clone</span>();
+
+ <span class="ident">TxOrdering</span>::<span class="ident">BIP69Lexicographic</span>.<span class="ident">sort_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>);
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tx</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">previous_output</span>,
+ <span class="ident">bitcoin</span>::<span class="ident">OutPoint</span>::<span class="ident">from_str</span>(
+ <span class="string">"0e53ec5dfb2cb8a71fec32dc9a634a35b7e24799295ddd5278217822e0b31f57:5"</span>
+ )
+ .<span class="ident">unwrap</span>()
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tx</span>.<span class="ident">input</span>[<span class="number">1</span>].<span class="ident">previous_output</span>,
+ <span class="ident">bitcoin</span>::<span class="ident">OutPoint</span>::<span class="ident">from_str</span>(
+ <span class="string">"0f60fdd185542f2c6ea19030b0796051e7772b6026dd5ddccd7a2f93b73e6fc2:0"</span>
+ )
+ .<span class="ident">unwrap</span>()
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">tx</span>.<span class="ident">input</span>[<span class="number">2</span>].<span class="ident">previous_output</span>,
+ <span class="ident">bitcoin</span>::<span class="ident">OutPoint</span>::<span class="ident">from_str</span>(
+ <span class="string">"0f60fdd185542f2c6ea19030b0796051e7772b6026dd5ddccd7a2f93b73e6fc2:1"</span>
+ )
+ .<span class="ident">unwrap</span>()
+ );
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>[<span class="number">0</span>].<span class="ident">value</span>, <span class="number">800</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>[<span class="number">1</span>].<span class="ident">script_pubkey</span>, <span class="ident">From</span>::<span class="ident">from</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="number">0xAA</span>]));
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>[<span class="number">2</span>].<span class="ident">script_pubkey</span>, <span class="ident">From</span>::<span class="ident">from</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="number">0xAA</span>, <span class="number">0xEE</span>]));
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_test_utxos</span>() <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span> {
+ <span class="macro">vec</span><span class="macro">!</span>[
+ <span class="ident">UTXO</span> {
+ <span class="ident">outpoint</span>: <span class="ident">OutPoint</span> {
+ <span class="ident">txid</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">vout</span>: <span class="number">0</span>,
+ },
+ <span class="ident">txout</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">is_internal</span>: <span class="bool-val">false</span>,
+ },
+ <span class="ident">UTXO</span> {
+ <span class="ident">outpoint</span>: <span class="ident">OutPoint</span> {
+ <span class="ident">txid</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">vout</span>: <span class="number">1</span>,
+ },
+ <span class="ident">txout</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">is_internal</span>: <span class="bool-val">true</span>,
+ },
+ ]
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_change_spend_policy_default</span>() {
+ <span class="kw">let</span> <span class="ident">change_spend_policy</span> <span class="op">=</span> <span class="ident">ChangeSpendPolicy</span>::<span class="ident">default</span>();
+ <span class="kw">let</span> <span class="ident">filtered</span> <span class="op">=</span> <span class="ident">change_spend_policy</span>.<span class="ident">filter_utxos</span>(<span class="ident">get_test_utxos</span>().<span class="ident">into_iter</span>());
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">filtered</span>.<span class="ident">len</span>(), <span class="number">2</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_change_spend_policy_no_internal</span>() {
+ <span class="kw">let</span> <span class="ident">change_spend_policy</span> <span class="op">=</span> <span class="ident">ChangeSpendPolicy</span>::<span class="ident">ChangeForbidden</span>;
+ <span class="kw">let</span> <span class="ident">filtered</span> <span class="op">=</span> <span class="ident">change_spend_policy</span>.<span class="ident">filter_utxos</span>(<span class="ident">get_test_utxos</span>().<span class="ident">into_iter</span>());
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">filtered</span>.<span class="ident">len</span>(), <span class="number">1</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">filtered</span>[<span class="number">0</span>].<span class="ident">is_internal</span>, <span class="bool-val">false</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_change_spend_policy_only_internal</span>() {
+ <span class="kw">let</span> <span class="ident">change_spend_policy</span> <span class="op">=</span> <span class="ident">ChangeSpendPolicy</span>::<span class="ident">OnlyChange</span>;
+ <span class="kw">let</span> <span class="ident">filtered</span> <span class="op">=</span> <span class="ident">change_spend_policy</span>.<span class="ident">filter_utxos</span>(<span class="ident">get_test_utxos</span>().<span class="ident">into_iter</span>());
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">filtered</span>.<span class="ident">len</span>(), <span class="number">1</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">filtered</span>[<span class="number">0</span>].<span class="ident">is_internal</span>, <span class="bool-val">true</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_default_tx_version_1</span>() {
+ <span class="kw">let</span> <span class="ident">version</span> <span class="op">=</span> <span class="ident">Version</span>::<span class="ident">default</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">version</span>.<span class="number">0</span>, <span class="number">1</span>);
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+<!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="Source to the Rust file `src/wallet/utils.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>utils.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../bdk/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
+<span id="2"> 2</span>
+<span id="3"> 3</span>
+<span id="4"> 4</span>
+<span id="5"> 5</span>
+<span id="6"> 6</span>
+<span id="7"> 7</span>
+<span id="8"> 8</span>
+<span id="9"> 9</span>
+<span id="10"> 10</span>
+<span id="11"> 11</span>
+<span id="12"> 12</span>
+<span id="13"> 13</span>
+<span id="14"> 14</span>
+<span id="15"> 15</span>
+<span id="16"> 16</span>
+<span id="17"> 17</span>
+<span id="18"> 18</span>
+<span id="19"> 19</span>
+<span id="20"> 20</span>
+<span id="21"> 21</span>
+<span id="22"> 22</span>
+<span id="23"> 23</span>
+<span id="24"> 24</span>
+<span id="25"> 25</span>
+<span id="26"> 26</span>
+<span id="27"> 27</span>
+<span id="28"> 28</span>
+<span id="29"> 29</span>
+<span id="30"> 30</span>
+<span id="31"> 31</span>
+<span id="32"> 32</span>
+<span id="33"> 33</span>
+<span id="34"> 34</span>
+<span id="35"> 35</span>
+<span id="36"> 36</span>
+<span id="37"> 37</span>
+<span id="38"> 38</span>
+<span id="39"> 39</span>
+<span id="40"> 40</span>
+<span id="41"> 41</span>
+<span id="42"> 42</span>
+<span id="43"> 43</span>
+<span id="44"> 44</span>
+<span id="45"> 45</span>
+<span id="46"> 46</span>
+<span id="47"> 47</span>
+<span id="48"> 48</span>
+<span id="49"> 49</span>
+<span id="50"> 50</span>
+<span id="51"> 51</span>
+<span id="52"> 52</span>
+<span id="53"> 53</span>
+<span id="54"> 54</span>
+<span id="55"> 55</span>
+<span id="56"> 56</span>
+<span id="57"> 57</span>
+<span id="58"> 58</span>
+<span id="59"> 59</span>
+<span id="60"> 60</span>
+<span id="61"> 61</span>
+<span id="62"> 62</span>
+<span id="63"> 63</span>
+<span id="64"> 64</span>
+<span id="65"> 65</span>
+<span id="66"> 66</span>
+<span id="67"> 67</span>
+<span id="68"> 68</span>
+<span id="69"> 69</span>
+<span id="70"> 70</span>
+<span id="71"> 71</span>
+<span id="72"> 72</span>
+<span id="73"> 73</span>
+<span id="74"> 74</span>
+<span id="75"> 75</span>
+<span id="76"> 76</span>
+<span id="77"> 77</span>
+<span id="78"> 78</span>
+<span id="79"> 79</span>
+<span id="80"> 80</span>
+<span id="81"> 81</span>
+<span id="82"> 82</span>
+<span id="83"> 83</span>
+<span id="84"> 84</span>
+<span id="85"> 85</span>
+<span id="86"> 86</span>
+<span id="87"> 87</span>
+<span id="88"> 88</span>
+<span id="89"> 89</span>
+<span id="90"> 90</span>
+<span id="91"> 91</span>
+<span id="92"> 92</span>
+<span id="93"> 93</span>
+<span id="94"> 94</span>
+<span id="95"> 95</span>
+<span id="96"> 96</span>
+<span id="97"> 97</span>
+<span id="98"> 98</span>
+<span id="99"> 99</span>
+<span id="100">100</span>
+<span id="101">101</span>
+<span id="102">102</span>
+<span id="103">103</span>
+<span id="104">104</span>
+<span id="105">105</span>
+<span id="106">106</span>
+<span id="107">107</span>
+<span id="108">108</span>
+<span id="109">109</span>
+<span id="110">110</span>
+<span id="111">111</span>
+<span id="112">112</span>
+<span id="113">113</span>
+<span id="114">114</span>
+<span id="115">115</span>
+<span id="116">116</span>
+<span id="117">117</span>
+<span id="118">118</span>
+<span id="119">119</span>
+<span id="120">120</span>
+<span id="121">121</span>
+<span id="122">122</span>
+<span id="123">123</span>
+<span id="124">124</span>
+<span id="125">125</span>
+<span id="126">126</span>
+<span id="127">127</span>
+<span id="128">128</span>
+<span id="129">129</span>
+<span id="130">130</span>
+<span id="131">131</span>
+<span id="132">132</span>
+<span id="133">133</span>
+<span id="134">134</span>
+<span id="135">135</span>
+<span id="136">136</span>
+<span id="137">137</span>
+<span id="138">138</span>
+<span id="139">139</span>
+<span id="140">140</span>
+<span id="141">141</span>
+<span id="142">142</span>
+<span id="143">143</span>
+<span id="144">144</span>
+<span id="145">145</span>
+<span id="146">146</span>
+<span id="147">147</span>
+<span id="148">148</span>
+<span id="149">149</span>
+<span id="150">150</span>
+<span id="151">151</span>
+<span id="152">152</span>
+<span id="153">153</span>
+<span id="154">154</span>
+</pre><div class="example-wrap"><pre class="rust ">
+<span class="comment">// Magical Bitcoin Library</span>
+<span class="comment">// Written in 2020 by</span>
+<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
+<span class="comment">//</span>
+<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
+<span class="comment">//</span>
+<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
+<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
+<span class="comment">// in the Software without restriction, including without limitation the rights</span>
+<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
+<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
+<span class="comment">// furnished to do so, subject to the following conditions:</span>
+<span class="comment">//</span>
+<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
+<span class="comment">// copies or substantial portions of the Software.</span>
+<span class="comment">//</span>
+<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
+<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
+<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
+<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
+<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
+<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
+<span class="comment">// SOFTWARE.</span>
+
+<span class="kw">use</span> <span class="ident">miniscript</span>::{<span class="ident">MiniscriptKey</span>, <span class="ident">Satisfier</span>};
+
+<span class="comment">// De-facto standard "dust limit" (even though it should change based on the output type)</span>
+<span class="kw">const</span> <span class="ident">DUST_LIMIT_SATOSHI</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">546</span>;
+
+<span class="doccomment">/// Trait to check if a value is below the dust limit</span>
+<span class="comment">// we implement this trait to make sure we don't mess up the comparison with off-by-one like a <</span>
+<span class="comment">// instead of a <= etc. The constant value for the dust limit is not public on purpose, to</span>
+<span class="comment">// encourage the usage of this trait.</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">IsDust</span> {
+ <span class="doccomment">/// Check whether or not a value is below dust limit</span>
+ <span class="kw">fn</span> <span class="ident">is_dust</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span>;
+}
+
+<span class="kw">impl</span> <span class="ident">IsDust</span> <span class="kw">for</span> <span class="ident">u64</span> {
+ <span class="kw">fn</span> <span class="ident">is_dust</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="kw-2">*</span><span class="self">self</span> <span class="op"><</span><span class="op">=</span> <span class="ident">DUST_LIMIT_SATOSHI</span>
+ }
+}
+
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">After</span> {
+ <span class="kw">pub</span> <span class="ident">current_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+ <span class="kw">pub</span> <span class="ident">assume_height_reached</span>: <span class="ident">bool</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">After</span> {
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">current_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>, <span class="ident">assume_height_reached</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="ident">After</span> {
+ <span class="ident">After</span> {
+ <span class="ident">current_height</span>,
+ <span class="ident">assume_height_reached</span>,
+ }
+ }
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> <span class="ident">Satisfier</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span> <span class="kw">for</span> <span class="ident">After</span> {
+ <span class="kw">fn</span> <span class="ident">check_after</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">n</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">current_height</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">current_height</span> {
+ <span class="ident">current_height</span> <span class="op">></span><span class="op">=</span> <span class="ident">n</span>
+ } <span class="kw">else</span> {
+ <span class="self">self</span>.<span class="ident">assume_height_reached</span>
+ }
+ }
+}
+
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Older</span> {
+ <span class="kw">pub</span> <span class="ident">current_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+ <span class="kw">pub</span> <span class="ident">create_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+ <span class="kw">pub</span> <span class="ident">assume_height_reached</span>: <span class="ident">bool</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">Older</span> {
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">new</span>(
+ <span class="ident">current_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+ <span class="ident">create_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
+ <span class="ident">assume_height_reached</span>: <span class="ident">bool</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="ident">Older</span> {
+ <span class="ident">Older</span> {
+ <span class="ident">current_height</span>,
+ <span class="ident">create_height</span>,
+ <span class="ident">assume_height_reached</span>,
+ }
+ }
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> <span class="ident">Satisfier</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span> <span class="kw">for</span> <span class="ident">Older</span> {
+ <span class="kw">fn</span> <span class="ident">check_older</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">n</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">current_height</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">current_height</span> {
+ <span class="comment">// TODO: test >= / ></span>
+ <span class="ident">current_height</span> <span class="kw">as</span> <span class="ident">u64</span> <span class="op">></span><span class="op">=</span> <span class="self">self</span>.<span class="ident">create_height</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>) <span class="kw">as</span> <span class="ident">u64</span> <span class="op">+</span> <span class="ident">n</span> <span class="kw">as</span> <span class="ident">u64</span>
+ } <span class="kw">else</span> {
+ <span class="self">self</span>.<span class="ident">assume_height_reached</span>
+ }
+ }
+}
+
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">ChunksIterator</span><span class="op"><</span><span class="ident">I</span>: <span class="ident">Iterator</span><span class="op">></span> {
+ <span class="ident">iter</span>: <span class="ident">I</span>,
+ <span class="ident">size</span>: <span class="ident">usize</span>,
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">I</span>: <span class="ident">Iterator</span><span class="op">></span> <span class="ident">ChunksIterator</span><span class="op"><</span><span class="ident">I</span><span class="op">></span> {
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">iter</span>: <span class="ident">I</span>, <span class="ident">size</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">ChunksIterator</span> { <span class="ident">iter</span>, <span class="ident">size</span> }
+ }
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">I</span>: <span class="ident">Iterator</span><span class="op">></span> <span class="ident">Iterator</span> <span class="kw">for</span> <span class="ident">ChunksIterator</span><span class="op"><</span><span class="ident">I</span><span class="op">></span> {
+ <span class="kw">type</span> <span class="ident">Item</span> <span class="op">=</span> <span class="ident">Vec</span><span class="op"><</span><span class="op"><</span><span class="ident">I</span> <span class="kw">as</span> <span class="ident">std</span>::<span class="ident">iter</span>::<span class="ident">Iterator</span><span class="op">></span>::<span class="ident">Item</span><span class="op">></span>;
+
+ <span class="kw">fn</span> <span class="ident">next</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="self">Self</span>::<span class="ident">Item</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">v</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
+ <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="self">self</span>.<span class="ident">size</span> {
+ <span class="kw">let</span> <span class="ident">e</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">iter</span>.<span class="ident">next</span>();
+
+ <span class="kw">match</span> <span class="ident">e</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">break</span>,
+ <span class="prelude-val">Some</span>(<span class="ident">val</span>) <span class="op">=</span><span class="op">></span> <span class="ident">v</span>.<span class="ident">push</span>(<span class="ident">val</span>),
+ }
+ }
+
+ <span class="kw">if</span> <span class="ident">v</span>.<span class="ident">is_empty</span>() {
+ <span class="kw">return</span> <span class="prelude-val">None</span>;
+ }
+
+ <span class="prelude-val">Some</span>(<span class="ident">v</span>)
+ }
+}
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="kw">mod</span> <span class="ident">test</span> {
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">FeeRate</span>;
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_fee_from_btc_per_kb</span>() {
+ <span class="kw">let</span> <span class="ident">fee</span> <span class="op">=</span> <span class="ident">FeeRate</span>::<span class="ident">from_btc_per_kvb</span>(<span class="number">1e-5</span>);
+ <span class="macro">assert</span><span class="macro">!</span>((<span class="ident">fee</span>.<span class="ident">as_sat_vb</span>() <span class="op">-</span> <span class="number">1.0</span>).<span class="ident">abs</span>() <span class="op"><</span> <span class="number">0.0001</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_fee_from_sats_vbyte</span>() {
+ <span class="kw">let</span> <span class="ident">fee</span> <span class="op">=</span> <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">1.0</span>);
+ <span class="macro">assert</span><span class="macro">!</span>((<span class="ident">fee</span>.<span class="ident">as_sat_vb</span>() <span class="op">-</span> <span class="number">1.0</span>).<span class="ident">abs</span>() <span class="op"><</span> <span class="number">0.0001</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_fee_default_min_relay_fee</span>() {
+ <span class="kw">let</span> <span class="ident">fee</span> <span class="op">=</span> <span class="ident">FeeRate</span>::<span class="ident">default_min_relay_fee</span>();
+ <span class="macro">assert</span><span class="macro">!</span>((<span class="ident">fee</span>.<span class="ident">as_sat_vb</span>() <span class="op">-</span> <span class="number">1.0</span>).<span class="ident">abs</span>() <span class="op"><</span> <span class="number">0.0001</span>);
+ }
+}
+</pre></div>
+</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "bdk";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+var resourcesSuffix="";var currentTheme=document.getElementById("themeStyle");var mainTheme=document.getElementById("mainThemeStyle");var savedHref=[];function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(!elem||!elem.classList){return}elem.classList.add(className)}function removeClass(elem,className){if(!elem||!elem.classList){return}elem.classList.remove(className)}function onEach(arr,func,reversed){if(arr&&arr.length>0&&func){var length=arr.length;var i;if(reversed!==true){for(i=0;i<length;++i){if(func(arr[i])===true){return true}}}else{for(i=length-1;i>=0;--i){if(func(arr[i])===true){return true}}}}return false}function onEachLazy(lazyArray,func,reversed){return onEach(Array.prototype.slice.call(lazyArray),func,reversed)}function hasOwnProperty(obj,property){return Object.prototype.hasOwnProperty.call(obj,property)}function usableLocalStorage(){if(typeof Storage==="undefined"){return false}try{return window.localStorage!==null&&window.localStorage!==undefined}catch(err){return false}}function updateLocalStorage(name,value){if(usableLocalStorage()){localStorage[name]=value}else{}}function getCurrentValue(name){if(usableLocalStorage()&&localStorage[name]!==undefined){return localStorage[name]}return null}function switchTheme(styleElem,mainStyleElem,newTheme,saveTheme){var fullBasicCss="rustdoc"+resourcesSuffix+".css";var fullNewTheme=newTheme+resourcesSuffix+".css";var newHref=mainStyleElem.href.replace(fullBasicCss,fullNewTheme);if(styleElem.href===newHref){return}var found=false;if(savedHref.length===0){onEachLazy(document.getElementsByTagName("link"),function(el){savedHref.push(el.href)})}onEach(savedHref,function(el){if(el===newHref){found=true;return true}});if(found===true){styleElem.href=newHref;if(saveTheme===true){updateLocalStorage("rustdoc-theme",newTheme)}}}function getSystemValue(){var property=getComputedStyle(document.documentElement).getPropertyValue('content');return property.replace(/[\"\']/g,"")}switchTheme(currentTheme,mainTheme,getCurrentValue("rustdoc-theme")||getSystemValue()||"light",false)
\ No newline at end of file
--- /dev/null
+var themes=document.getElementById("theme-choices");var themePicker=document.getElementById("theme-picker");function showThemeButtonState(){themes.style.display="block";themePicker.style.borderBottomRightRadius="0";themePicker.style.borderBottomLeftRadius="0"}function hideThemeButtonState(){themes.style.display="none";themePicker.style.borderBottomRightRadius="3px";themePicker.style.borderBottomLeftRadius="3px"}function switchThemeButtonState(){if(themes.style.display==="block"){hideThemeButtonState()}else{showThemeButtonState()}};function handleThemeButtonsBlur(e){var active=document.activeElement;var related=e.relatedTarget;if(active.id!=="themePicker"&&(!active.parentNode||active.parentNode.id!=="theme-choices")&&(!related||(related.id!=="themePicker"&&(!related.parentNode||related.parentNode.id!=="theme-choices")))){hideThemeButtonState()}}themePicker.onclick=switchThemeButtonState;themePicker.onblur=handleThemeButtonsBlur;["dark","light"].forEach(function(item){var but=document.createElement('button');but.textContent=item;but.onclick=function(el){switchTheme(currentTheme,mainTheme,item,true)};but.onblur=handleThemeButtonsBlur;themes.appendChild(but)})
\ No newline at end of file
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Capa_1" width="27.434" height="29.5" enable-background="new 0 0 27.434 29.5" version="1.1" viewBox="0 0 27.434 29.5" xml:space="preserve"><g><path d="M27.315,18.389c-0.165-0.604-0.509-1.113-0.981-1.459c-0.042-0.144-0.083-0.429-0.015-0.761l0.037-0.177v-0.182V14.8 c0-1.247-0.006-1.277-0.048-1.472c-0.076-0.354-0.035-0.653,0.007-0.803c0.477-0.346,0.828-0.861,0.996-1.476 c0.261-0.956,0.076-2.091-0.508-3.114l-0.591-1.032c-0.746-1.307-1.965-2.119-3.182-2.119c-0.378,0-0.75,0.081-1.085,0.235 c-0.198-0.025-0.554-0.15-0.855-0.389l-0.103-0.082l-0.114-0.065l-1.857-1.067L18.92,3.36l-0.105-0.044 c-0.376-0.154-0.658-0.41-0.768-0.556C17.918,1.172,16.349,0,14.296,0H13.14c-2.043,0-3.608,1.154-3.749,2.721 C9.277,2.862,8.999,3.104,8.633,3.25l-0.1,0.039L8.439,3.341L6.495,4.406L6.363,4.479L6.245,4.573 C5.936,4.82,5.596,4.944,5.416,4.977c-0.314-0.139-0.66-0.21-1.011-0.21c-1.198,0-2.411,0.819-3.165,2.139L0.65,7.938 c-0.412,0.72-0.642,1.521-0.644,2.258c-0.003,0.952,0.362,1.756,1.013,2.256c0.034,0.155,0.061,0.448-0.016,0.786 c-0.038,0.168-0.062,0.28-0.062,1.563c0,1.148,0,1.148,0.015,1.262l0.009,0.073l0.017,0.073c0.073,0.346,0.045,0.643,0.011,0.802 C0.348,17.512-0.01,18.314,0,19.268c0.008,0.729,0.238,1.523,0.648,2.242l0.589,1.031c0.761,1.331,1.967,2.159,3.15,2.159 c0.324,0,0.645-0.064,0.938-0.187c0.167,0.038,0.492,0.156,0.813,0.416l0.11,0.088l0.124,0.07l2.045,1.156l0.102,0.057l0.107,0.043 c0.364,0.147,0.646,0.381,0.766,0.521c0.164,1.52,1.719,2.634,3.745,2.634h1.155c2.037,0,3.598-1.134,3.747-2.675 c0.117-0.145,0.401-0.393,0.774-0.549l0.111-0.047l0.105-0.062l1.96-1.159l0.105-0.062l0.097-0.075 c0.309-0.246,0.651-0.371,0.832-0.402c0.313,0.138,0.662,0.212,1.016,0.212c1.199,0,2.412-0.82,3.166-2.139l0.59-1.032 C27.387,20.48,27.575,19.342,27.315,18.389z M25.274,20.635l-0.59,1.032c-0.438,0.765-1.104,1.251-1.639,1.251 c-0.133,0-0.258-0.029-0.369-0.094c-0.15-0.086-0.346-0.127-0.566-0.127c-0.596,0-1.383,0.295-2.01,0.796l-1.96,1.157 c-1.016,0.425-1.846,1.291-1.846,1.929s-0.898,1.159-1.998,1.159H13.14c-1.1,0-1.998-0.514-1.998-1.141s-0.834-1.477-1.854-1.888 l-2.046-1.157c-0.636-0.511-1.425-0.814-2.006-0.814c-0.202,0-0.379,0.037-0.516,0.115c-0.101,0.057-0.214,0.084-0.333,0.084 c-0.518,0-1.179-0.498-1.62-1.271l-0.591-1.032c-0.545-0.954-0.556-1.983-0.024-2.286c0.532-0.305,0.78-1.432,0.551-2.506 c0,0,0-0.003,0-1.042c0-1.088,0.021-1.18,0.021-1.18c0.238-1.072-0.01-2.203-0.552-2.513C1.631,10.8,1.634,9.765,2.18,8.812 L2.769,7.78c0.438-0.766,1.103-1.251,1.636-1.251c0.131,0,0.255,0.029,0.365,0.092C4.92,6.707,5.114,6.747,5.334,6.747 c0.596,0,1.38-0.296,2.007-0.795l1.944-1.065c1.021-0.407,1.856-1.277,1.856-1.933c0-0.656,0.898-1.192,1.998-1.192h1.156V1.761 c1.1,0,1.998,0.545,1.998,1.211c0,0.667,0.832,1.554,1.849,1.973L20,6.013c0.618,0.489,1.401,0.775,2.012,0.775 c0.24,0,0.454-0.045,0.62-0.139c0.122-0.069,0.259-0.102,0.403-0.102c0.551,0,1.221,0.476,1.653,1.231l0.59,1.032 c0.544,0.953,0.518,2.004-0.062,2.334c-0.577,0.331-0.859,1.48-0.627,2.554c0,0,0.01,0.042,0.01,1.103c0,1.012,0,1.012,0,1.012 c-0.218,1.049,0.068,2.174,0.636,2.498C25.802,18.635,25.819,19.68,25.274,20.635z"/><path d="M13.61,7.611c-3.913,0-7.084,3.173-7.084,7.085c0,3.914,3.171,7.085,7.084,7.085s7.085-3.172,7.085-7.085 C20.695,10.784,17.523,7.611,13.61,7.611z M13.61,20.02c-2.936,0-5.323-2.388-5.323-5.323c0-2.935,2.388-5.323,5.323-5.323 s5.324,2.388,5.324,5.323C18.934,17.632,16.546,20.02,13.61,20.02z"/><path d="M13.682,9.908c-2.602,0-4.718,2.116-4.718,4.718c0,2.601,2.116,4.716,4.718,4.716c2.601,0,4.717-2.115,4.717-4.716 C18.399,12.024,16.283,9.908,13.682,9.908z M13.682,17.581c-1.633,0-2.956-1.323-2.956-2.955s1.323-2.956,2.956-2.956 c1.632,0,2.956,1.324,2.956,2.956S15.314,17.581,13.682,17.581z"/></g></svg>
\ No newline at end of file
--- /dev/null
+<html>
+ <head>
+ <title>Redirect</title>
+ <meta http-equiv="refresh" content="0;URL=0.1.0-beta.1/bdk">
+ </head>
+ <body>
+ <p>
+ You are being re-directed to the latest version.<br>
+ If that doesn't happen <a href="0.1.0-beta.1/bdk">click here</a>.
+ </p>
+ </body>
+</html>
+++ /dev/null
-These documentation pages include resources by third parties. This copyright
-file applies only to those resources. The following third party resources are
-included, and carry their own copyright notices and license terms:
-
-* Fira Sans (FiraSans-Regular.woff, FiraSans-Medium.woff):
-
- Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
- with Reserved Font Name Fira Sans.
-
- Copyright (c) 2014, Telefonica S.A.
-
- Licensed under the SIL Open Font License, Version 1.1.
- See FiraSans-LICENSE.txt.
-
-* rustdoc.css, main.js, and playpen.js:
-
- Copyright 2015 The Rust Developers.
- Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or
- the MIT license (LICENSE-MIT.txt) at your option.
-
-* normalize.css:
-
- Copyright (c) Nicolas Gallagher and Jonathan Neal.
- Licensed under the MIT license (see LICENSE-MIT.txt).
-
-* Source Code Pro (SourceCodePro-Regular.woff, SourceCodePro-Semibold.woff):
-
- Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
- with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark
- of Adobe Systems Incorporated in the United States and/or other countries.
-
- Licensed under the SIL Open Font License, Version 1.1.
- See SourceCodePro-LICENSE.txt.
-
-* Source Serif Pro (SourceSerifPro-Regular.ttf.woff,
- SourceSerifPro-Bold.ttf.woff, SourceSerifPro-It.ttf.woff):
-
- Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/), with
- Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of
- Adobe Systems Incorporated in the United States and/or other countries.
-
- Licensed under the SIL Open Font License, Version 1.1.
- See SourceSerifPro-LICENSE.txt.
-
-This copyright file is intended to be distributed with rustdoc output.
+++ /dev/null
-Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A.
-with Reserved Font Name < Fira >,
-
-This Font Software is licensed under the SIL Open Font License, Version 1.1.
-This license is copied below, and is also available with a FAQ at:
-http://scripts.sil.org/OFL
-
-
------------------------------------------------------------
-SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
------------------------------------------------------------
-
-PREAMBLE
-The goals of the Open Font License (OFL) are to stimulate worldwide
-development of collaborative font projects, to support the font creation
-efforts of academic and linguistic communities, and to provide a free and
-open framework in which fonts may be shared and improved in partnership
-with others.
-
-The OFL allows the licensed fonts to be used, studied, modified and
-redistributed freely as long as they are not sold by themselves. The
-fonts, including any derivative works, can be bundled, embedded,
-redistributed and/or sold with any software provided that any reserved
-names are not used by derivative works. The fonts and derivatives,
-however, cannot be released under any other type of license. The
-requirement for fonts to remain under this license does not apply
-to any document created using the fonts or their derivatives.
-
-DEFINITIONS
-"Font Software" refers to the set of files released by the Copyright
-Holder(s) under this license and clearly marked as such. This may
-include source files, build scripts and documentation.
-
-"Reserved Font Name" refers to any names specified as such after the
-copyright statement(s).
-
-"Original Version" refers to the collection of Font Software components as
-distributed by the Copyright Holder(s).
-
-"Modified Version" refers to any derivative made by adding to, deleting,
-or substituting -- in part or in whole -- any of the components of the
-Original Version, by changing formats or by porting the Font Software to a
-new environment.
-
-"Author" refers to any designer, engineer, programmer, technical
-writer or other person who contributed to the Font Software.
-
-PERMISSION & CONDITIONS
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of the Font Software, to use, study, copy, merge, embed, modify,
-redistribute, and sell modified and unmodified copies of the Font
-Software, subject to the following conditions:
-
-1) Neither the Font Software nor any of its individual components,
-in Original or Modified Versions, may be sold by itself.
-
-2) Original or Modified Versions of the Font Software may be bundled,
-redistributed and/or sold with any software, provided that each copy
-contains the above copyright notice and this license. These can be
-included either as stand-alone text files, human-readable headers or
-in the appropriate machine-readable metadata fields within text or
-binary files as long as those fields can be easily viewed by the user.
-
-3) No Modified Version of the Font Software may use the Reserved Font
-Name(s) unless explicit written permission is granted by the corresponding
-Copyright Holder. This restriction only applies to the primary font name as
-presented to the users.
-
-4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
-Software shall not be used to promote, endorse or advertise any
-Modified Version, except to acknowledge the contribution(s) of the
-Copyright Holder(s) and the Author(s) or with their explicit written
-permission.
-
-5) The Font Software, modified or unmodified, in part or in whole,
-must be distributed entirely under this license, and must not be
-distributed under any other license. The requirement for fonts to
-remain under this license does not apply to any document created
-using the Font Software.
-
-TERMINATION
-This license becomes null and void if any of the above conditions are
-not met.
-
-DISCLAIMER
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
-OTHER DEALINGS IN THE FONT SOFTWARE.
+++ /dev/null
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
-Copyright [yyyy] [name of copyright owner]
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
+++ /dev/null
-Permission is hereby granted, free of charge, to any
-person obtaining a copy of this software and associated
-documentation files (the "Software"), to deal in the
-Software without restriction, including without
-limitation the rights to use, copy, modify, merge,
-publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software
-is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice
-shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
-ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
+++ /dev/null
-Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
-
-This Font Software is licensed under the SIL Open Font License, Version 1.1.
-
-This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-
-
------------------------------------------------------------
-SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
------------------------------------------------------------
-
-PREAMBLE
-The goals of the Open Font License (OFL) are to stimulate worldwide
-development of collaborative font projects, to support the font creation
-efforts of academic and linguistic communities, and to provide a free and
-open framework in which fonts may be shared and improved in partnership
-with others.
-
-The OFL allows the licensed fonts to be used, studied, modified and
-redistributed freely as long as they are not sold by themselves. The
-fonts, including any derivative works, can be bundled, embedded,
-redistributed and/or sold with any software provided that any reserved
-names are not used by derivative works. The fonts and derivatives,
-however, cannot be released under any other type of license. The
-requirement for fonts to remain under this license does not apply
-to any document created using the fonts or their derivatives.
-
-DEFINITIONS
-"Font Software" refers to the set of files released by the Copyright
-Holder(s) under this license and clearly marked as such. This may
-include source files, build scripts and documentation.
-
-"Reserved Font Name" refers to any names specified as such after the
-copyright statement(s).
-
-"Original Version" refers to the collection of Font Software components as
-distributed by the Copyright Holder(s).
-
-"Modified Version" refers to any derivative made by adding to, deleting,
-or substituting -- in part or in whole -- any of the components of the
-Original Version, by changing formats or by porting the Font Software to a
-new environment.
-
-"Author" refers to any designer, engineer, programmer, technical
-writer or other person who contributed to the Font Software.
-
-PERMISSION & CONDITIONS
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of the Font Software, to use, study, copy, merge, embed, modify,
-redistribute, and sell modified and unmodified copies of the Font
-Software, subject to the following conditions:
-
-1) Neither the Font Software nor any of its individual components,
-in Original or Modified Versions, may be sold by itself.
-
-2) Original or Modified Versions of the Font Software may be bundled,
-redistributed and/or sold with any software, provided that each copy
-contains the above copyright notice and this license. These can be
-included either as stand-alone text files, human-readable headers or
-in the appropriate machine-readable metadata fields within text or
-binary files as long as those fields can be easily viewed by the user.
-
-3) No Modified Version of the Font Software may use the Reserved Font
-Name(s) unless explicit written permission is granted by the corresponding
-Copyright Holder. This restriction only applies to the primary font name as
-presented to the users.
-
-4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
-Software shall not be used to promote, endorse or advertise any
-Modified Version, except to acknowledge the contribution(s) of the
-Copyright Holder(s) and the Author(s) or with their explicit written
-permission.
-
-5) The Font Software, modified or unmodified, in part or in whole,
-must be distributed entirely under this license, and must not be
-distributed under any other license. The requirement for fonts to
-remain under this license does not apply to any document created
-using the Font Software.
-
-TERMINATION
-This license becomes null and void if any of the above conditions are
-not met.
-
-DISCLAIMER
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
-OTHER DEALINGS IN THE FONT SOFTWARE.
+++ /dev/null
-Copyright 2014-2018 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries.
-
-This Font Software is licensed under the SIL Open Font License, Version 1.1.
-
-This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-
-
------------------------------------------------------------
-SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
------------------------------------------------------------
-
-PREAMBLE
-The goals of the Open Font License (OFL) are to stimulate worldwide
-development of collaborative font projects, to support the font creation
-efforts of academic and linguistic communities, and to provide a free and
-open framework in which fonts may be shared and improved in partnership
-with others.
-
-The OFL allows the licensed fonts to be used, studied, modified and
-redistributed freely as long as they are not sold by themselves. The
-fonts, including any derivative works, can be bundled, embedded,
-redistributed and/or sold with any software provided that any reserved
-names are not used by derivative works. The fonts and derivatives,
-however, cannot be released under any other type of license. The
-requirement for fonts to remain under this license does not apply
-to any document created using the fonts or their derivatives.
-
-DEFINITIONS
-"Font Software" refers to the set of files released by the Copyright
-Holder(s) under this license and clearly marked as such. This may
-include source files, build scripts and documentation.
-
-"Reserved Font Name" refers to any names specified as such after the
-copyright statement(s).
-
-"Original Version" refers to the collection of Font Software components as
-distributed by the Copyright Holder(s).
-
-"Modified Version" refers to any derivative made by adding to, deleting,
-or substituting -- in part or in whole -- any of the components of the
-Original Version, by changing formats or by porting the Font Software to a
-new environment.
-
-"Author" refers to any designer, engineer, programmer, technical
-writer or other person who contributed to the Font Software.
-
-PERMISSION & CONDITIONS
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of the Font Software, to use, study, copy, merge, embed, modify,
-redistribute, and sell modified and unmodified copies of the Font
-Software, subject to the following conditions:
-
-1) Neither the Font Software nor any of its individual components,
-in Original or Modified Versions, may be sold by itself.
-
-2) Original or Modified Versions of the Font Software may be bundled,
-redistributed and/or sold with any software, provided that each copy
-contains the above copyright notice and this license. These can be
-included either as stand-alone text files, human-readable headers or
-in the appropriate machine-readable metadata fields within text or
-binary files as long as those fields can be easily viewed by the user.
-
-3) No Modified Version of the Font Software may use the Reserved Font
-Name(s) unless explicit written permission is granted by the corresponding
-Copyright Holder. This restriction only applies to the primary font name as
-presented to the users.
-
-4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
-Software shall not be used to promote, endorse or advertise any
-Modified Version, except to acknowledge the contribution(s) of the
-Copyright Holder(s) and the Author(s) or with their explicit written
-permission.
-
-5) The Font Software, modified or unmodified, in part or in whole,
-must be distributed entirely under this license, and must not be
-distributed under any other license. The requirement for fonts to
-remain under this license does not apply to any document created
-using the Font Software.
-
-TERMINATION
-This license becomes null and void if any of the above conditions are
-not met.
-
-DISCLAIMER
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
-OTHER DEALINGS IN THE FONT SOFTWARE.
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" width="1792" height="1792" viewBox="0 0 1792 1792"><path d="M1615 0q70 0 122.5 46.5t52.5 116.5q0 63-45 151-332 629-465 752-97 91-218 91-126 0-216.5-92.5t-90.5-219.5q0-128 92-212l638-579q59-54 130-54zm-909 1034q39 76 106.5 130t150.5 76l1 71q4 213-129.5 347t-348.5 134q-123 0-218-46.5t-152.5-127.5-86.5-183-29-220q7 5 41 30t62 44.5 59 36.5 46 17q41 0 55-37 25-66 57.5-112.5t69.5-76 88-47.5 103-25.5 125-10.5z"/></svg>
\ No newline at end of file
+++ /dev/null
-body{background-color:#353535;color:#ddd;}h1,h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){color:#ddd;}h1.fqn{border-bottom-color:#d2d2d2;}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){border-bottom-color:#d2d2d2;}.in-band{background-color:#353535;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#2A2A2A;}pre{background-color:#2A2A2A;}.sidebar{background-color:#505050;}*{scrollbar-color:rgb(64,65,67) #717171;}.sidebar{scrollbar-color:rgba(32,34,37,.6) transparent;}::-webkit-scrollbar-track{background-color:#717171;}::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar::-webkit-scrollbar-track{background-color:#717171;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar .current{background-color:#333;}.source .sidebar{background-color:#353535;}.sidebar .location{border-color:#fff;background:#575757;color:#DDD;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#444;}.line-numbers span{color:#3B91E2;}.line-numbers .line-highlighted{background-color:#0a042f !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom-color:#DDD;}.docblock table,.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#ddd;}.content .highlighted{color:#eee !important;background-color:#616161;}.content .highlighted a,.content .highlighted span{color:#eee !important;}.content .highlighted.trait{background-color:#013191;}.content .highlighted.traitalias{background-color:#013191;}.content .highlighted.mod,.content .highlighted.externcrate{background-color:#afc6e4;}.content .highlighted.mod{background-color:#803a1b;}.content .highlighted.externcrate{background-color:#396bac;}.content .highlighted.enum{background-color:#5b4e68;}.content .highlighted.struct{background-color:#194e9f;}.content .highlighted.union{background-color:#b7bd49;}.content .highlighted.fn,.content .highlighted.method,.content .highlighted.tymethod{background-color:#4950ed;}.content .highlighted.type{background-color:#38902c;}.content .highlighted.foreigntype{background-color:#b200d6;}.content .highlighted.attr,.content .highlighted.derive,.content .highlighted.macro{background-color:#217d1c;}.content .highlighted.constant,.content .highlighted.static{background-color:#0063cc;}.content .highlighted.primitive{background-color:#00708a;}.content .highlighted.keyword{background-color:#884719;}.content .stability::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#82b089;}.content span.struct,.content a.struct,.block a.current.struct{color:#2dbfb8;}.content span.type,.content a.type,.block a.current.type{color:#ff7f00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#dd7de8;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#09bd00;}.content span.union,.content a.union,.block a.current.union{color:#a6ae37;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#82a5c9;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#43aec7;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#bda000;}.content span.trait,.content a.trait,.block a.current.trait{color:#b78cf2;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#b397da;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#2BAB63;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}pre.rust .comment{color:#8d8d8b;}pre.rust .doccomment{color:#8ca375;}nav:not(.sidebar){border-bottom-color:#4e4e4e;}nav.main .current{border-top-color:#eee;border-bottom-color:#eee;}nav.main .separator{border-color:#eee;}a{color:#ddd;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.stability a{color:#D2991D;}.stab.internal a{color:#304FFE;}a.test-arrow{color:#dedede;}.collapse-toggle{color:#999;}#crate-search{color:#111;background-color:#f0f0f0;border-color:#000;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input{color:#111;background-color:#f0f0f0;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input:focus{border-color:#008dfd;}.search-focus:disabled{background-color:#c5c4c4;}#crate-search+.search-input:focus{box-shadow:0 0 8px 4px #078dd8;}.module-item .stab{color:#ddd;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;color:#2f2f2f;}.stab.internal{background:#FFB9B3;border-color:#B71C1C;color:#2f2f2f;}.stab.deprecated{background:#F3DFFF;border-color:#7F0087;color:#2f2f2f;}.stab.portability{background:#C4ECFF;border-color:#7BA5DB;color:#2f2f2f;}.stab.portability>code{color:#ddd;}#help>div{background:#4d4d4d;border-color:#bfbfbf;}#help dt{border-color:#bfbfbf;background:rgba(0,0,0,0);color:black;}.since{color:grey;}tr.result span.primitive::after,tr.result span.keyword::after{color:#ddd;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#ab8ac1;}pre.rust .kw-2,pre.rust .prelude-ty{color:#769acb;}pre.rust .number,pre.rust .string{color:#83a300;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#ee6868;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#d97f26;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#4a4949;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label{color:#999;}:target>code,:target>.in-band{background-color:#494a3d;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.8);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.8);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.8);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.8);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip .tooltiptext{background-color:#000;color:#fff;border-color:#000;}.tooltip .tooltiptext::after{border-color:transparent black transparent transparent;}#titles>div:not(.selected){background-color:#252525;border-top-color:#252525;}#titles>div:hover,#titles>div.selected{border-top-color:#0089ff;}#titles>div>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#505050;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#505050;border-right-color:#000;}#sidebar-filler{background-color:#505050;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu{border-color:#e0e0e0;background:#f0f0f0;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus{border-color:#ffb900;}#theme-choices{border-color:#e0e0e0;background-color:#353535;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#4e4e4e;}@media (max-width:700px){#theme-picker{background:#f0f0f0;}}#all-types{background-color:#505050;}#all-types:hover{background-color:#606060;}.search-results td span.alias{color:#fff;}.search-results td span.grey{color:#ccc;}#sidebar-toggle{background-color:#565656;}#sidebar-toggle:hover{background-color:#676767;}#source-sidebar{background-color:#565656;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#444;}div.files>.selected{background-color:#333;}.setting-line>.title{border-bottom-color:#ddd;}
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Layer_1" width="128" height="128" enable-background="new 0 0 128 128" version="1.1" viewBox="-30 -20 176 176" xml:space="preserve"><g><line x1="111" x2="64" y1="40.5" y2="87.499" fill="none" stroke="#2F3435" stroke-linecap="square" stroke-miterlimit="10" stroke-width="12"/><line x1="64" x2="17" y1="87.499" y2="40.5" fill="none" stroke="#2F3435" stroke-linecap="square" stroke-miterlimit="10" stroke-width="12"/></g></svg>
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html\" title=\"trait alloc::string::ToString\">ToString</a> for <a class=\"struct\" href=\"magical/wallet/export/struct.WalletExport.html\" title=\"struct magical::wallet::export::WalletExport\">WalletExport</a>","synthetic":false,"types":["magical::wallet::export::WalletExport"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"magical/blockchain/enum.Capability.html\" title=\"enum magical::blockchain::Capability\">Capability</a>","synthetic":false,"types":["magical::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"magical/blockchain/struct.NoopProgress.html\" title=\"struct magical::blockchain::NoopProgress\">NoopProgress</a>","synthetic":false,"types":["magical::blockchain::NoopProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"magical/blockchain/struct.LogProgress.html\" title=\"struct magical::blockchain::LogProgress\">LogProgress</a>","synthetic":false,"types":["magical::blockchain::LogProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.PKOrF.html\" title=\"struct magical::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":false,"types":["magical::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum magical::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":false,"types":["magical::descriptor::policy::SatisfiableItem"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.Satisfaction.html\" title=\"enum magical::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":false,"types":["magical::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Policy.html\" title=\"struct magical::descriptor::policy::Policy\">Policy</a>","synthetic":false,"types":["magical::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["magical::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>","synthetic":false,"types":["magical::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"magical/struct.FeeRate.html\" title=\"struct magical::FeeRate\">FeeRate</a>","synthetic":false,"types":["magical::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"magical/struct.UTXO.html\" title=\"struct magical::UTXO\">UTXO</a>","synthetic":false,"types":["magical::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"magical/struct.TransactionDetails.html\" title=\"struct magical::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["magical::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"magical/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum magical::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":false,"types":["magical::wallet::address_validator::AddressValidatorError"]},{"text":"impl<Pk: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> + <a class=\"trait\" href=\"magical/descriptor/trait.MiniscriptKey.html\" title=\"trait magical::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerId.html\" title=\"enum magical::wallet::signer::SignerId\">SignerId</a><Pk>","synthetic":false,"types":["magical::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerError.html\" title=\"enum magical::wallet::signer::SignerError\">SignerError</a>","synthetic":false,"types":["magical::wallet::signer::SignerError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignerOrdering.html\" title=\"struct magical::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["magical::wallet::signer::SignerOrdering"]},{"text":"impl<Pk: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> + <a class=\"trait\" href=\"magical/descriptor/trait.MiniscriptKey.html\" title=\"trait magical::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignersContainer.html\" title=\"struct magical::wallet::signer::SignersContainer\">SignersContainer</a><Pk>","synthetic":false,"types":["magical::wallet::signer::SignersContainer"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["magical::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["magical::wallet::tx_builder::ChangeSpendPolicy"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"enum\" href=\"magical/blockchain/enum.Capability.html\" title=\"enum magical::blockchain::Capability\">Capability</a>","synthetic":false,"types":["magical::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["magical::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>","synthetic":false,"types":["magical::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"struct\" href=\"magical/struct.UTXO.html\" title=\"struct magical::UTXO\">UTXO</a>","synthetic":false,"types":["magical::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"struct\" href=\"magical/struct.TransactionDetails.html\" title=\"struct magical::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["magical::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"enum\" href=\"magical/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum magical::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":false,"types":["magical::wallet::address_validator::AddressValidatorError"]},{"text":"impl<Pk: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> + <a class=\"trait\" href=\"magical/descriptor/trait.MiniscriptKey.html\" title=\"trait magical::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerId.html\" title=\"enum magical::wallet::signer::SignerId\">SignerId</a><Pk>","synthetic":false,"types":["magical::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerError.html\" title=\"enum magical::wallet::signer::SignerError\">SignerError</a>","synthetic":false,"types":["magical::wallet::signer::SignerError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignerOrdering.html\" title=\"struct magical::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["magical::wallet::signer::SignerOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["magical::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["magical::wallet::tx_builder::ChangeSpendPolicy"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html\" title=\"trait core::cmp::Ord\">Ord</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["magical::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html\" title=\"trait core::cmp::Ord\">Ord</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignerOrdering.html\" title=\"struct magical::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["magical::wallet::signer::SignerOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html\" title=\"trait core::cmp::Ord\">Ord</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["magical::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html\" title=\"trait core::cmp::Ord\">Ord</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["magical::wallet::tx_builder::ChangeSpendPolicy"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"enum\" href=\"magical/blockchain/enum.Capability.html\" title=\"enum magical::blockchain::Capability\">Capability</a>> for <a class=\"enum\" href=\"magical/blockchain/enum.Capability.html\" title=\"enum magical::blockchain::Capability\">Capability</a>","synthetic":false,"types":["magical::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["magical::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>> for <a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>","synthetic":false,"types":["magical::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"struct\" href=\"magical/struct.FeeRate.html\" title=\"struct magical::FeeRate\">FeeRate</a>> for <a class=\"struct\" href=\"magical/struct.FeeRate.html\" title=\"struct magical::FeeRate\">FeeRate</a>","synthetic":false,"types":["magical::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"struct\" href=\"magical/struct.UTXO.html\" title=\"struct magical::UTXO\">UTXO</a>> for <a class=\"struct\" href=\"magical/struct.UTXO.html\" title=\"struct magical::UTXO\">UTXO</a>","synthetic":false,"types":["magical::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"struct\" href=\"magical/struct.TransactionDetails.html\" title=\"struct magical::TransactionDetails\">TransactionDetails</a>> for <a class=\"struct\" href=\"magical/struct.TransactionDetails.html\" title=\"struct magical::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["magical::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"enum\" href=\"magical/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum magical::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>> for <a class=\"enum\" href=\"magical/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum magical::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":false,"types":["magical::wallet::address_validator::AddressValidatorError"]},{"text":"impl<Pk: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a> + <a class=\"trait\" href=\"magical/descriptor/trait.MiniscriptKey.html\" title=\"trait magical::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"enum\" href=\"magical/wallet/signer/enum.SignerId.html\" title=\"enum magical::wallet::signer::SignerId\">SignerId</a><Pk>> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerId.html\" title=\"enum magical::wallet::signer::SignerId\">SignerId</a><Pk>","synthetic":false,"types":["magical::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"enum\" href=\"magical/wallet/signer/enum.SignerError.html\" title=\"enum magical::wallet::signer::SignerError\">SignerError</a>> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerError.html\" title=\"enum magical::wallet::signer::SignerError\">SignerError</a>","synthetic":false,"types":["magical::wallet::signer::SignerError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"struct\" href=\"magical/wallet/signer/struct.SignerOrdering.html\" title=\"struct magical::wallet::signer::SignerOrdering\">SignerOrdering</a>> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignerOrdering.html\" title=\"struct magical::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["magical::wallet::signer::SignerOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["magical::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["magical::wallet::tx_builder::ChangeSpendPolicy"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html\" title=\"trait core::cmp::PartialOrd\">PartialOrd</a><<a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["magical::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html\" title=\"trait core::cmp::PartialOrd\">PartialOrd</a><<a class=\"struct\" href=\"magical/struct.FeeRate.html\" title=\"struct magical::FeeRate\">FeeRate</a>> for <a class=\"struct\" href=\"magical/struct.FeeRate.html\" title=\"struct magical::FeeRate\">FeeRate</a>","synthetic":false,"types":["magical::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html\" title=\"trait core::cmp::PartialOrd\">PartialOrd</a><<a class=\"struct\" href=\"magical/wallet/signer/struct.SignerOrdering.html\" title=\"struct magical::wallet::signer::SignerOrdering\">SignerOrdering</a>> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignerOrdering.html\" title=\"struct magical::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["magical::wallet::signer::SignerOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html\" title=\"trait core::cmp::PartialOrd\">PartialOrd</a><<a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["magical::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html\" title=\"trait core::cmp::PartialOrd\">PartialOrd</a><<a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["magical::wallet::tx_builder::ChangeSpendPolicy"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html\" title=\"trait core::convert::AsRef\">AsRef</a><<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.slice.html\">[</a><a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a><a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.slice.html\">]</a>> for <a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>","synthetic":false,"types":["magical::types::ScriptType"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"magical/descriptor/error/enum.Error.html\" title=\"enum magical::descriptor::error::Error\">Error</a>> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"magical/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum magical::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"magical/descriptor/policy/enum.PolicyError.html\" title=\"enum magical::descriptor::policy::PolicyError\">PolicyError</a>> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"magical/wallet/signer/enum.SignerError.html\" title=\"enum magical::wallet::signer::SignerError\">SignerError</a>> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"struct\" href=\"https://docs.rs/serde_json/1.0.57/serde_json/error/struct.Error.html\" title=\"struct serde_json::error::Error\">Error</a>> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"magical/blockchain/esplora/enum.EsploraError.html\" title=\"enum magical::blockchain::esplora::EsploraError\">EsploraError</a>> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"magical/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum magical::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Client> for <a class=\"struct\" href=\"magical/blockchain/electrum/struct.ElectrumBlockchain.html\" title=\"struct magical::blockchain::electrum::ElectrumBlockchain\">ElectrumBlockchain</a>","synthetic":false,"types":["magical::blockchain::electrum::ElectrumBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"struct\" href=\"https://docs.rs/reqwest/0.10.7/reqwest/error/struct.Error.html\" title=\"struct reqwest::error::Error\">Error</a>> for <a class=\"enum\" href=\"magical/blockchain/esplora/enum.EsploraError.html\" title=\"enum magical::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":false,"types":["magical::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/core/num/struct.ParseIntError.html\" title=\"struct core::num::ParseIntError\">ParseIntError</a>> for <a class=\"enum\" href=\"magical/blockchain/esplora/enum.EsploraError.html\" title=\"enum magical::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":false,"types":["magical::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"magical/blockchain/esplora/enum.EsploraError.html\" title=\"enum magical::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":false,"types":["magical::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"magical/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum magical::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":false,"types":["magical::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html\" title=\"struct std::io::error::Error\">Error</a>> for <a class=\"enum\" href=\"magical/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum magical::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":false,"types":["magical::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"magical/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum magical::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":false,"types":["magical::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/std/time/struct.SystemTimeError.html\" title=\"struct std::time::SystemTimeError\">SystemTimeError</a>> for <a class=\"enum\" href=\"magical/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum magical::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":false,"types":["magical::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>> for <a class=\"enum\" href=\"magical/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum magical::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":false,"types":["magical::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"magical/descriptor/error/enum.Error.html\" title=\"enum magical::descriptor::error::Error\">Error</a>","synthetic":false,"types":["magical::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"magical/descriptor/error/enum.Error.html\" title=\"enum magical::descriptor::error::Error\">Error</a>","synthetic":false,"types":["magical::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"magical/descriptor/error/enum.Error.html\" title=\"enum magical::descriptor::error::Error\">Error</a>","synthetic":false,"types":["magical::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"magical/descriptor/error/enum.Error.html\" title=\"enum magical::descriptor::error::Error\">Error</a>","synthetic":false,"types":["magical::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"magical/descriptor/error/enum.Error.html\" title=\"enum magical::descriptor::error::Error\">Error</a>","synthetic":false,"types":["magical::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"magical/descriptor/policy/enum.PolicyError.html\" title=\"enum magical::descriptor::policy::PolicyError\">PolicyError</a>> for <a class=\"enum\" href=\"magical/descriptor/error/enum.Error.html\" title=\"enum magical::descriptor::error::Error\">Error</a>","synthetic":false,"types":["magical::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.bool.html\">bool</a>> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.Satisfaction.html\" title=\"enum magical::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":false,"types":["magical::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"magical/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum magical::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Policy.html\" title=\"struct magical::descriptor::policy::Policy\">Policy</a>","synthetic":false,"types":["magical::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Hash> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerId.html\" title=\"enum magical::wallet::signer::SignerId\">SignerId</a><DescriptorPublicKey>","synthetic":false,"types":["magical::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Fingerprint> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerId.html\" title=\"enum magical::wallet::signer::SignerId\">SignerId</a><DescriptorPublicKey>","synthetic":false,"types":["magical::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html\" title=\"struct std::collections::hash::map::HashMap\">HashMap</a><DescriptorPublicKey, DescriptorSecretKey, <a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.RandomState.html\" title=\"struct std::collections::hash::map::RandomState\">RandomState</a>>> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignersContainer.html\" title=\"struct magical::wallet::signer::SignersContainer\">SignersContainer</a><DescriptorPublicKey>","synthetic":false,"types":["magical::wallet::signer::SignersContainer"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.Mempool.html\" title=\"struct magical::blockchain::compact_filters::Mempool\">Mempool</a>","synthetic":false,"types":["magical::blockchain::compact_filters::peer::Mempool"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"magical/database/memory/struct.MemoryDatabase.html\" title=\"struct magical::database::memory::MemoryDatabase\">MemoryDatabase</a>","synthetic":false,"types":["magical::database::memory::MemoryDatabase"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.PKOrF.html\" title=\"struct magical::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":false,"types":["magical::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["magical::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"magical/struct.FeeRate.html\" title=\"struct magical::FeeRate\">FeeRate</a>","synthetic":false,"types":["magical::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"magical/struct.TransactionDetails.html\" title=\"struct magical::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["magical::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"magical/wallet/coin_selection/struct.DumbCoinSelection.html\" title=\"struct magical::wallet::coin_selection::DumbCoinSelection\">DumbCoinSelection</a>","synthetic":false,"types":["magical::wallet::coin_selection::DumbCoinSelection"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignerOrdering.html\" title=\"struct magical::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["magical::wallet::signer::SignerOrdering"]},{"text":"impl<Pk: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> + <a class=\"trait\" href=\"magical/descriptor/trait.MiniscriptKey.html\" title=\"trait magical::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignersContainer.html\" title=\"struct magical::wallet::signer::SignersContainer\">SignersContainer</a><Pk>","synthetic":false,"types":["magical::wallet::signer::SignersContainer"]},{"text":"impl<Cs: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> + <a class=\"trait\" href=\"magical/wallet/coin_selection/trait.CoinSelectionAlgorithm.html\" title=\"trait magical::wallet::coin_selection::CoinSelectionAlgorithm\">CoinSelectionAlgorithm</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"magical/wallet/tx_builder/struct.TxBuilder.html\" title=\"struct magical::wallet::tx_builder::TxBuilder\">TxBuilder</a><Cs>","synthetic":false,"types":["magical::wallet::tx_builder::TxBuilder"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["magical::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["magical::wallet::tx_builder::ChangeSpendPolicy"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"magical/blockchain/esplora/struct.EsploraBlockchain.html\" title=\"struct magical::blockchain::esplora::EsploraBlockchain\">EsploraBlockchain</a>","synthetic":false,"types":["magical::blockchain::esplora::EsploraBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"magical/blockchain/esplora/enum.EsploraError.html\" title=\"enum magical::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":false,"types":["magical::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.Mempool.html\" title=\"struct magical::blockchain::compact_filters::Mempool\">Mempool</a>","synthetic":false,"types":["magical::blockchain::compact_filters::peer::Mempool"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.Peer.html\" title=\"struct magical::blockchain::compact_filters::Peer\">Peer</a>","synthetic":false,"types":["magical::blockchain::compact_filters::peer::Peer"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html\" title=\"struct magical::blockchain::compact_filters::CompactFiltersBlockchain\">CompactFiltersBlockchain</a>","synthetic":false,"types":["magical::blockchain::compact_filters::CompactFiltersBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"magical/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum magical::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":false,"types":["magical::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"magical/blockchain/enum.Capability.html\" title=\"enum magical::blockchain::Capability\">Capability</a>","synthetic":false,"types":["magical::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"magical/database/memory/struct.MemoryDatabase.html\" title=\"struct magical::database::memory::MemoryDatabase\">MemoryDatabase</a>","synthetic":false,"types":["magical::database::memory::MemoryDatabase"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"magical/descriptor/error/enum.Error.html\" title=\"enum magical::descriptor::error::Error\">Error</a>","synthetic":false,"types":["magical::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.PKOrF.html\" title=\"struct magical::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":false,"types":["magical::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum magical::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":false,"types":["magical::descriptor::policy::SatisfiableItem"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.Satisfaction.html\" title=\"enum magical::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":false,"types":["magical::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Policy.html\" title=\"struct magical::descriptor::policy::Policy\">Policy</a>","synthetic":false,"types":["magical::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["magical::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.PolicyError.html\" title=\"enum magical::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":false,"types":["magical::descriptor::policy::PolicyError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>","synthetic":false,"types":["magical::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"magical/struct.FeeRate.html\" title=\"struct magical::FeeRate\">FeeRate</a>","synthetic":false,"types":["magical::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"magical/struct.UTXO.html\" title=\"struct magical::UTXO\">UTXO</a>","synthetic":false,"types":["magical::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"magical/struct.TransactionDetails.html\" title=\"struct magical::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["magical::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"magical/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum magical::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":false,"types":["magical::wallet::address_validator::AddressValidatorError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"magical/wallet/coin_selection/struct.CoinSelectionResult.html\" title=\"struct magical::wallet::coin_selection::CoinSelectionResult\">CoinSelectionResult</a>","synthetic":false,"types":["magical::wallet::coin_selection::CoinSelectionResult"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"magical/wallet/coin_selection/struct.DumbCoinSelection.html\" title=\"struct magical::wallet::coin_selection::DumbCoinSelection\">DumbCoinSelection</a>","synthetic":false,"types":["magical::wallet::coin_selection::DumbCoinSelection"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"magical/wallet/export/struct.WalletExport.html\" title=\"struct magical::wallet::export::WalletExport\">WalletExport</a>","synthetic":false,"types":["magical::wallet::export::WalletExport"]},{"text":"impl<Pk: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> + <a class=\"trait\" href=\"magical/descriptor/trait.MiniscriptKey.html\" title=\"trait magical::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerId.html\" title=\"enum magical::wallet::signer::SignerId\">SignerId</a><Pk>","synthetic":false,"types":["magical::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerError.html\" title=\"enum magical::wallet::signer::SignerError\">SignerError</a>","synthetic":false,"types":["magical::wallet::signer::SignerError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignerOrdering.html\" title=\"struct magical::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["magical::wallet::signer::SignerOrdering"]},{"text":"impl<Pk: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> + <a class=\"trait\" href=\"magical/descriptor/trait.MiniscriptKey.html\" title=\"trait magical::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignersContainer.html\" title=\"struct magical::wallet::signer::SignersContainer\">SignersContainer</a><Pk>","synthetic":false,"types":["magical::wallet::signer::SignersContainer"]},{"text":"impl<Cs: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> + <a class=\"trait\" href=\"magical/wallet/coin_selection/trait.CoinSelectionAlgorithm.html\" title=\"trait magical::wallet::coin_selection::CoinSelectionAlgorithm\">CoinSelectionAlgorithm</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"magical/wallet/tx_builder/struct.TxBuilder.html\" title=\"struct magical::wallet::tx_builder::TxBuilder\">TxBuilder</a><Cs>","synthetic":false,"types":["magical::wallet::tx_builder::TxBuilder"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["magical::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["magical::wallet::tx_builder::ChangeSpendPolicy"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"magical/blockchain/esplora/enum.EsploraError.html\" title=\"enum magical::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":false,"types":["magical::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"magical/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum magical::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":false,"types":["magical::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"magical/descriptor/error/enum.Error.html\" title=\"enum magical::descriptor::error::Error\">Error</a>","synthetic":false,"types":["magical::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.PolicyError.html\" title=\"enum magical::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":false,"types":["magical::descriptor::policy::PolicyError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"magical/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum magical::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":false,"types":["magical::wallet::address_validator::AddressValidatorError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerError.html\" title=\"enum magical::wallet::signer::SignerError\">SignerError</a>","synthetic":false,"types":["magical::wallet::signer::SignerError"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a> for <a class=\"enum\" href=\"magical/blockchain/enum.Capability.html\" title=\"enum magical::blockchain::Capability\">Capability</a>","synthetic":false,"types":["magical::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["magical::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a> for <a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>","synthetic":false,"types":["magical::types::ScriptType"]},{"text":"impl<Pk: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a> + <a class=\"trait\" href=\"magical/descriptor/trait.MiniscriptKey.html\" title=\"trait magical::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerId.html\" title=\"enum magical::wallet::signer::SignerId\">SignerId</a><Pk>","synthetic":false,"types":["magical::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["magical::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["magical::wallet::tx_builder::ChangeSpendPolicy"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"magical/blockchain/enum.Capability.html\" title=\"enum magical::blockchain::Capability\">Capability</a>","synthetic":false,"types":["magical::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["magical::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>","synthetic":false,"types":["magical::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"struct\" href=\"magical/struct.FeeRate.html\" title=\"struct magical::FeeRate\">FeeRate</a>","synthetic":false,"types":["magical::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["magical::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["magical::wallet::tx_builder::ChangeSpendPolicy"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl Freeze for <a class=\"struct\" href=\"magical/struct.FeeRate.html\" title=\"struct magical::FeeRate\">FeeRate</a>","synthetic":true,"types":["magical::types::FeeRate"]},{"text":"impl Freeze for <a class=\"struct\" href=\"magical/struct.UTXO.html\" title=\"struct magical::UTXO\">UTXO</a>","synthetic":true,"types":["magical::types::UTXO"]},{"text":"impl Freeze for <a class=\"struct\" href=\"magical/struct.TransactionDetails.html\" title=\"struct magical::TransactionDetails\">TransactionDetails</a>","synthetic":true,"types":["magical::types::TransactionDetails"]},{"text":"impl Freeze for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":true,"types":["magical::error::Error"]},{"text":"impl Freeze for <a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>","synthetic":true,"types":["magical::types::ScriptType"]},{"text":"impl Freeze for <a class=\"struct\" href=\"magical/blockchain/struct.OfflineBlockchain.html\" title=\"struct magical::blockchain::OfflineBlockchain\">OfflineBlockchain</a>","synthetic":true,"types":["magical::blockchain::OfflineBlockchain"]},{"text":"impl Freeze for <a class=\"struct\" href=\"magical/blockchain/struct.NoopProgress.html\" title=\"struct magical::blockchain::NoopProgress\">NoopProgress</a>","synthetic":true,"types":["magical::blockchain::NoopProgress"]},{"text":"impl Freeze for <a class=\"struct\" href=\"magical/blockchain/struct.LogProgress.html\" title=\"struct magical::blockchain::LogProgress\">LogProgress</a>","synthetic":true,"types":["magical::blockchain::LogProgress"]},{"text":"impl Freeze for <a class=\"enum\" href=\"magical/blockchain/enum.Capability.html\" title=\"enum magical::blockchain::Capability\">Capability</a>","synthetic":true,"types":["magical::blockchain::Capability"]},{"text":"impl !Freeze for <a class=\"struct\" href=\"magical/blockchain/electrum/struct.ElectrumBlockchain.html\" title=\"struct magical::blockchain::electrum::ElectrumBlockchain\">ElectrumBlockchain</a>","synthetic":true,"types":["magical::blockchain::electrum::ElectrumBlockchain"]},{"text":"impl Freeze for <a class=\"struct\" href=\"magical/blockchain/esplora/struct.EsploraBlockchain.html\" title=\"struct magical::blockchain::esplora::EsploraBlockchain\">EsploraBlockchain</a>","synthetic":true,"types":["magical::blockchain::esplora::EsploraBlockchain"]},{"text":"impl Freeze for <a class=\"enum\" href=\"magical/blockchain/esplora/enum.EsploraError.html\" title=\"enum magical::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":true,"types":["magical::blockchain::esplora::EsploraError"]},{"text":"impl !Freeze for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.Mempool.html\" title=\"struct magical::blockchain::compact_filters::Mempool\">Mempool</a>","synthetic":true,"types":["magical::blockchain::compact_filters::peer::Mempool"]},{"text":"impl Freeze for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.Peer.html\" title=\"struct magical::blockchain::compact_filters::Peer\">Peer</a>","synthetic":true,"types":["magical::blockchain::compact_filters::peer::Peer"]},{"text":"impl Freeze for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html\" title=\"struct magical::blockchain::compact_filters::CompactFiltersBlockchain\">CompactFiltersBlockchain</a>","synthetic":true,"types":["magical::blockchain::compact_filters::CompactFiltersBlockchain"]},{"text":"impl Freeze for <a class=\"enum\" href=\"magical/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum magical::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":true,"types":["magical::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl Freeze for <a class=\"struct\" href=\"magical/database/memory/struct.MemoryDatabase.html\" title=\"struct magical::database::memory::MemoryDatabase\">MemoryDatabase</a>","synthetic":true,"types":["magical::database::memory::MemoryDatabase"]},{"text":"impl Freeze for <a class=\"enum\" href=\"magical/descriptor/error/enum.Error.html\" title=\"enum magical::descriptor::error::Error\">Error</a>","synthetic":true,"types":["magical::descriptor::error::Error"]},{"text":"impl Freeze for <a class=\"struct\" href=\"magical/descriptor/policy/struct.PKOrF.html\" title=\"struct magical::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":true,"types":["magical::descriptor::policy::PKOrF"]},{"text":"impl Freeze for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Policy.html\" title=\"struct magical::descriptor::policy::Policy\">Policy</a>","synthetic":true,"types":["magical::descriptor::policy::Policy"]},{"text":"impl Freeze for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":true,"types":["magical::descriptor::policy::Condition"]},{"text":"impl Freeze for <a class=\"enum\" href=\"magical/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum magical::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":true,"types":["magical::descriptor::policy::SatisfiableItem"]},{"text":"impl Freeze for <a class=\"enum\" href=\"magical/descriptor/policy/enum.Satisfaction.html\" title=\"enum magical::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":true,"types":["magical::descriptor::policy::Satisfaction"]},{"text":"impl Freeze for <a class=\"enum\" href=\"magical/descriptor/policy/enum.PolicyError.html\" title=\"enum magical::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":true,"types":["magical::descriptor::policy::PolicyError"]},{"text":"impl<B, D> !Freeze for <a class=\"struct\" href=\"magical/wallet/struct.Wallet.html\" title=\"struct magical::wallet::Wallet\">Wallet</a><B, D>","synthetic":true,"types":["magical::wallet::Wallet"]},{"text":"impl Freeze for <a class=\"enum\" href=\"magical/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum magical::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":true,"types":["magical::wallet::address_validator::AddressValidatorError"]},{"text":"impl Freeze for <a class=\"struct\" href=\"magical/wallet/coin_selection/struct.CoinSelectionResult.html\" title=\"struct magical::wallet::coin_selection::CoinSelectionResult\">CoinSelectionResult</a>","synthetic":true,"types":["magical::wallet::coin_selection::CoinSelectionResult"]},{"text":"impl Freeze for <a class=\"struct\" href=\"magical/wallet/coin_selection/struct.DumbCoinSelection.html\" title=\"struct magical::wallet::coin_selection::DumbCoinSelection\">DumbCoinSelection</a>","synthetic":true,"types":["magical::wallet::coin_selection::DumbCoinSelection"]},{"text":"impl Freeze for <a class=\"struct\" href=\"magical/wallet/export/struct.WalletExport.html\" title=\"struct magical::wallet::export::WalletExport\">WalletExport</a>","synthetic":true,"types":["magical::wallet::export::WalletExport"]},{"text":"impl Freeze for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignerOrdering.html\" title=\"struct magical::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":true,"types":["magical::wallet::signer::SignerOrdering"]},{"text":"impl<Pk> Freeze for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignersContainer.html\" title=\"struct magical::wallet::signer::SignersContainer\">SignersContainer</a><Pk>","synthetic":true,"types":["magical::wallet::signer::SignersContainer"]},{"text":"impl<Pk> Freeze for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerId.html\" title=\"enum magical::wallet::signer::SignerId\">SignerId</a><Pk> <span class=\"where fmt-newline\">where<br> <Pk as <a class=\"trait\" href=\"magical/descriptor/trait.MiniscriptKey.html\" title=\"trait magical::descriptor::MiniscriptKey\">MiniscriptKey</a>>::<a class=\"type\" href=\"magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash\" title=\"type magical::descriptor::MiniscriptKey::Hash\">Hash</a>: Freeze, </span>","synthetic":true,"types":["magical::wallet::signer::SignerId"]},{"text":"impl Freeze for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerError.html\" title=\"enum magical::wallet::signer::SignerError\">SignerError</a>","synthetic":true,"types":["magical::wallet::signer::SignerError"]},{"text":"impl<Cs> Freeze for <a class=\"struct\" href=\"magical/wallet/tx_builder/struct.TxBuilder.html\" title=\"struct magical::wallet::tx_builder::TxBuilder\">TxBuilder</a><Cs> <span class=\"where fmt-newline\">where<br> Cs: Freeze, </span>","synthetic":true,"types":["magical::wallet::tx_builder::TxBuilder"]},{"text":"impl Freeze for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":true,"types":["magical::wallet::tx_builder::TxOrdering"]},{"text":"impl Freeze for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":true,"types":["magical::wallet::tx_builder::ChangeSpendPolicy"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/struct.FeeRate.html\" title=\"struct magical::FeeRate\">FeeRate</a>","synthetic":true,"types":["magical::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/struct.UTXO.html\" title=\"struct magical::UTXO\">UTXO</a>","synthetic":true,"types":["magical::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/struct.TransactionDetails.html\" title=\"struct magical::TransactionDetails\">TransactionDetails</a>","synthetic":true,"types":["magical::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":true,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>","synthetic":true,"types":["magical::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/blockchain/struct.OfflineBlockchain.html\" title=\"struct magical::blockchain::OfflineBlockchain\">OfflineBlockchain</a>","synthetic":true,"types":["magical::blockchain::OfflineBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/blockchain/struct.NoopProgress.html\" title=\"struct magical::blockchain::NoopProgress\">NoopProgress</a>","synthetic":true,"types":["magical::blockchain::NoopProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/blockchain/struct.LogProgress.html\" title=\"struct magical::blockchain::LogProgress\">LogProgress</a>","synthetic":true,"types":["magical::blockchain::LogProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"magical/blockchain/enum.Capability.html\" title=\"enum magical::blockchain::Capability\">Capability</a>","synthetic":true,"types":["magical::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/blockchain/electrum/struct.ElectrumBlockchain.html\" title=\"struct magical::blockchain::electrum::ElectrumBlockchain\">ElectrumBlockchain</a>","synthetic":true,"types":["magical::blockchain::electrum::ElectrumBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/blockchain/esplora/struct.EsploraBlockchain.html\" title=\"struct magical::blockchain::esplora::EsploraBlockchain\">EsploraBlockchain</a>","synthetic":true,"types":["magical::blockchain::esplora::EsploraBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"magical/blockchain/esplora/enum.EsploraError.html\" title=\"enum magical::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":true,"types":["magical::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.Mempool.html\" title=\"struct magical::blockchain::compact_filters::Mempool\">Mempool</a>","synthetic":true,"types":["magical::blockchain::compact_filters::peer::Mempool"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.Peer.html\" title=\"struct magical::blockchain::compact_filters::Peer\">Peer</a>","synthetic":true,"types":["magical::blockchain::compact_filters::peer::Peer"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html\" title=\"struct magical::blockchain::compact_filters::CompactFiltersBlockchain\">CompactFiltersBlockchain</a>","synthetic":true,"types":["magical::blockchain::compact_filters::CompactFiltersBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"magical/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum magical::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":true,"types":["magical::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/database/memory/struct.MemoryDatabase.html\" title=\"struct magical::database::memory::MemoryDatabase\">MemoryDatabase</a>","synthetic":true,"types":["magical::database::memory::MemoryDatabase"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"magical/descriptor/error/enum.Error.html\" title=\"enum magical::descriptor::error::Error\">Error</a>","synthetic":true,"types":["magical::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.PKOrF.html\" title=\"struct magical::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":true,"types":["magical::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Policy.html\" title=\"struct magical::descriptor::policy::Policy\">Policy</a>","synthetic":true,"types":["magical::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":true,"types":["magical::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum magical::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":true,"types":["magical::descriptor::policy::SatisfiableItem"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.Satisfaction.html\" title=\"enum magical::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":true,"types":["magical::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.PolicyError.html\" title=\"enum magical::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":true,"types":["magical::descriptor::policy::PolicyError"]},{"text":"impl<B, D> !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/wallet/struct.Wallet.html\" title=\"struct magical::wallet::Wallet\">Wallet</a><B, D>","synthetic":true,"types":["magical::wallet::Wallet"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"magical/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum magical::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":true,"types":["magical::wallet::address_validator::AddressValidatorError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/wallet/coin_selection/struct.CoinSelectionResult.html\" title=\"struct magical::wallet::coin_selection::CoinSelectionResult\">CoinSelectionResult</a>","synthetic":true,"types":["magical::wallet::coin_selection::CoinSelectionResult"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/wallet/coin_selection/struct.DumbCoinSelection.html\" title=\"struct magical::wallet::coin_selection::DumbCoinSelection\">DumbCoinSelection</a>","synthetic":true,"types":["magical::wallet::coin_selection::DumbCoinSelection"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/wallet/export/struct.WalletExport.html\" title=\"struct magical::wallet::export::WalletExport\">WalletExport</a>","synthetic":true,"types":["magical::wallet::export::WalletExport"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignerOrdering.html\" title=\"struct magical::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":true,"types":["magical::wallet::signer::SignerOrdering"]},{"text":"impl<Pk> !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignersContainer.html\" title=\"struct magical::wallet::signer::SignersContainer\">SignersContainer</a><Pk>","synthetic":true,"types":["magical::wallet::signer::SignersContainer"]},{"text":"impl<Pk> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerId.html\" title=\"enum magical::wallet::signer::SignerId\">SignerId</a><Pk> <span class=\"where fmt-newline\">where<br> <Pk as <a class=\"trait\" href=\"magical/descriptor/trait.MiniscriptKey.html\" title=\"trait magical::descriptor::MiniscriptKey\">MiniscriptKey</a>>::<a class=\"type\" href=\"magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash\" title=\"type magical::descriptor::MiniscriptKey::Hash\">Hash</a>: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a>, </span>","synthetic":true,"types":["magical::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerError.html\" title=\"enum magical::wallet::signer::SignerError\">SignerError</a>","synthetic":true,"types":["magical::wallet::signer::SignerError"]},{"text":"impl<Cs> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"magical/wallet/tx_builder/struct.TxBuilder.html\" title=\"struct magical::wallet::tx_builder::TxBuilder\">TxBuilder</a><Cs> <span class=\"where fmt-newline\">where<br> Cs: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a>, </span>","synthetic":true,"types":["magical::wallet::tx_builder::TxBuilder"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":true,"types":["magical::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":true,"types":["magical::wallet::tx_builder::ChangeSpendPolicy"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"enum\" href=\"magical/blockchain/enum.Capability.html\" title=\"enum magical::blockchain::Capability\">Capability</a>","synthetic":false,"types":["magical::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["magical::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>","synthetic":false,"types":["magical::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"struct\" href=\"magical/struct.UTXO.html\" title=\"struct magical::UTXO\">UTXO</a>","synthetic":false,"types":["magical::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"struct\" href=\"magical/struct.TransactionDetails.html\" title=\"struct magical::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["magical::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"enum\" href=\"magical/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum magical::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":false,"types":["magical::wallet::address_validator::AddressValidatorError"]},{"text":"impl<Pk: <a class=\"trait\" href=\"magical/descriptor/trait.MiniscriptKey.html\" title=\"trait magical::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerId.html\" title=\"enum magical::wallet::signer::SignerId\">SignerId</a><Pk>","synthetic":false,"types":["magical::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerError.html\" title=\"enum magical::wallet::signer::SignerError\">SignerError</a>","synthetic":false,"types":["magical::wallet::signer::SignerError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignerOrdering.html\" title=\"struct magical::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["magical::wallet::signer::SignerOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["magical::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["magical::wallet::tx_builder::ChangeSpendPolicy"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"enum\" href=\"magical/blockchain/enum.Capability.html\" title=\"enum magical::blockchain::Capability\">Capability</a>","synthetic":false,"types":["magical::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["magical::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>","synthetic":false,"types":["magical::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"struct\" href=\"magical/struct.FeeRate.html\" title=\"struct magical::FeeRate\">FeeRate</a>","synthetic":false,"types":["magical::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"struct\" href=\"magical/struct.UTXO.html\" title=\"struct magical::UTXO\">UTXO</a>","synthetic":false,"types":["magical::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"struct\" href=\"magical/struct.TransactionDetails.html\" title=\"struct magical::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["magical::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"enum\" href=\"magical/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum magical::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":false,"types":["magical::wallet::address_validator::AddressValidatorError"]},{"text":"impl<Pk: <a class=\"trait\" href=\"magical/descriptor/trait.MiniscriptKey.html\" title=\"trait magical::descriptor::MiniscriptKey\">MiniscriptKey</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerId.html\" title=\"enum magical::wallet::signer::SignerId\">SignerId</a><Pk>","synthetic":false,"types":["magical::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerError.html\" title=\"enum magical::wallet::signer::SignerError\">SignerError</a>","synthetic":false,"types":["magical::wallet::signer::SignerError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignerOrdering.html\" title=\"struct magical::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":false,"types":["magical::wallet::signer::SignerOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":false,"types":["magical::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":false,"types":["magical::wallet::tx_builder::ChangeSpendPolicy"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/struct.FeeRate.html\" title=\"struct magical::FeeRate\">FeeRate</a>","synthetic":true,"types":["magical::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/struct.UTXO.html\" title=\"struct magical::UTXO\">UTXO</a>","synthetic":true,"types":["magical::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/struct.TransactionDetails.html\" title=\"struct magical::TransactionDetails\">TransactionDetails</a>","synthetic":true,"types":["magical::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":true,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>","synthetic":true,"types":["magical::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/blockchain/struct.OfflineBlockchain.html\" title=\"struct magical::blockchain::OfflineBlockchain\">OfflineBlockchain</a>","synthetic":true,"types":["magical::blockchain::OfflineBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/blockchain/struct.NoopProgress.html\" title=\"struct magical::blockchain::NoopProgress\">NoopProgress</a>","synthetic":true,"types":["magical::blockchain::NoopProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/blockchain/struct.LogProgress.html\" title=\"struct magical::blockchain::LogProgress\">LogProgress</a>","synthetic":true,"types":["magical::blockchain::LogProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"magical/blockchain/enum.Capability.html\" title=\"enum magical::blockchain::Capability\">Capability</a>","synthetic":true,"types":["magical::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/blockchain/electrum/struct.ElectrumBlockchain.html\" title=\"struct magical::blockchain::electrum::ElectrumBlockchain\">ElectrumBlockchain</a>","synthetic":true,"types":["magical::blockchain::electrum::ElectrumBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/blockchain/esplora/struct.EsploraBlockchain.html\" title=\"struct magical::blockchain::esplora::EsploraBlockchain\">EsploraBlockchain</a>","synthetic":true,"types":["magical::blockchain::esplora::EsploraBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"magical/blockchain/esplora/enum.EsploraError.html\" title=\"enum magical::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":true,"types":["magical::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.Mempool.html\" title=\"struct magical::blockchain::compact_filters::Mempool\">Mempool</a>","synthetic":true,"types":["magical::blockchain::compact_filters::peer::Mempool"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.Peer.html\" title=\"struct magical::blockchain::compact_filters::Peer\">Peer</a>","synthetic":true,"types":["magical::blockchain::compact_filters::peer::Peer"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html\" title=\"struct magical::blockchain::compact_filters::CompactFiltersBlockchain\">CompactFiltersBlockchain</a>","synthetic":true,"types":["magical::blockchain::compact_filters::CompactFiltersBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"magical/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum magical::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":true,"types":["magical::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/database/memory/struct.MemoryDatabase.html\" title=\"struct magical::database::memory::MemoryDatabase\">MemoryDatabase</a>","synthetic":true,"types":["magical::database::memory::MemoryDatabase"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"magical/descriptor/error/enum.Error.html\" title=\"enum magical::descriptor::error::Error\">Error</a>","synthetic":true,"types":["magical::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.PKOrF.html\" title=\"struct magical::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":true,"types":["magical::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Policy.html\" title=\"struct magical::descriptor::policy::Policy\">Policy</a>","synthetic":true,"types":["magical::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":true,"types":["magical::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum magical::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":true,"types":["magical::descriptor::policy::SatisfiableItem"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.Satisfaction.html\" title=\"enum magical::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":true,"types":["magical::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.PolicyError.html\" title=\"enum magical::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":true,"types":["magical::descriptor::policy::PolicyError"]},{"text":"impl<B, D> !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/wallet/struct.Wallet.html\" title=\"struct magical::wallet::Wallet\">Wallet</a><B, D>","synthetic":true,"types":["magical::wallet::Wallet"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"magical/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum magical::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":true,"types":["magical::wallet::address_validator::AddressValidatorError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/wallet/coin_selection/struct.CoinSelectionResult.html\" title=\"struct magical::wallet::coin_selection::CoinSelectionResult\">CoinSelectionResult</a>","synthetic":true,"types":["magical::wallet::coin_selection::CoinSelectionResult"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/wallet/coin_selection/struct.DumbCoinSelection.html\" title=\"struct magical::wallet::coin_selection::DumbCoinSelection\">DumbCoinSelection</a>","synthetic":true,"types":["magical::wallet::coin_selection::DumbCoinSelection"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/wallet/export/struct.WalletExport.html\" title=\"struct magical::wallet::export::WalletExport\">WalletExport</a>","synthetic":true,"types":["magical::wallet::export::WalletExport"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignerOrdering.html\" title=\"struct magical::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":true,"types":["magical::wallet::signer::SignerOrdering"]},{"text":"impl<Pk> !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignersContainer.html\" title=\"struct magical::wallet::signer::SignersContainer\">SignersContainer</a><Pk>","synthetic":true,"types":["magical::wallet::signer::SignersContainer"]},{"text":"impl<Pk> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerId.html\" title=\"enum magical::wallet::signer::SignerId\">SignerId</a><Pk> <span class=\"where fmt-newline\">where<br> <Pk as <a class=\"trait\" href=\"magical/descriptor/trait.MiniscriptKey.html\" title=\"trait magical::descriptor::MiniscriptKey\">MiniscriptKey</a>>::<a class=\"type\" href=\"magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash\" title=\"type magical::descriptor::MiniscriptKey::Hash\">Hash</a>: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a>, </span>","synthetic":true,"types":["magical::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerError.html\" title=\"enum magical::wallet::signer::SignerError\">SignerError</a>","synthetic":true,"types":["magical::wallet::signer::SignerError"]},{"text":"impl<Cs> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"magical/wallet/tx_builder/struct.TxBuilder.html\" title=\"struct magical::wallet::tx_builder::TxBuilder\">TxBuilder</a><Cs> <span class=\"where fmt-newline\">where<br> Cs: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a>, </span>","synthetic":true,"types":["magical::wallet::tx_builder::TxBuilder"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":true,"types":["magical::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":true,"types":["magical::wallet::tx_builder::ChangeSpendPolicy"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/struct.FeeRate.html\" title=\"struct magical::FeeRate\">FeeRate</a>","synthetic":true,"types":["magical::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/struct.UTXO.html\" title=\"struct magical::UTXO\">UTXO</a>","synthetic":true,"types":["magical::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/struct.TransactionDetails.html\" title=\"struct magical::TransactionDetails\">TransactionDetails</a>","synthetic":true,"types":["magical::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":true,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>","synthetic":true,"types":["magical::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/blockchain/struct.OfflineBlockchain.html\" title=\"struct magical::blockchain::OfflineBlockchain\">OfflineBlockchain</a>","synthetic":true,"types":["magical::blockchain::OfflineBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/blockchain/struct.NoopProgress.html\" title=\"struct magical::blockchain::NoopProgress\">NoopProgress</a>","synthetic":true,"types":["magical::blockchain::NoopProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/blockchain/struct.LogProgress.html\" title=\"struct magical::blockchain::LogProgress\">LogProgress</a>","synthetic":true,"types":["magical::blockchain::LogProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"magical/blockchain/enum.Capability.html\" title=\"enum magical::blockchain::Capability\">Capability</a>","synthetic":true,"types":["magical::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/blockchain/electrum/struct.ElectrumBlockchain.html\" title=\"struct magical::blockchain::electrum::ElectrumBlockchain\">ElectrumBlockchain</a>","synthetic":true,"types":["magical::blockchain::electrum::ElectrumBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/blockchain/esplora/struct.EsploraBlockchain.html\" title=\"struct magical::blockchain::esplora::EsploraBlockchain\">EsploraBlockchain</a>","synthetic":true,"types":["magical::blockchain::esplora::EsploraBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"magical/blockchain/esplora/enum.EsploraError.html\" title=\"enum magical::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":true,"types":["magical::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.Mempool.html\" title=\"struct magical::blockchain::compact_filters::Mempool\">Mempool</a>","synthetic":true,"types":["magical::blockchain::compact_filters::peer::Mempool"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.Peer.html\" title=\"struct magical::blockchain::compact_filters::Peer\">Peer</a>","synthetic":true,"types":["magical::blockchain::compact_filters::peer::Peer"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html\" title=\"struct magical::blockchain::compact_filters::CompactFiltersBlockchain\">CompactFiltersBlockchain</a>","synthetic":true,"types":["magical::blockchain::compact_filters::CompactFiltersBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"magical/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum magical::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":true,"types":["magical::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/database/memory/struct.MemoryDatabase.html\" title=\"struct magical::database::memory::MemoryDatabase\">MemoryDatabase</a>","synthetic":true,"types":["magical::database::memory::MemoryDatabase"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"magical/descriptor/error/enum.Error.html\" title=\"enum magical::descriptor::error::Error\">Error</a>","synthetic":true,"types":["magical::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.PKOrF.html\" title=\"struct magical::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":true,"types":["magical::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Policy.html\" title=\"struct magical::descriptor::policy::Policy\">Policy</a>","synthetic":true,"types":["magical::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":true,"types":["magical::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum magical::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":true,"types":["magical::descriptor::policy::SatisfiableItem"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.Satisfaction.html\" title=\"enum magical::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":true,"types":["magical::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.PolicyError.html\" title=\"enum magical::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":true,"types":["magical::descriptor::policy::PolicyError"]},{"text":"impl<B, D> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/wallet/struct.Wallet.html\" title=\"struct magical::wallet::Wallet\">Wallet</a><B, D> <span class=\"where fmt-newline\">where<br> B: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a>,<br> D: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a>, </span>","synthetic":true,"types":["magical::wallet::Wallet"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"magical/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum magical::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":true,"types":["magical::wallet::address_validator::AddressValidatorError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/wallet/coin_selection/struct.CoinSelectionResult.html\" title=\"struct magical::wallet::coin_selection::CoinSelectionResult\">CoinSelectionResult</a>","synthetic":true,"types":["magical::wallet::coin_selection::CoinSelectionResult"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/wallet/coin_selection/struct.DumbCoinSelection.html\" title=\"struct magical::wallet::coin_selection::DumbCoinSelection\">DumbCoinSelection</a>","synthetic":true,"types":["magical::wallet::coin_selection::DumbCoinSelection"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/wallet/export/struct.WalletExport.html\" title=\"struct magical::wallet::export::WalletExport\">WalletExport</a>","synthetic":true,"types":["magical::wallet::export::WalletExport"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignerOrdering.html\" title=\"struct magical::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":true,"types":["magical::wallet::signer::SignerOrdering"]},{"text":"impl<Pk> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignersContainer.html\" title=\"struct magical::wallet::signer::SignersContainer\">SignersContainer</a><Pk> <span class=\"where fmt-newline\">where<br> <Pk as <a class=\"trait\" href=\"magical/descriptor/trait.MiniscriptKey.html\" title=\"trait magical::descriptor::MiniscriptKey\">MiniscriptKey</a>>::<a class=\"type\" href=\"magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash\" title=\"type magical::descriptor::MiniscriptKey::Hash\">Hash</a>: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a>, </span>","synthetic":true,"types":["magical::wallet::signer::SignersContainer"]},{"text":"impl<Pk> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerId.html\" title=\"enum magical::wallet::signer::SignerId\">SignerId</a><Pk> <span class=\"where fmt-newline\">where<br> <Pk as <a class=\"trait\" href=\"magical/descriptor/trait.MiniscriptKey.html\" title=\"trait magical::descriptor::MiniscriptKey\">MiniscriptKey</a>>::<a class=\"type\" href=\"magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash\" title=\"type magical::descriptor::MiniscriptKey::Hash\">Hash</a>: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a>, </span>","synthetic":true,"types":["magical::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerError.html\" title=\"enum magical::wallet::signer::SignerError\">SignerError</a>","synthetic":true,"types":["magical::wallet::signer::SignerError"]},{"text":"impl<Cs> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"magical/wallet/tx_builder/struct.TxBuilder.html\" title=\"struct magical::wallet::tx_builder::TxBuilder\">TxBuilder</a><Cs> <span class=\"where fmt-newline\">where<br> Cs: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a>, </span>","synthetic":true,"types":["magical::wallet::tx_builder::TxBuilder"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":true,"types":["magical::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":true,"types":["magical::wallet::tx_builder::ChangeSpendPolicy"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html\" title=\"trait core::str::FromStr\">FromStr</a> for <a class=\"struct\" href=\"magical/wallet/export/struct.WalletExport.html\" title=\"struct magical::wallet::export::WalletExport\">WalletExport</a>","synthetic":false,"types":["magical::wallet::export::WalletExport"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl<'de> <a class=\"trait\" href=\"https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html\" title=\"trait serde::de::Deserialize\">Deserialize</a><'de> for <a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>","synthetic":false,"types":["magical::types::ScriptType"]},{"text":"impl<'de> <a class=\"trait\" href=\"https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html\" title=\"trait serde::de::Deserialize\">Deserialize</a><'de> for <a class=\"struct\" href=\"magical/struct.UTXO.html\" title=\"struct magical::UTXO\">UTXO</a>","synthetic":false,"types":["magical::types::UTXO"]},{"text":"impl<'de> <a class=\"trait\" href=\"https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html\" title=\"trait serde::de::Deserialize\">Deserialize</a><'de> for <a class=\"struct\" href=\"magical/struct.TransactionDetails.html\" title=\"struct magical::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["magical::types::TransactionDetails"]},{"text":"impl<'de> <a class=\"trait\" href=\"https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html\" title=\"trait serde::de::Deserialize\">Deserialize</a><'de> for <a class=\"struct\" href=\"magical/wallet/export/struct.WalletExport.html\" title=\"struct magical::wallet::export::WalletExport\">WalletExport</a>","synthetic":false,"types":["magical::wallet::export::WalletExport"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.PKOrF.html\" title=\"struct magical::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":false,"types":["magical::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum magical::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":false,"types":["magical::descriptor::policy::SatisfiableItem"]},{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.Satisfaction.html\" title=\"enum magical::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":false,"types":["magical::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Policy.html\" title=\"struct magical::descriptor::policy::Policy\">Policy</a>","synthetic":false,"types":["magical::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":false,"types":["magical::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>","synthetic":false,"types":["magical::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"struct\" href=\"magical/struct.UTXO.html\" title=\"struct magical::UTXO\">UTXO</a>","synthetic":false,"types":["magical::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"struct\" href=\"magical/struct.TransactionDetails.html\" title=\"struct magical::TransactionDetails\">TransactionDetails</a>","synthetic":false,"types":["magical::types::TransactionDetails"]},{"text":"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"struct\" href=\"magical/wallet/export/struct.WalletExport.html\" title=\"struct magical::wallet::export::WalletExport\">WalletExport</a>","synthetic":false,"types":["magical::wallet::export::WalletExport"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/error/trait.Error.html\" title=\"trait std::error::Error\">Error</a> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":false,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/error/trait.Error.html\" title=\"trait std::error::Error\">Error</a> for <a class=\"enum\" href=\"magical/blockchain/esplora/enum.EsploraError.html\" title=\"enum magical::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":false,"types":["magical::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/error/trait.Error.html\" title=\"trait std::error::Error\">Error</a> for <a class=\"enum\" href=\"magical/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum magical::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":false,"types":["magical::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/error/trait.Error.html\" title=\"trait std::error::Error\">Error</a> for <a class=\"enum\" href=\"magical/descriptor/error/enum.Error.html\" title=\"enum magical::descriptor::error::Error\">Error</a>","synthetic":false,"types":["magical::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/error/trait.Error.html\" title=\"trait std::error::Error\">Error</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.PolicyError.html\" title=\"enum magical::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":false,"types":["magical::descriptor::policy::PolicyError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/error/trait.Error.html\" title=\"trait std::error::Error\">Error</a> for <a class=\"enum\" href=\"magical/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum magical::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":false,"types":["magical::wallet::address_validator::AddressValidatorError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/error/trait.Error.html\" title=\"trait std::error::Error\">Error</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerError.html\" title=\"enum magical::wallet::signer::SignerError\">SignerError</a>","synthetic":false,"types":["magical::wallet::signer::SignerError"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/struct.FeeRate.html\" title=\"struct magical::FeeRate\">FeeRate</a>","synthetic":true,"types":["magical::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/struct.UTXO.html\" title=\"struct magical::UTXO\">UTXO</a>","synthetic":true,"types":["magical::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/struct.TransactionDetails.html\" title=\"struct magical::TransactionDetails\">TransactionDetails</a>","synthetic":true,"types":["magical::types::TransactionDetails"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":true,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>","synthetic":true,"types":["magical::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/blockchain/struct.OfflineBlockchain.html\" title=\"struct magical::blockchain::OfflineBlockchain\">OfflineBlockchain</a>","synthetic":true,"types":["magical::blockchain::OfflineBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/blockchain/struct.NoopProgress.html\" title=\"struct magical::blockchain::NoopProgress\">NoopProgress</a>","synthetic":true,"types":["magical::blockchain::NoopProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/blockchain/struct.LogProgress.html\" title=\"struct magical::blockchain::LogProgress\">LogProgress</a>","synthetic":true,"types":["magical::blockchain::LogProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"magical/blockchain/enum.Capability.html\" title=\"enum magical::blockchain::Capability\">Capability</a>","synthetic":true,"types":["magical::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/blockchain/electrum/struct.ElectrumBlockchain.html\" title=\"struct magical::blockchain::electrum::ElectrumBlockchain\">ElectrumBlockchain</a>","synthetic":true,"types":["magical::blockchain::electrum::ElectrumBlockchain"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/blockchain/esplora/struct.EsploraBlockchain.html\" title=\"struct magical::blockchain::esplora::EsploraBlockchain\">EsploraBlockchain</a>","synthetic":true,"types":["magical::blockchain::esplora::EsploraBlockchain"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"magical/blockchain/esplora/enum.EsploraError.html\" title=\"enum magical::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":true,"types":["magical::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.Mempool.html\" title=\"struct magical::blockchain::compact_filters::Mempool\">Mempool</a>","synthetic":true,"types":["magical::blockchain::compact_filters::peer::Mempool"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.Peer.html\" title=\"struct magical::blockchain::compact_filters::Peer\">Peer</a>","synthetic":true,"types":["magical::blockchain::compact_filters::peer::Peer"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html\" title=\"struct magical::blockchain::compact_filters::CompactFiltersBlockchain\">CompactFiltersBlockchain</a>","synthetic":true,"types":["magical::blockchain::compact_filters::CompactFiltersBlockchain"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"magical/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum magical::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":true,"types":["magical::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/database/memory/struct.MemoryDatabase.html\" title=\"struct magical::database::memory::MemoryDatabase\">MemoryDatabase</a>","synthetic":true,"types":["magical::database::memory::MemoryDatabase"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"magical/descriptor/error/enum.Error.html\" title=\"enum magical::descriptor::error::Error\">Error</a>","synthetic":true,"types":["magical::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.PKOrF.html\" title=\"struct magical::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":true,"types":["magical::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Policy.html\" title=\"struct magical::descriptor::policy::Policy\">Policy</a>","synthetic":true,"types":["magical::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":true,"types":["magical::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum magical::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":true,"types":["magical::descriptor::policy::SatisfiableItem"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.Satisfaction.html\" title=\"enum magical::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":true,"types":["magical::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.PolicyError.html\" title=\"enum magical::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":true,"types":["magical::descriptor::policy::PolicyError"]},{"text":"impl<B, D> !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/wallet/struct.Wallet.html\" title=\"struct magical::wallet::Wallet\">Wallet</a><B, D>","synthetic":true,"types":["magical::wallet::Wallet"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"magical/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum magical::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":true,"types":["magical::wallet::address_validator::AddressValidatorError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/wallet/coin_selection/struct.CoinSelectionResult.html\" title=\"struct magical::wallet::coin_selection::CoinSelectionResult\">CoinSelectionResult</a>","synthetic":true,"types":["magical::wallet::coin_selection::CoinSelectionResult"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/wallet/coin_selection/struct.DumbCoinSelection.html\" title=\"struct magical::wallet::coin_selection::DumbCoinSelection\">DumbCoinSelection</a>","synthetic":true,"types":["magical::wallet::coin_selection::DumbCoinSelection"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/wallet/export/struct.WalletExport.html\" title=\"struct magical::wallet::export::WalletExport\">WalletExport</a>","synthetic":true,"types":["magical::wallet::export::WalletExport"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignerOrdering.html\" title=\"struct magical::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":true,"types":["magical::wallet::signer::SignerOrdering"]},{"text":"impl<Pk> !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignersContainer.html\" title=\"struct magical::wallet::signer::SignersContainer\">SignersContainer</a><Pk>","synthetic":true,"types":["magical::wallet::signer::SignersContainer"]},{"text":"impl<Pk> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerId.html\" title=\"enum magical::wallet::signer::SignerId\">SignerId</a><Pk> <span class=\"where fmt-newline\">where<br> <Pk as <a class=\"trait\" href=\"magical/descriptor/trait.MiniscriptKey.html\" title=\"trait magical::descriptor::MiniscriptKey\">MiniscriptKey</a>>::<a class=\"type\" href=\"magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash\" title=\"type magical::descriptor::MiniscriptKey::Hash\">Hash</a>: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a>, </span>","synthetic":true,"types":["magical::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerError.html\" title=\"enum magical::wallet::signer::SignerError\">SignerError</a>","synthetic":true,"types":["magical::wallet::signer::SignerError"]},{"text":"impl<Cs> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"magical/wallet/tx_builder/struct.TxBuilder.html\" title=\"struct magical::wallet::tx_builder::TxBuilder\">TxBuilder</a><Cs> <span class=\"where fmt-newline\">where<br> Cs: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a>, </span>","synthetic":true,"types":["magical::wallet::tx_builder::TxBuilder"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":true,"types":["magical::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":true,"types":["magical::wallet::tx_builder::ChangeSpendPolicy"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
-(function() {var implementors = {};
-implementors["magical"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/struct.FeeRate.html\" title=\"struct magical::FeeRate\">FeeRate</a>","synthetic":true,"types":["magical::types::FeeRate"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/struct.UTXO.html\" title=\"struct magical::UTXO\">UTXO</a>","synthetic":true,"types":["magical::types::UTXO"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/struct.TransactionDetails.html\" title=\"struct magical::TransactionDetails\">TransactionDetails</a>","synthetic":true,"types":["magical::types::TransactionDetails"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"magical/enum.Error.html\" title=\"enum magical::Error\">Error</a>","synthetic":true,"types":["magical::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"magical/enum.ScriptType.html\" title=\"enum magical::ScriptType\">ScriptType</a>","synthetic":true,"types":["magical::types::ScriptType"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/blockchain/struct.OfflineBlockchain.html\" title=\"struct magical::blockchain::OfflineBlockchain\">OfflineBlockchain</a>","synthetic":true,"types":["magical::blockchain::OfflineBlockchain"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/blockchain/struct.NoopProgress.html\" title=\"struct magical::blockchain::NoopProgress\">NoopProgress</a>","synthetic":true,"types":["magical::blockchain::NoopProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/blockchain/struct.LogProgress.html\" title=\"struct magical::blockchain::LogProgress\">LogProgress</a>","synthetic":true,"types":["magical::blockchain::LogProgress"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"magical/blockchain/enum.Capability.html\" title=\"enum magical::blockchain::Capability\">Capability</a>","synthetic":true,"types":["magical::blockchain::Capability"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/blockchain/electrum/struct.ElectrumBlockchain.html\" title=\"struct magical::blockchain::electrum::ElectrumBlockchain\">ElectrumBlockchain</a>","synthetic":true,"types":["magical::blockchain::electrum::ElectrumBlockchain"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/blockchain/esplora/struct.EsploraBlockchain.html\" title=\"struct magical::blockchain::esplora::EsploraBlockchain\">EsploraBlockchain</a>","synthetic":true,"types":["magical::blockchain::esplora::EsploraBlockchain"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"magical/blockchain/esplora/enum.EsploraError.html\" title=\"enum magical::blockchain::esplora::EsploraError\">EsploraError</a>","synthetic":true,"types":["magical::blockchain::esplora::EsploraError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.Mempool.html\" title=\"struct magical::blockchain::compact_filters::Mempool\">Mempool</a>","synthetic":true,"types":["magical::blockchain::compact_filters::peer::Mempool"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.Peer.html\" title=\"struct magical::blockchain::compact_filters::Peer\">Peer</a>","synthetic":true,"types":["magical::blockchain::compact_filters::peer::Peer"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html\" title=\"struct magical::blockchain::compact_filters::CompactFiltersBlockchain\">CompactFiltersBlockchain</a>","synthetic":true,"types":["magical::blockchain::compact_filters::CompactFiltersBlockchain"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"magical/blockchain/compact_filters/enum.CompactFiltersError.html\" title=\"enum magical::blockchain::compact_filters::CompactFiltersError\">CompactFiltersError</a>","synthetic":true,"types":["magical::blockchain::compact_filters::CompactFiltersError"]},{"text":"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/database/memory/struct.MemoryDatabase.html\" title=\"struct magical::database::memory::MemoryDatabase\">MemoryDatabase</a>","synthetic":true,"types":["magical::database::memory::MemoryDatabase"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"magical/descriptor/error/enum.Error.html\" title=\"enum magical::descriptor::error::Error\">Error</a>","synthetic":true,"types":["magical::descriptor::error::Error"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.PKOrF.html\" title=\"struct magical::descriptor::policy::PKOrF\">PKOrF</a>","synthetic":true,"types":["magical::descriptor::policy::PKOrF"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Policy.html\" title=\"struct magical::descriptor::policy::Policy\">Policy</a>","synthetic":true,"types":["magical::descriptor::policy::Policy"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/descriptor/policy/struct.Condition.html\" title=\"struct magical::descriptor::policy::Condition\">Condition</a>","synthetic":true,"types":["magical::descriptor::policy::Condition"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.SatisfiableItem.html\" title=\"enum magical::descriptor::policy::SatisfiableItem\">SatisfiableItem</a>","synthetic":true,"types":["magical::descriptor::policy::SatisfiableItem"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.Satisfaction.html\" title=\"enum magical::descriptor::policy::Satisfaction\">Satisfaction</a>","synthetic":true,"types":["magical::descriptor::policy::Satisfaction"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"magical/descriptor/policy/enum.PolicyError.html\" title=\"enum magical::descriptor::policy::PolicyError\">PolicyError</a>","synthetic":true,"types":["magical::descriptor::policy::PolicyError"]},{"text":"impl<B, D> !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/wallet/struct.Wallet.html\" title=\"struct magical::wallet::Wallet\">Wallet</a><B, D>","synthetic":true,"types":["magical::wallet::Wallet"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"magical/wallet/address_validator/enum.AddressValidatorError.html\" title=\"enum magical::wallet::address_validator::AddressValidatorError\">AddressValidatorError</a>","synthetic":true,"types":["magical::wallet::address_validator::AddressValidatorError"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/wallet/coin_selection/struct.CoinSelectionResult.html\" title=\"struct magical::wallet::coin_selection::CoinSelectionResult\">CoinSelectionResult</a>","synthetic":true,"types":["magical::wallet::coin_selection::CoinSelectionResult"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/wallet/coin_selection/struct.DumbCoinSelection.html\" title=\"struct magical::wallet::coin_selection::DumbCoinSelection\">DumbCoinSelection</a>","synthetic":true,"types":["magical::wallet::coin_selection::DumbCoinSelection"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/wallet/export/struct.WalletExport.html\" title=\"struct magical::wallet::export::WalletExport\">WalletExport</a>","synthetic":true,"types":["magical::wallet::export::WalletExport"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignerOrdering.html\" title=\"struct magical::wallet::signer::SignerOrdering\">SignerOrdering</a>","synthetic":true,"types":["magical::wallet::signer::SignerOrdering"]},{"text":"impl<Pk> !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/wallet/signer/struct.SignersContainer.html\" title=\"struct magical::wallet::signer::SignersContainer\">SignersContainer</a><Pk>","synthetic":true,"types":["magical::wallet::signer::SignersContainer"]},{"text":"impl<Pk> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerId.html\" title=\"enum magical::wallet::signer::SignerId\">SignerId</a><Pk> <span class=\"where fmt-newline\">where<br> <Pk as <a class=\"trait\" href=\"magical/descriptor/trait.MiniscriptKey.html\" title=\"trait magical::descriptor::MiniscriptKey\">MiniscriptKey</a>>::<a class=\"type\" href=\"magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash\" title=\"type magical::descriptor::MiniscriptKey::Hash\">Hash</a>: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a>, </span>","synthetic":true,"types":["magical::wallet::signer::SignerId"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"magical/wallet/signer/enum.SignerError.html\" title=\"enum magical::wallet::signer::SignerError\">SignerError</a>","synthetic":true,"types":["magical::wallet::signer::SignerError"]},{"text":"impl<Cs> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"magical/wallet/tx_builder/struct.TxBuilder.html\" title=\"struct magical::wallet::tx_builder::TxBuilder\">TxBuilder</a><Cs> <span class=\"where fmt-newline\">where<br> Cs: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a>, </span>","synthetic":true,"types":["magical::wallet::tx_builder::TxBuilder"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.TxOrdering.html\" title=\"enum magical::wallet::tx_builder::TxOrdering\">TxOrdering</a>","synthetic":true,"types":["magical::wallet::tx_builder::TxOrdering"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a> for <a class=\"enum\" href=\"magical/wallet/tx_builder/enum.ChangeSpendPolicy.html\" title=\"enum magical::wallet::tx_builder::ChangeSpendPolicy\">ChangeSpendPolicy</a>","synthetic":true,"types":["magical::wallet::tx_builder::ChangeSpendPolicy"]}];
-if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
+++ /dev/null
- body{background-color:white;color:black;}h1,h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){color:black;}h1.fqn{border-bottom-color:#D5D5D5;}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){border-bottom-color:#DDDDDD;}.in-band{background-color:white;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#F5F5F5;}pre{background-color:#F5F5F5;}.sidebar{background-color:#F1F1F1;}*{scrollbar-color:rgba(36,37,39,0.6) #e6e6e6;}.sidebar{scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;}::-webkit-scrollbar-track{background-color:#ecebeb;}::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar::-webkit-scrollbar-track{background-color:#dcdcdc;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar .current{background-color:#fff;}.source .sidebar{background-color:#fff;}.sidebar .location{border-color:#000;background-color:#fff;color:#333;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#F5F5F5;}.line-numbers span{color:#c67e2d;}.line-numbers .line-highlighted{background-color:#f6fdb0 !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom-color:#ddd;}.docblock table,.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#4E4C4C;}.content .highlighted{color:#000 !important;background-color:#ccc;}.content .highlighted a,.content .highlighted span{color:#000 !important;}.content .highlighted.trait{background-color:#c7b6ff;}.content .highlighted.traitalias{background-color:#c7b6ff;}.content .highlighted.mod,.content .highlighted.externcrate{background-color:#afc6e4;}.content .highlighted.enum{background-color:#b4d1b9;}.content .highlighted.struct{background-color:#e7b1a0;}.content .highlighted.union{background-color:#b7bd49;}.content .highlighted.fn,.content .highlighted.method,.content .highlighted.tymethod{background-color:#c6afb3;}.content .highlighted.type{background-color:#ffc891;}.content .highlighted.foreigntype{background-color:#f5c4ff;}.content .highlighted.attr,.content .highlighted.derive,.content .highlighted.macro{background-color:#8ce488;}.content .highlighted.constant,.content .highlighted.static{background-color:#c3e0ff;}.content .highlighted.primitive{background-color:#9aecff;}.content .highlighted.keyword{background-color:#f99650;}.content .stability::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#508157;}.content span.struct,.content a.struct,.block a.current.struct{color:#ad448e;}.content span.type,.content a.type,.block a.current.type{color:#ba5d00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#cd00e2;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#068000;}.content span.union,.content a.union,.block a.current.union{color:#767b27;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#546e8a;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#2c8093;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#4d76ae;}.content span.trait,.content a.trait,.block a.current.trait{color:#7c5af3;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#6841f1;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#9a6e31;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}pre.rust .comment{color:#8E908C;}pre.rust .doccomment{color:#4D4D4C;}nav:not(.sidebar){border-bottom-color:#e0e0e0;}nav.main .current{border-top-color:#000;border-bottom-color:#000;}nav.main .separator{border:1px solid #000;}a{color:#000;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.stability a{color:#3873AD;}.stab.internal a{color:#304FFE;}a.test-arrow{color:#f5f5f5;}.collapse-toggle{color:#999;}#crate-search{color:#555;background-color:white;border-color:#e0e0e0;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input{color:#555;background-color:white;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input:focus{border-color:#66afe9;}.search-focus:disabled{background-color:#e6e6e6;}#crate-search+.search-input:focus{box-shadow:0 0 8px #078dd8;}.module-item .stab{color:#000;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;}.stab.internal{background:#FFB9B3;border-color:#B71C1C;}.stab.deprecated{background:#F3DFFF;border-color:#7F0087;}.stab.portability{background:#C4ECFF;border-color:#7BA5DB;}.stab.portability>code{color:#000;}#help>div{background:#e9e9e9;border-color:#bfbfbf;}.since{color:grey;}tr.result span.primitive::after,tr.result span.keyword::after{color:black;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#8959A8;}pre.rust .kw-2,pre.rust .prelude-ty{color:#4271AE;}pre.rust .number,pre.rust .string{color:#718C00;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#C82829;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#B76514;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#c7c7c7;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label{color:#999;}:target>code,:target>.in-band{background:#FDFFD3;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.5);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.5);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.5);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip .tooltiptext{background-color:#000;color:#fff;}.tooltip .tooltiptext::after{border-color:transparent black transparent transparent;}#titles>div:not(.selected){background-color:#e6e6e6;border-top-color:#e6e6e6;}#titles>div:hover,#titles>div.selected{border-top-color:#0089ff;}#titles>div>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#F1F1F1;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#F1F1F1;border-right-color:#000;}#sidebar-filler{background-color:#F1F1F1;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu{border-color:#e0e0e0;background-color:#fff;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus{border-color:#717171;}#theme-choices{border-color:#ccc;background-color:#fff;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#eee;}@media (max-width:700px){#theme-picker{background:#fff;}}#all-types{background-color:#fff;}#all-types:hover{background-color:#f9f9f9;}.search-results td span.alias{color:#000;}.search-results td span.grey{color:#999;}#sidebar-toggle{background-color:#F1F1F1;}#sidebar-toggle:hover{background-color:#E0E0E0;}#source-sidebar{background-color:#F1F1F1;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#E0E0E0;}div.files>.selected{background-color:#fff;}.setting-line>.title{border-bottom-color:#D5D5D5;}
\ No newline at end of file
+++ /dev/null
-<!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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../magical/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span>
- </span>
- <span class='in-band'>List of all items</span></h1><h3 id='Structs'>Structs</h3><ul class='structs docblock'><li><a href='struct.FeeRate.html'>FeeRate</a></li><li><a href='struct.TransactionDetails.html'>TransactionDetails</a></li><li><a href='struct.UTXO.html'>UTXO</a></li><li><a href='blockchain/struct.LogProgress.html'>blockchain::LogProgress</a></li><li><a href='blockchain/struct.NoopProgress.html'>blockchain::NoopProgress</a></li><li><a href='blockchain/struct.OfflineBlockchain.html'>blockchain::OfflineBlockchain</a></li><li><a href='blockchain/compact_filters/struct.CompactFiltersBlockchain.html'>blockchain::compact_filters::CompactFiltersBlockchain</a></li><li><a href='blockchain/compact_filters/struct.Mempool.html'>blockchain::compact_filters::Mempool</a></li><li><a href='blockchain/compact_filters/struct.Peer.html'>blockchain::compact_filters::Peer</a></li><li><a href='blockchain/electrum/struct.ElectrumBlockchain.html'>blockchain::electrum::ElectrumBlockchain</a></li><li><a href='blockchain/esplora/struct.EsploraBlockchain.html'>blockchain::esplora::EsploraBlockchain</a></li><li><a href='database/memory/struct.MemoryDatabase.html'>database::memory::MemoryDatabase</a></li><li><a href='descriptor/struct.Miniscript.html'>descriptor::Miniscript</a></li><li><a href='descriptor/policy/struct.Condition.html'>descriptor::policy::Condition</a></li><li><a href='descriptor/policy/struct.PKOrF.html'>descriptor::policy::PKOrF</a></li><li><a href='descriptor/policy/struct.Policy.html'>descriptor::policy::Policy</a></li><li><a href='wallet/struct.Wallet.html'>wallet::Wallet</a></li><li><a href='wallet/coin_selection/struct.CoinSelectionResult.html'>wallet::coin_selection::CoinSelectionResult</a></li><li><a href='wallet/coin_selection/struct.DumbCoinSelection.html'>wallet::coin_selection::DumbCoinSelection</a></li><li><a href='wallet/export/struct.WalletExport.html'>wallet::export::WalletExport</a></li><li><a href='wallet/signer/struct.SignerOrdering.html'>wallet::signer::SignerOrdering</a></li><li><a href='wallet/signer/struct.SignersContainer.html'>wallet::signer::SignersContainer</a></li><li><a href='wallet/tx_builder/struct.TxBuilder.html'>wallet::tx_builder::TxBuilder</a></li></ul><h3 id='Enums'>Enums</h3><ul class='enums docblock'><li><a href='enum.Error.html'>Error</a></li><li><a href='enum.ScriptType.html'>ScriptType</a></li><li><a href='blockchain/enum.Capability.html'>blockchain::Capability</a></li><li><a href='blockchain/compact_filters/enum.CompactFiltersError.html'>blockchain::compact_filters::CompactFiltersError</a></li><li><a href='blockchain/esplora/enum.EsploraError.html'>blockchain::esplora::EsploraError</a></li><li><a href='descriptor/enum.Descriptor.html'>descriptor::Descriptor</a></li><li><a href='descriptor/enum.Legacy.html'>descriptor::Legacy</a></li><li><a href='descriptor/enum.Segwitv0.html'>descriptor::Segwitv0</a></li><li><a href='descriptor/enum.Terminal.html'>descriptor::Terminal</a></li><li><a href='descriptor/error/enum.Error.html'>descriptor::error::Error</a></li><li><a href='descriptor/policy/enum.PolicyError.html'>descriptor::policy::PolicyError</a></li><li><a href='descriptor/policy/enum.Satisfaction.html'>descriptor::policy::Satisfaction</a></li><li><a href='descriptor/policy/enum.SatisfiableItem.html'>descriptor::policy::SatisfiableItem</a></li><li><a href='wallet/address_validator/enum.AddressValidatorError.html'>wallet::address_validator::AddressValidatorError</a></li><li><a href='wallet/signer/enum.SignerError.html'>wallet::signer::SignerError</a></li><li><a href='wallet/signer/enum.SignerId.html'>wallet::signer::SignerId</a></li><li><a href='wallet/tx_builder/enum.ChangeSpendPolicy.html'>wallet::tx_builder::ChangeSpendPolicy</a></li><li><a href='wallet/tx_builder/enum.TxOrdering.html'>wallet::tx_builder::TxOrdering</a></li></ul><h3 id='Traits'>Traits</h3><ul class='traits docblock'><li><a href='blockchain/trait.Blockchain.html'>blockchain::Blockchain</a></li><li><a href='blockchain/trait.OnlineBlockchain.html'>blockchain::OnlineBlockchain</a></li><li><a href='blockchain/trait.Progress.html'>blockchain::Progress</a></li><li><a href='database/trait.BatchDatabase.html'>database::BatchDatabase</a></li><li><a href='database/trait.BatchOperations.html'>database::BatchOperations</a></li><li><a href='database/trait.Database.html'>database::Database</a></li><li><a href='descriptor/trait.ExtractPolicy.html'>descriptor::ExtractPolicy</a></li><li><a href='descriptor/trait.MiniscriptKey.html'>descriptor::MiniscriptKey</a></li><li><a href='descriptor/trait.ScriptContext.html'>descriptor::ScriptContext</a></li><li><a href='descriptor/trait.ToPublicKey.html'>descriptor::ToPublicKey</a></li><li><a href='wallet/trait.IsDust.html'>wallet::IsDust</a></li><li><a href='wallet/address_validator/trait.AddressValidator.html'>wallet::address_validator::AddressValidator</a></li><li><a href='wallet/coin_selection/trait.CoinSelectionAlgorithm.html'>wallet::coin_selection::CoinSelectionAlgorithm</a></li><li><a href='wallet/signer/trait.Signer.html'>wallet::signer::Signer</a></li></ul><h3 id='Functions'>Functions</h3><ul class='functions docblock'><li><a href='blockchain/fn.log_progress.html'>blockchain::log_progress</a></li><li><a href='blockchain/fn.noop_progress.html'>blockchain::noop_progress</a></li><li><a href='blockchain/fn.progress.html'>blockchain::progress</a></li><li><a href='descriptor/checksum/fn.get_checksum.html'>descriptor::checksum::get_checksum</a></li><li><a href='wallet/time/fn.get_timestamp.html'>wallet::time::get_timestamp</a></li></ul><h3 id='Typedefs'>Typedefs</h3><ul class='typedefs docblock'><li><a href='blockchain/type.ProgressData.html'>blockchain::ProgressData</a></li><li><a href='descriptor/type.ExtendedDescriptor.html'>descriptor::ExtendedDescriptor</a></li><li><a href='descriptor/type.HDKeyPaths.html'>descriptor::HDKeyPaths</a></li><li><a href='descriptor/policy/type.ConditionMap.html'>descriptor::policy::ConditionMap</a></li><li><a href='descriptor/policy/type.FoldedConditionMap.html'>descriptor::policy::FoldedConditionMap</a></li><li><a href='wallet/type.OfflineWallet.html'>wallet::OfflineWallet</a></li><li><a href='wallet/coin_selection/type.DefaultCoinSelectionAlgorithm.html'>wallet::coin_selection::DefaultCoinSelectionAlgorithm</a></li></ul></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "magical";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `CompactFiltersError` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, CompactFiltersError"><title>magical::blockchain::compact_filters::CompactFiltersError - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum CompactFiltersError</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.BIP158">BIP158</a><a href="#variant.DB">DB</a><a href="#variant.DataCorruption">DataCorruption</a><a href="#variant.Global">Global</a><a href="#variant.IO">IO</a><a href="#variant.InvalidFilter">InvalidFilter</a><a href="#variant.InvalidFilterHeader">InvalidFilterHeader</a><a href="#variant.InvalidHeaders">InvalidHeaders</a><a href="#variant.InvalidResponse">InvalidResponse</a><a href="#variant.MissingBlock">MissingBlock</a><a href="#variant.NoPeers">NoPeers</a><a href="#variant.NotConnected">NotConnected</a><a href="#variant.Time">Time</a><a href="#variant.Timeout">Timeout</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Error">Error</a><a href="#impl-From%3CCompactFiltersError%3E">From<CompactFiltersError></a><a href="#impl-From%3CError%3E">From<Error></a><a href="#impl-From%3CSystemTimeError%3E">From<SystemTimeError></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>compact_filters</a></p><script>window.sidebarCurrent = {name: 'CompactFiltersError', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#500-533' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>compact_filters</a>::<wbr><a class="enum" href=''>CompactFiltersError</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum CompactFiltersError {
- InvalidResponse,
- InvalidHeaders,
- InvalidFilterHeader,
- InvalidFilter,
- MissingBlock,
- DataCorruption,
- NotConnected,
- Timeout,
- NoPeers,
- DB(Error),
- IO(<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>),
- BIP158(Error),
- Time(<a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.SystemTimeError.html" title="struct std::time::SystemTimeError">SystemTimeError</a>),
- Global(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><<a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>>),
-}</pre></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>An error that can occur during sync with a <a href="../../../magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="`CompactFiltersBlockchain`"><code>CompactFiltersBlockchain</code></a></p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<div id="variant.InvalidResponse" class="variant small-section-header"><a href="#variant.InvalidResponse" class="anchor field"></a><code>InvalidResponse</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>A peer sent an invalid or unexpected response</p>
-</div><div id="variant.InvalidHeaders" class="variant small-section-header"><a href="#variant.InvalidHeaders" class="anchor field"></a><code>InvalidHeaders</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>The headers returned are invalid</p>
-</div><div id="variant.InvalidFilterHeader" class="variant small-section-header"><a href="#variant.InvalidFilterHeader" class="anchor field"></a><code>InvalidFilterHeader</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>The compact filter headers returned are invalid</p>
-</div><div id="variant.InvalidFilter" class="variant small-section-header"><a href="#variant.InvalidFilter" class="anchor field"></a><code>InvalidFilter</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>The compact filter returned is invalid</p>
-</div><div id="variant.MissingBlock" class="variant small-section-header"><a href="#variant.MissingBlock" class="anchor field"></a><code>MissingBlock</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>The peer is missing a block in the valid chain</p>
-</div><div id="variant.DataCorruption" class="variant small-section-header"><a href="#variant.DataCorruption" class="anchor field"></a><code>DataCorruption</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>The data stored in the block filters storage are corrupted</p>
-</div><div id="variant.NotConnected" class="variant small-section-header"><a href="#variant.NotConnected" class="anchor field"></a><code>NotConnected</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>A peer is not connected</p>
-</div><div id="variant.Timeout" class="variant small-section-header"><a href="#variant.Timeout" class="anchor field"></a><code>Timeout</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>A peer took too long to reply to one of our messages</p>
-</div><div id="variant.NoPeers" class="variant small-section-header"><a href="#variant.NoPeers" class="anchor field"></a><code>NoPeers</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>No peers have been specified</p>
-</div><div id="variant.DB" class="variant small-section-header"><a href="#variant.DB" class="anchor field"></a><code>DB(Error)</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Internal database error</p>
-</div><div id="variant.IO" class="variant small-section-header"><a href="#variant.IO" class="anchor field"></a><code>IO(<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>)</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Internal I/O error</p>
-</div><div id="variant.BIP158" class="variant small-section-header"><a href="#variant.BIP158" class="anchor field"></a><code>BIP158(Error)</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Invalid BIP158 filter</p>
-</div><div id="variant.Time" class="variant small-section-header"><a href="#variant.Time" class="anchor field"></a><code>Time(<a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.SystemTimeError.html" title="struct std::time::SystemTimeError">SystemTimeError</a>)</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Internal system time error</p>
-</div><div id="variant.Global" class="variant small-section-header"><a href="#variant.Global" class="anchor field"></a><code>Global(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><<a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>>)</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Wrapper for <a href="../../../magical/enum.Error.html" title="`crate::error::Error`"><code>crate::error::Error</code></a></p>
-</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#499' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#499' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#535-539' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#536-538' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Error' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-Error' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#541' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.source' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source' class='fnname'>source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><span class='since' title='Stable since Rust version 1.30.0'>1.30.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#100-102' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
-</div><h4 id='method.backtrace' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace' class='fnname'>backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#128-130' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>backtrace</code>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
-</div><h4 id='method.description' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description' class='fnname'>description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#140-142' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
-</div></div><div class='docblock hidden'><p><code>if let Err(e) = "xc".parse::<u32>() { // Print </code>e<code> itself, no need for description(). eprintln!("Error: {}", e); }</code> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></p>
-</div><h4 id='method.cause' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#150-152' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
-</div></div></div><h3 id='impl-From%3CCompactFiltersError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>> for <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CCompactFiltersError%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/error.rs.html#133-140' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(other: <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>) -> Self</code><a class='srclink' href='../../../src/magical/error.rs.html#134-139' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-From%3CError%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#545-549' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#546-548' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-1' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>> for <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-From%3CError%3E-1' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#545-549' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>) -> Self</code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#546-548' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-2' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-From%3CError%3E-2' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#545-549' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-3' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#546-548' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-3' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>> for <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-From%3CError%3E-3' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#558-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-5' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>) -> Self</code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CSystemTimeError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.SystemTimeError.html" title="struct std::time::SystemTimeError">SystemTimeError</a>> for <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-From%3CSystemTimeError%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#545-549' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-4' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.SystemTimeError.html" title="struct std::time::SystemTimeError">SystemTimeError</a>) -> Self</code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#546-548' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-6' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2237-2247' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2239-2246' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `compact_filters` mod in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, compact_filters"><title>magical::blockchain::compact_filters - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module compact_filters</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'compact_filters', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#25-562' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a class="mod" href=''>compact_filters</a></span></h1><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Compact Filters</p>
-<p>This module contains a multithreaded implementation of an <a href="../../../magical/blockchain/trait.OnlineBlockchain.html" title="`OnlineBlockchain`"><code>OnlineBlockchain</code></a> backend that
-uses BIP157 (aka "Neutrino") to populate the wallet's <a href="../../../magical/database/trait.Database.html">database</a>
-by downloading compact filters from the P2P network.</p>
-<p>Since there are currently very few peers "in the wild" that advertise the required service
-flag, this implementation requires that one or more known peers are provided by the user.
-No dns or other kinds of peer discovery are done internally.</p>
-<p>Moreover, this module doesn't currently support detecting and resolving conflicts between
-messages received by different peers. Thus, it's recommended to use this module by only
-connecting to a single peer at a time, optionally by opening multiple connections if it's
-desirable to use multiple threads at once to sync in parallel.</p>
-<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
-<div class="example-wrap"><pre class="rust rust-example-rendered">
-<span class="kw">let</span> <span class="ident">num_threads</span> <span class="op">=</span> <span class="number">4</span>;
-
-<span class="kw">let</span> <span class="ident">mempool</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Mempool</span>::<span class="ident">default</span>());
-<span class="kw">let</span> <span class="ident">peers</span> <span class="op">=</span> (<span class="number">0</span>..<span class="ident">num_threads</span>)
- .<span class="ident">map</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">Peer</span>::<span class="ident">connect</span>(
- <span class="string">"btcd-mainnet.lightning.computer:8333"</span>,
- <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">mempool</span>),
- <span class="ident">Network</span>::<span class="ident">Bitcoin</span>,
- ))
- .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()<span class="question-mark">?</span>;
-<span class="kw">let</span> <span class="ident">blockchain</span> <span class="op">=</span> <span class="ident">CompactFiltersBlockchain</span>::<span class="ident">new</span>(<span class="ident">peers</span>, <span class="string">"./wallet-filters"</span>, <span class="prelude-val">Some</span>(<span class="number">500_000</span>))<span class="question-mark">?</span>;</pre></div>
-</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
-<table><tr class='module-item'><td><a class="struct" href="struct.CompactFiltersBlockchain.html" title='magical::blockchain::compact_filters::CompactFiltersBlockchain struct'>CompactFiltersBlockchain</a></td><td class='docblock-short'><span class="stab portability"><code>feature="compact_filters"</code></span><p>Structure implementing the required blockchain traits</p>
-</td></tr><tr class='module-item'><td><a class="struct" href="struct.Mempool.html" title='magical::blockchain::compact_filters::Mempool struct'>Mempool</a></td><td class='docblock-short'><span class="stab portability"><code>feature="compact_filters"</code></span><p>Container for unconfirmed, but valid Bitcoin transactions</p>
-</td></tr><tr class='module-item'><td><a class="struct" href="struct.Peer.html" title='magical::blockchain::compact_filters::Peer struct'>Peer</a></td><td class='docblock-short'><span class="stab portability"><code>feature="compact_filters"</code></span><p>A Bitcoin peer</p>
-</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
-<table><tr class='module-item'><td><a class="enum" href="enum.CompactFiltersError.html" title='magical::blockchain::compact_filters::CompactFiltersError enum'>CompactFiltersError</a></td><td class='docblock-short'><span class="stab portability"><code>feature="compact_filters"</code></span><p>An error that can occur during sync with a <a href="../../../magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="`CompactFiltersBlockchain`"><code>CompactFiltersBlockchain</code></a></p>
-</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=../../../../magical/blockchain/compact_filters/struct.Mempool.html">
-</head>
-<body>
- <p>Redirecting to <a href="../../../../magical/blockchain/compact_filters/struct.Mempool.html">../../../../magical/blockchain/compact_filters/struct.Mempool.html</a>...</p>
- <script>location.replace("../../../../magical/blockchain/compact_filters/struct.Mempool.html" + location.search + location.hash);</script>
-</body>
-</html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=../../../../magical/blockchain/compact_filters/struct.Peer.html">
-</head>
-<body>
- <p>Redirecting to <a href="../../../../magical/blockchain/compact_filters/struct.Peer.html">../../../../magical/blockchain/compact_filters/struct.Peer.html</a>...</p>
- <script>location.replace("../../../../magical/blockchain/compact_filters/struct.Peer.html" + location.search + location.hash);</script>
-</body>
-</html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"enum":[["CompactFiltersError","An error that can occur during sync with a [`CompactFiltersBlockchain`]"]],"struct":[["CompactFiltersBlockchain","Structure implementing the required blockchain traits"],["Mempool","Container for unconfirmed, but valid Bitcoin transactions"],["Peer","A Bitcoin peer"]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `CompactFiltersBlockchain` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, CompactFiltersBlockchain"><title>magical::blockchain::compact_filters::CompactFiltersBlockchain - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct CompactFiltersBlockchain</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Blockchain">Blockchain</a><a href="#impl-Debug">Debug</a><a href="#impl-OnlineBlockchain">OnlineBlockchain</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>compact_filters</a></p><script>window.sidebarCurrent = {name: 'CompactFiltersBlockchain', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#100' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>compact_filters</a>::<wbr><a class="struct" href=''>CompactFiltersBlockchain</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct CompactFiltersBlockchain(_);</pre></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Structure implementing the required blockchain traits</p>
-<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
-<p>See the <a href="../../../magical/blockchain/compact_filters/index.html"><code>blockchain::compact_filters</code></a> module for a usage example.</p>
-</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct magical::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#102-122' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code>pub fn <a href='#method.new' class='fnname'>new</a><P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>>>(<br> peers: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../magical/blockchain/compact_filters/struct.Peer.html" title="struct magical::blockchain::compact_filters::Peer">Peer</a>>, <br> storage_dir: P, <br> skip_blocks: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#111-121' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Construct a new instance given a list of peers, a path to store headers and block
-filters downloaded during the sync and optionally a number of blocks to ignore starting
-from the genesis while scanning for the wallet's outputs.</p>
-<p>For each <a href="../../../magical/blockchain/compact_filters/struct.Peer.html" title="`Peer`"><code>Peer</code></a> specified a new thread will be spawned to download and verify the filters
-in parallel. It's currently recommended to only connect to a single peer to avoid
-inconsistencies in the data returned, optionally with multiple connections in parallel to
-speed-up the sync process.</p>
-</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Blockchain' class='impl'><code class='in-band'>impl <a class="trait" href="../../../magical/blockchain/trait.Blockchain.html" title="trait magical::blockchain::Blockchain">Blockchain</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct magical::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-Blockchain' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#252-260' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.offline' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.Blockchain.html#tymethod.offline' class='fnname'>offline</a>() -> Self</code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#253-255' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Create a new instance of the client that is offline-only <a href="../../../magical/blockchain/trait.Blockchain.html#tymethod.offline">Read more</a></p>
-</div><h4 id='method.is_online' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.Blockchain.html#tymethod.is_online' class='fnname'>is_online</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#257-259' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return whether or not the client has the ability to fullfill requests <a href="../../../magical/blockchain/trait.Blockchain.html#tymethod.is_online">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct magical::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#99' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#99' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-OnlineBlockchain' class='impl'><code class='in-band'>impl <a class="trait" href="../../../magical/blockchain/trait.OnlineBlockchain.html" title="trait magical::blockchain::OnlineBlockchain">OnlineBlockchain</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct magical::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-OnlineBlockchain' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#262-496' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_capabilities' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.get_capabilities' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a>></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#263-265' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the set of <a href="../../../magical/blockchain/enum.Capability.html" title="`Capability`"><code>Capability</code></a> supported by this backend</p>
-</div><h4 id='method.setup' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.setup' class='fnname'>setup</a><D: <a class="trait" href="../../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a>>(<br> &self, <br> _stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#267-469' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Setup the backend and populate the internal database for the first time <a href="../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.setup">Read more</a></p>
-</div><h4 id='method.get_tx' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.get_tx' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#471-477' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Fetch a transaction from the blockchain given its txid</p>
-</div><h4 id='method.broadcast' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.broadcast' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#479-484' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Broadcast a transaction</p>
-</div><h4 id='method.get_height' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.get_height' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#486-490' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the current height</p>
-</div><h4 id='method.estimate_fee' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.estimate_fee' class='fnname'>estimate_fee</a>(&self, _target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/mod.rs.html#492-495' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Estimate the fee rate required to confirm a transaction in a given <code>target</code> of blocks</p>
-</div><h4 id='method.sync' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#method.sync' class='fnname'>sync</a><D: <a class="trait" href="../../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/mod.rs.html#158-165' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Populate the internal database with transactions and UTXOs <a href="../../../magical/blockchain/trait.OnlineBlockchain.html#method.sync">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct magical::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct magical::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct magical::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct magical::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct magical::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Mempool` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Mempool"><title>magical::blockchain::compact_filters::Mempool - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Mempool</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.add_tx">add_tx</a><a href="#method.get_tx">get_tx</a><a href="#method.has_tx">has_tx</a><a href="#method.iter_txs">iter_txs</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>compact_filters</a></p><script>window.sidebarCurrent = {name: 'Mempool', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#58-60' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>compact_filters</a>::<wbr><a class="struct" href=''>Mempool</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Mempool { /* fields omitted */ }</pre></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Container for unconfirmed, but valid Bitcoin transactions</p>
-<p>It is normally shared between <a href="../../../magical/blockchain/compact_filters/struct.Peer.html" title="`Peer`"><code>Peer</code></a>s with the use of <a href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="`Arc`"><code>Arc</code></a>, so that transactions are not
-duplicated in memory.</p>
-</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../magical/blockchain/compact_filters/struct.Mempool.html" title="struct magical::blockchain::compact_filters::Mempool">Mempool</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#62-90' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.add_tx' class="method"><code>pub fn <a href='#method.add_tx' class='fnname'>add_tx</a>(&self, tx: Transaction)</code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#67-69' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Add a transaction to the mempool</p>
-<p>Note that this doesn't propagate the transaction to other
-peers. To do that, <a href="../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.broadcast"><code>broadcast</code></a> should be used.</p>
-</div><h4 id='method.get_tx' class="method"><code>pub fn <a href='#method.get_tx' class='fnname'>get_tx</a>(&self, inventory: &Inventory) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#72-79' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Look-up a transaction in the mempool given an [<code>Inventory</code>] request</p>
-</div><h4 id='method.has_tx' class="method"><code>pub fn <a href='#method.has_tx' class='fnname'>has_tx</a>(&self, txid: &Txid) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#82-84' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Return whether or not the mempool contains a transaction with a given txid</p>
-</div><h4 id='method.iter_txs' class="method"><code>pub fn <a href='#method.iter_txs' class='fnname'>iter_txs</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Transaction></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#87-89' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Return the list of transactions contained in the mempool</p>
-</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.Mempool.html" title="struct magical::blockchain::compact_filters::Mempool">Mempool</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#57' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#57' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.Mempool.html" title="struct magical::blockchain::compact_filters::Mempool">Mempool</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#57' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../../magical/blockchain/compact_filters/struct.Mempool.html" title="struct magical::blockchain::compact_filters::Mempool">Mempool</a></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#57' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.Mempool.html" title="struct magical::blockchain::compact_filters::Mempool">Mempool</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.Mempool.html" title="struct magical::blockchain::compact_filters::Mempool">Mempool</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.Mempool.html" title="struct magical::blockchain::compact_filters::Mempool">Mempool</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.Mempool.html" title="struct magical::blockchain::compact_filters::Mempool">Mempool</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.Mempool.html" title="struct magical::blockchain::compact_filters::Mempool">Mempool</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Peer` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Peer"><title>magical::blockchain::compact_filters::Peer - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Peer</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.connect">connect</a><a href="#method.connect_proxy">connect_proxy</a><a href="#method.get_mempool">get_mempool</a><a href="#method.get_network">get_network</a><a href="#method.get_version">get_version</a><a href="#method.is_connected">is_connected</a><a href="#method.recv">recv</a><a href="#method.send">send</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>compact_filters</a></p><script>window.sidebarCurrent = {name: 'Peer', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#94-105' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>compact_filters</a>::<wbr><a class="struct" href=''>Peer</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Peer { /* fields omitted */ }</pre></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>A Bitcoin peer</p>
-</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../magical/blockchain/compact_filters/struct.Peer.html" title="struct magical::blockchain::compact_filters::Peer">Peer</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#107-387' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.connect' class="method"><code>pub fn <a href='#method.connect' class='fnname'>connect</a><A: <a class="trait" href="https://doc.rust-lang.org/nightly/std/net/addr/trait.ToSocketAddrs.html" title="trait std::net::addr::ToSocketAddrs">ToSocketAddrs</a>>(<br> address: A, <br> mempool: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../../magical/blockchain/compact_filters/struct.Mempool.html" title="struct magical::blockchain::compact_filters::Mempool">Mempool</a>>, <br> network: Network<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#112-120' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Connect to a peer over a plaintext TCP connection</p>
-<p>This function internally spawns a new thread that will monitor incoming messages from the
-peer, and optionally reply to some of them transparently, like <a href="NetworkMessage::Ping">pings</a></p>
-</div><h4 id='method.connect_proxy' class="method"><code>pub fn <a href='#method.connect_proxy' class='fnname'>connect_proxy</a><T: <a class="trait" href="https://docs.rs/socks/0.3.0/socks/trait.ToTargetAddr.html" title="trait socks::ToTargetAddr">ToTargetAddr</a>, P: <a class="trait" href="https://doc.rust-lang.org/nightly/std/net/addr/trait.ToSocketAddrs.html" title="trait std::net::addr::ToSocketAddrs">ToSocketAddrs</a>>(<br> target: T, <br> proxy: P, <br> credentials: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <br> mempool: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../../magical/blockchain/compact_filters/struct.Mempool.html" title="struct magical::blockchain::compact_filters::Mempool">Mempool</a>>, <br> network: Network<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#127-141' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Connect to a peer through a SOCKS5 proxy, optionally by using some credentials, specified
-as a tuple of <code>(username, password)</code></p>
-<p>This function internally spawns a new thread that will monitor incoming messages from the
-peer, and optionally reply to some of them transparently, like <a href="NetworkMessage::Ping">pings</a></p>
-</div><h4 id='method.get_version' class="method"><code>pub fn <a href='#method.get_version' class='fnname'>get_version</a>(&self) -> &VersionMessage</code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#269-271' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Return the [<code>VersionMessage</code>] sent by the peer</p>
-</div><h4 id='method.get_network' class="method"><code>pub fn <a href='#method.get_network' class='fnname'>get_network</a>(&self) -> Network</code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#274-276' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Return the Bitcoin [<code>Network</code>] in use</p>
-</div><h4 id='method.get_mempool' class="method"><code>pub fn <a href='#method.get_mempool' class='fnname'>get_mempool</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../../magical/blockchain/compact_filters/struct.Mempool.html" title="struct magical::blockchain::compact_filters::Mempool">Mempool</a>></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#279-281' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Return the mempool used by this peer</p>
-</div><h4 id='method.is_connected' class="method"><code>pub fn <a href='#method.is_connected' class='fnname'>is_connected</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#284-286' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Return whether or not the peer is still connected</p>
-</div><h4 id='method.send' class="method"><code>pub fn <a href='#method.send' class='fnname'>send</a>(&self, payload: NetworkMessage) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#374-377' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Send a raw Bitcoin message to the peer</p>
-</div><h4 id='method.recv' class="method"><code>pub fn <a href='#method.recv' class='fnname'>recv</a>(<br> &self, <br> wait_for: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> timeout: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><NetworkMessage>, <a class="enum" href="../../../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#380-386' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="compact_filters"</code></strong> only.</div></div><div class='docblock'><p>Waits for a specific incoming Bitcoin message, optionally with a timeout</p>
-</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.Peer.html" title="struct magical::blockchain::compact_filters::Peer">Peer</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#93' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/blockchain/compact_filters/peer.rs.html#93' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.Peer.html" title="struct magical::blockchain::compact_filters::Peer">Peer</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.Peer.html" title="struct magical::blockchain::compact_filters::Peer">Peer</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.Peer.html" title="struct magical::blockchain::compact_filters::Peer">Peer</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.Peer.html" title="struct magical::blockchain::compact_filters::Peer">Peer</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../magical/blockchain/compact_filters/struct.Peer.html" title="struct magical::blockchain::compact_filters::Peer">Peer</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `electrum` mod in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, electrum"><title>magical::blockchain::electrum - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module electrum</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'electrum', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/blockchain/electrum.rs.html#25-202' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a class="mod" href=''>electrum</a></span></h1><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="electrum"</code></strong> only.</div></div><div class='docblock'><p>Electrum</p>
-<p>This module defines an <a href="../../../magical/blockchain/trait.OnlineBlockchain.html" title="`OnlineBlockchain`"><code>OnlineBlockchain</code></a> struct that wraps an [<code>electrum_client::Client</code>]
-and implements the logic required to populate the wallet's <a href="../../../magical/database/trait.Database.html">database</a> by
-querying the inner client.</p>
-<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
-<div class="example-wrap"><pre class="rust rust-example-rendered">
-<span class="kw">let</span> <span class="ident">client</span> <span class="op">=</span> <span class="ident">electrum_client</span>::<span class="ident">Client</span>::<span class="ident">new</span>(<span class="string">"ssl://electrum.blockstream.info:50002"</span>, <span class="prelude-val">None</span>)<span class="question-mark">?</span>;
-<span class="kw">let</span> <span class="ident">blockchain</span> <span class="op">=</span> <span class="ident">ElectrumBlockchain</span>::<span class="ident">from</span>(<span class="ident">client</span>);</pre></div>
-</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
-<table><tr class='module-item'><td><a class="struct" href="struct.ElectrumBlockchain.html" title='magical::blockchain::electrum::ElectrumBlockchain struct'>ElectrumBlockchain</a></td><td class='docblock-short'><span class="stab portability"><code>feature="electrum"</code></span><p>Wrapper over an Electrum Client that implements the required blockchain traits</p>
-</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"struct":[["ElectrumBlockchain","Wrapper over an Electrum Client that implements the required blockchain traits"]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ElectrumBlockchain` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, ElectrumBlockchain"><title>magical::blockchain::electrum::ElectrumBlockchain - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct ElectrumBlockchain</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Blockchain">Blockchain</a><a href="#impl-From%3CClient%3E">From<Client></a><a href="#impl-OnlineBlockchain">OnlineBlockchain</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>electrum</a></p><script>window.sidebarCurrent = {name: 'ElectrumBlockchain', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/blockchain/electrum.rs.html#59' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>electrum</a>::<wbr><a class="struct" href=''>ElectrumBlockchain</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct ElectrumBlockchain(_);</pre></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="electrum"</code></strong> only.</div></div><div class='docblock'><p>Wrapper over an Electrum Client that implements the required blockchain traits</p>
-<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
-<p>See the <a href="../../../magical/blockchain/electrum/index.html"><code>blockchain::electrum</code></a> module for a usage example.</p>
-</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Blockchain' class='impl'><code class='in-band'>impl <a class="trait" href="../../../magical/blockchain/trait.Blockchain.html" title="trait magical::blockchain::Blockchain">Blockchain</a> for <a class="struct" href="../../../magical/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct magical::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-Blockchain' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/electrum.rs.html#74-82' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.offline' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.Blockchain.html#tymethod.offline' class='fnname'>offline</a>() -> Self</code><a class='srclink' href='../../../src/magical/blockchain/electrum.rs.html#75-77' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Create a new instance of the client that is offline-only <a href="../../../magical/blockchain/trait.Blockchain.html#tymethod.offline">Read more</a></p>
-</div><h4 id='method.is_online' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.Blockchain.html#tymethod.is_online' class='fnname'>is_online</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/blockchain/electrum.rs.html#79-81' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return whether or not the client has the ability to fullfill requests <a href="../../../magical/blockchain/trait.Blockchain.html#tymethod.is_online">Read more</a></p>
-</div></div><h3 id='impl-From%3CClient%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Client> for <a class="struct" href="../../../magical/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct magical::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-From%3CClient%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/electrum.rs.html#68-72' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(client: Client) -> Self</code><a class='srclink' href='../../../src/magical/blockchain/electrum.rs.html#69-71' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-OnlineBlockchain' class='impl'><code class='in-band'>impl <a class="trait" href="../../../magical/blockchain/trait.OnlineBlockchain.html" title="trait magical::blockchain::OnlineBlockchain">OnlineBlockchain</a> for <a class="struct" href="../../../magical/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct magical::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-OnlineBlockchain' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/electrum.rs.html#84-144' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_capabilities' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.get_capabilities' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a>></code><a class='srclink' href='../../../src/magical/blockchain/electrum.rs.html#85-93' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the set of <a href="../../../magical/blockchain/enum.Capability.html" title="`Capability`"><code>Capability</code></a> supported by this backend</p>
-</div><h4 id='method.setup' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.setup' class='fnname'>setup</a><D: <a class="trait" href="../../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>, P: <a class="trait" href="../../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/electrum.rs.html#95-105' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Setup the backend and populate the internal database for the first time <a href="../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.setup">Read more</a></p>
-</div><h4 id='method.get_tx' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.get_tx' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/electrum.rs.html#107-114' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Fetch a transaction from the blockchain given its txid</p>
-</div><h4 id='method.broadcast' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.broadcast' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/electrum.rs.html#116-123' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Broadcast a transaction</p>
-</div><h4 id='method.get_height' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.get_height' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/electrum.rs.html#125-134' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the current height</p>
-</div><h4 id='method.estimate_fee' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.estimate_fee' class='fnname'>estimate_fee</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/electrum.rs.html#136-143' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Estimate the fee rate required to confirm a transaction in a given <code>target</code> of blocks</p>
-</div><h4 id='method.sync' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#method.sync' class='fnname'>sync</a><D: <a class="trait" href="../../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/mod.rs.html#158-165' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Populate the internal database with transactions and UTXOs <a href="../../../magical/blockchain/trait.OnlineBlockchain.html#method.sync">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../magical/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct magical::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../magical/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct magical::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../magical/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct magical::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../magical/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct magical::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../magical/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct magical::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Capability` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Capability"><title>magical::blockchain::Capability - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Capability</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.AccurateFees">AccurateFees</a><a href="#variant.FullHistory">FullHistory</a><a href="#variant.GetAnyTx">GetAnyTx</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Eq">Eq</a><a href="#impl-Hash">Hash</a><a href="#impl-PartialEq%3CCapability%3E">PartialEq<Capability></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'Capability', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#74-81' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="enum" href=''>Capability</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Capability {
- FullHistory,
- GetAnyTx,
- AccurateFees,
-}</pre></div><div class='docblock'><p>Capabilities that can be supported by an <a href="../../magical/blockchain/trait.OnlineBlockchain.html" title="`OnlineBlockchain`"><code>OnlineBlockchain</code></a> backend</p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<div id="variant.FullHistory" class="variant small-section-header"><a href="#variant.FullHistory" class="anchor field"></a><code>FullHistory</code></div><div class='docblock'><p>Can recover the full history of a wallet and not only the set of currently spendable UTXOs</p>
-</div><div id="variant.GetAnyTx" class="variant small-section-header"><a href="#variant.GetAnyTx" class="anchor field"></a><code>GetAnyTx</code></div><div class='docblock'><p>Can fetch any historical transaction given its txid</p>
-</div><div id="variant.AccurateFees" class="variant small-section-header"><a href="#variant.AccurateFees" class="anchor field"></a><code>AccurateFees</code></div><div class='docblock'><p>Can compute accurate fees for the transactions found during sync</p>
-</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#73' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#73' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#73' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#73' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#73' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#73' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#73' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H)</code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#73' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
-</div><h4 id='method.hash_slice' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#192-199' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
-</div></div><h3 id='impl-PartialEq%3CCapability%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a>> for <a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a></code><a href='#impl-PartialEq%3CCapability%3E' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#73' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#73' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#73' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#73' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `EsploraError` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, EsploraError"><title>magical::blockchain::esplora::EsploraError - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum EsploraError</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.BitcoinEncoding">BitcoinEncoding</a><a href="#variant.Parsing">Parsing</a><a href="#variant.Reqwest">Reqwest</a><a href="#variant.TransactionNotFound">TransactionNotFound</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Error">Error</a><a href="#impl-From%3CError%3E">From<Error></a><a href="#impl-From%3CEsploraError%3E">From<EsploraError></a><a href="#impl-From%3CParseIntError%3E">From<ParseIntError></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>esplora</a></p><script>window.sidebarCurrent = {name: 'EsploraError', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#373-383' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>esplora</a>::<wbr><a class="enum" href=''>EsploraError</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum EsploraError {
- Reqwest(<a class="struct" href="https://docs.rs/reqwest/0.10.7/reqwest/error/struct.Error.html" title="struct reqwest::error::Error">Error</a>),
- Parsing(<a class="struct" href="https://doc.rust-lang.org/nightly/core/num/struct.ParseIntError.html" title="struct core::num::ParseIntError">ParseIntError</a>),
- BitcoinEncoding(Error),
- TransactionNotFound(Txid),
-}</pre></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="esplora"</code></strong> only.</div></div><div class='docblock'><p>Errors that can happen during a sync with <a href="../../../magical/blockchain/esplora/struct.EsploraBlockchain.html" title="`EsploraBlockchain`"><code>EsploraBlockchain</code></a></p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<div id="variant.Reqwest" class="variant small-section-header"><a href="#variant.Reqwest" class="anchor field"></a><code>Reqwest(<a class="struct" href="https://docs.rs/reqwest/0.10.7/reqwest/error/struct.Error.html" title="struct reqwest::error::Error">Error</a>)</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="esplora"</code></strong> only.</div></div><div class='docblock'><p>Error with the HTTP call</p>
-</div><div id="variant.Parsing" class="variant small-section-header"><a href="#variant.Parsing" class="anchor field"></a><code>Parsing(<a class="struct" href="https://doc.rust-lang.org/nightly/core/num/struct.ParseIntError.html" title="struct core::num::ParseIntError">ParseIntError</a>)</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="esplora"</code></strong> only.</div></div><div class='docblock'><p>Invalid number returned</p>
-</div><div id="variant.BitcoinEncoding" class="variant small-section-header"><a href="#variant.BitcoinEncoding" class="anchor field"></a><code>BitcoinEncoding(Error)</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="esplora"</code></strong> only.</div></div><div class='docblock'><p>Invalid Bitcoin data returned</p>
-</div><div id="variant.TransactionNotFound" class="variant small-section-header"><a href="#variant.TransactionNotFound" class="anchor field"></a><code>TransactionNotFound(Txid)</code></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="esplora"</code></strong> only.</div></div><div class='docblock'><p>Transaction not found</p>
-</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../magical/blockchain/esplora/enum.EsploraError.html" title="enum magical::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#372' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#372' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../../../magical/blockchain/esplora/enum.EsploraError.html" title="enum magical::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#385-389' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#386-388' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Error' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="enum" href="../../../magical/blockchain/esplora/enum.EsploraError.html" title="enum magical::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-Error' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#391' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.source' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source' class='fnname'>source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><span class='since' title='Stable since Rust version 1.30.0'>1.30.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#100-102' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
-</div><h4 id='method.backtrace' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace' class='fnname'>backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#128-130' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>backtrace</code>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
-</div><h4 id='method.description' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description' class='fnname'>description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#140-142' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
-</div></div><div class='docblock hidden'><p><code>if let Err(e) = "xc".parse::<u32>() { // Print </code>e<code> itself, no need for description(). eprintln!("Error: {}", e); }</code> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></p>
-</div><h4 id='method.cause' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#150-152' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
-</div></div></div><h3 id='impl-From%3CError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://docs.rs/reqwest/0.10.7/reqwest/error/struct.Error.html" title="struct reqwest::error::Error">Error</a>> for <a class="enum" href="../../../magical/blockchain/esplora/enum.EsploraError.html" title="enum magical::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-From%3CError%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#393-397' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(other: <a class="struct" href="https://docs.rs/reqwest/0.10.7/reqwest/error/struct.Error.html" title="struct reqwest::error::Error">Error</a>) -> Self</code><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#394-396' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-1' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../../../magical/blockchain/esplora/enum.EsploraError.html" title="enum magical::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-From%3CError%3E-1' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#405-409' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-3' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(other: Error) -> Self</code><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#406-408' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CEsploraError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../magical/blockchain/esplora/enum.EsploraError.html" title="enum magical::blockchain::esplora::EsploraError">EsploraError</a>> for <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CEsploraError%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../../../magical/blockchain/esplora/enum.EsploraError.html" title="enum magical::blockchain::esplora::EsploraError">EsploraError</a>) -> Self</code><a class='srclink' href='../../../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CParseIntError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/num/struct.ParseIntError.html" title="struct core::num::ParseIntError">ParseIntError</a>> for <a class="enum" href="../../../magical/blockchain/esplora/enum.EsploraError.html" title="enum magical::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-From%3CParseIntError%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#399-403' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(other: <a class="struct" href="https://doc.rust-lang.org/nightly/core/num/struct.ParseIntError.html" title="struct core::num::ParseIntError">ParseIntError</a>) -> Self</code><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#400-402' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../magical/blockchain/esplora/enum.EsploraError.html" title="enum magical::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../magical/blockchain/esplora/enum.EsploraError.html" title="enum magical::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../magical/blockchain/esplora/enum.EsploraError.html" title="enum magical::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../magical/blockchain/esplora/enum.EsploraError.html" title="enum magical::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../magical/blockchain/esplora/enum.EsploraError.html" title="enum magical::blockchain::esplora::EsploraError">EsploraError</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-4' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2237-2247' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2239-2246' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `esplora` mod in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, esplora"><title>magical::blockchain::esplora - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module esplora</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'esplora', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#25-409' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a class="mod" href=''>esplora</a></span></h1><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="esplora"</code></strong> only.</div></div><div class='docblock'><p>Esplora</p>
-<p>This module defines an <a href="../../../magical/blockchain/trait.OnlineBlockchain.html" title="`OnlineBlockchain`"><code>OnlineBlockchain</code></a> struct that can query an Esplora backend
-populate the wallet's <a href="../../../magical/database/trait.Database.html">database</a> by</p>
-<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
-<div class="example-wrap"><pre class="rust rust-example-rendered">
-<span class="kw">let</span> <span class="ident">blockchain</span> <span class="op">=</span> <span class="ident">EsploraBlockchain</span>::<span class="ident">new</span>(<span class="string">"https://blockstream.info/testnet/api"</span>);</pre></div>
-</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
-<table><tr class='module-item'><td><a class="struct" href="struct.EsploraBlockchain.html" title='magical::blockchain::esplora::EsploraBlockchain struct'>EsploraBlockchain</a></td><td class='docblock-short'><span class="stab portability"><code>feature="esplora"</code></span><p>Structure that implements the logic to sync with Esplora</p>
-</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
-<table><tr class='module-item'><td><a class="enum" href="enum.EsploraError.html" title='magical::blockchain::esplora::EsploraError enum'>EsploraError</a></td><td class='docblock-short'><span class="stab portability"><code>feature="esplora"</code></span><p>Errors that can happen during a sync with <a href="../../../magical/blockchain/esplora/struct.EsploraBlockchain.html" title="`EsploraBlockchain`"><code>EsploraBlockchain</code></a></p>
-</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"enum":[["EsploraError","Errors that can happen during a sync with [`EsploraBlockchain`]"]],"struct":[["EsploraBlockchain","Structure that implements the logic to sync with Esplora"]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `EsploraBlockchain` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, EsploraBlockchain"><title>magical::blockchain::esplora::EsploraBlockchain - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct EsploraBlockchain</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Blockchain">Blockchain</a><a href="#impl-Debug">Debug</a><a href="#impl-OnlineBlockchain">OnlineBlockchain</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>esplora</a></p><script>window.sidebarCurrent = {name: 'EsploraBlockchain', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#74' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>blockchain</a>::<wbr><a href='index.html'>esplora</a>::<wbr><a class="struct" href=''>EsploraBlockchain</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct EsploraBlockchain(_);</pre></div><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="esplora"</code></strong> only.</div></div><div class='docblock'><p>Structure that implements the logic to sync with Esplora</p>
-<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
-<p>See the <a href="../../../magical/blockchain/esplora/index.html"><code>blockchain::esplora</code></a> module for a usage example.</p>
-</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../magical/blockchain/esplora/struct.EsploraBlockchain.html" title="struct magical::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#82-90' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code>pub fn <a href='#method.new' class='fnname'>new</a>(base_url: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> Self</code><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#84-89' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab portability'>This is supported on <strong><code>feature="esplora"</code></strong> only.</div></div><div class='docblock'><p>Create a new instance of the client from a base URL</p>
-</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Blockchain' class='impl'><code class='in-band'>impl <a class="trait" href="../../../magical/blockchain/trait.Blockchain.html" title="trait magical::blockchain::Blockchain">Blockchain</a> for <a class="struct" href="../../../magical/blockchain/esplora/struct.EsploraBlockchain.html" title="struct magical::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-Blockchain' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#92-100' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.offline' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.Blockchain.html#tymethod.offline' class='fnname'>offline</a>() -> Self</code><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#93-95' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Create a new instance of the client that is offline-only <a href="../../../magical/blockchain/trait.Blockchain.html#tymethod.offline">Read more</a></p>
-</div><h4 id='method.is_online' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.Blockchain.html#tymethod.is_online' class='fnname'>is_online</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#97-99' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return whether or not the client has the ability to fullfill requests <a href="../../../magical/blockchain/trait.Blockchain.html#tymethod.is_online">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../magical/blockchain/esplora/struct.EsploraBlockchain.html" title="struct magical::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#73' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#73' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-OnlineBlockchain' class='impl'><code class='in-band'>impl <a class="trait" href="../../../magical/blockchain/trait.OnlineBlockchain.html" title="trait magical::blockchain::OnlineBlockchain">OnlineBlockchain</a> for <a class="struct" href="../../../magical/blockchain/esplora/struct.EsploraBlockchain.html" title="struct magical::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-OnlineBlockchain' class='anchor'></a><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#103-171' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_capabilities' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.get_capabilities' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a>></code><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#104-112' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the set of <a href="../../../magical/blockchain/enum.Capability.html" title="`Capability`"><code>Capability</code></a> supported by this backend</p>
-</div><h4 id='method.setup' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.setup' class='fnname'>setup</a><D: <a class="trait" href="../../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>, P: <a class="trait" href="../../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#114-125' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Setup the backend and populate the internal database for the first time <a href="../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.setup">Read more</a></p>
-</div><h4 id='method.get_tx' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.get_tx' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#127-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Fetch a transaction from the blockchain given its txid</p>
-</div><h4 id='method.broadcast' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.broadcast' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#135-141' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Broadcast a transaction</p>
-</div><h4 id='method.get_height' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.get_height' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#143-149' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the current height</p>
-</div><h4 id='method.estimate_fee' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.estimate_fee' class='fnname'>estimate_fee</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/esplora.rs.html#151-170' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Estimate the fee rate required to confirm a transaction in a given <code>target</code> of blocks</p>
-</div><h4 id='method.sync' class="method hidden"><code>fn <a href='../../../magical/blockchain/trait.OnlineBlockchain.html#method.sync' class='fnname'>sync</a><D: <a class="trait" href="../../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/blockchain/mod.rs.html#158-165' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Populate the internal database with transactions and UTXOs <a href="../../../magical/blockchain/trait.OnlineBlockchain.html#method.sync">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../magical/blockchain/esplora/struct.EsploraBlockchain.html" title="struct magical::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../magical/blockchain/esplora/struct.EsploraBlockchain.html" title="struct magical::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../magical/blockchain/esplora/struct.EsploraBlockchain.html" title="struct magical::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../magical/blockchain/esplora/struct.EsploraBlockchain.html" title="struct magical::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../magical/blockchain/esplora/struct.EsploraBlockchain.html" title="struct magical::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `log_progress` fn in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, log_progress"><title>magical::blockchain::log_progress - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'log_progress', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#227-229' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="fn" href=''>log_progress</a></span></h1><pre class='rust fn'>pub fn log_progress() -> <a class="struct" href="../../magical/blockchain/struct.LogProgress.html" title="struct magical::blockchain::LogProgress">LogProgress</a></pre><div class='docblock'><p>Create a nwe instance of <a href="../../magical/blockchain/struct.LogProgress.html" title="`LogProgress`"><code>LogProgress</code></a></p>
-</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `noop_progress` fn in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, noop_progress"><title>magical::blockchain::noop_progress - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'noop_progress', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#212-214' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="fn" href=''>noop_progress</a></span></h1><pre class='rust fn'>pub fn noop_progress() -> <a class="struct" href="../../magical/blockchain/struct.NoopProgress.html" title="struct magical::blockchain::NoopProgress">NoopProgress</a></pre><div class='docblock'><p>Create a new instance of <a href="../../magical/blockchain/struct.NoopProgress.html" title="`NoopProgress`"><code>NoopProgress</code></a></p>
-</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `progress` fn in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, progress"><title>magical::blockchain::progress - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'progress', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#192-194' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="fn" href=''>progress</a></span></h1><pre class='rust fn'>pub fn progress() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Sender.html" title="struct std::sync::mpsc::Sender">Sender</a><<a class="type" href="../../magical/blockchain/type.ProgressData.html" title="type magical::blockchain::ProgressData">ProgressData</a>>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Receiver.html" title="struct std::sync::mpsc::Receiver">Receiver</a><<a class="type" href="../../magical/blockchain/type.ProgressData.html" title="type magical::blockchain::ProgressData">ProgressData</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></pre><div class='docblock'><p>Shortcut to create a <a href="https://doc.rust-lang.org/nightly/std/sync/mpsc/fn.channel.html" title="`channel`"><code>channel</code></a> (pair of <a href="https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Sender.html" title="`Sender`"><code>Sender</code></a> and <a href="https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Receiver.html" title="`Receiver`"><code>Receiver</code></a>) that can transport <a href="../../magical/blockchain/type.ProgressData.html" title="`ProgressData`"><code>ProgressData</code></a></p>
-</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `blockchain` mod in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, blockchain"><title>magical::blockchain - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module blockchain</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'><a href='../index.html'>magical</a></p><script>window.sidebarCurrent = {name: 'blockchain', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#25-286' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>magical</a>::<wbr><a class="mod" href=''>blockchain</a></span></h1><div class='docblock'><p>Blockchain backends</p>
-<p>This module provides the implementation of a few commonly-used backends like
-<a href="../../magical/blockchain/electrum/index.html">Electrum</a>, <a href="../../magical/blockchain/esplora/index.html">Esplora</a> and
-<a href="../../magical/blockchain/compact_filters/index.html">Compact Filters/Neutrino</a>, along with two generalized
-traits <a href="../../magical/blockchain/trait.Blockchain.html" title="`Blockchain`"><code>Blockchain</code></a> and <a href="../../magical/blockchain/trait.OnlineBlockchain.html" title="`OnlineBlockchain`"><code>OnlineBlockchain</code></a> that can be implemented to build customized
-backends.</p>
-<p>Types that only implement the <a href="../../magical/blockchain/trait.Blockchain.html" title="`Blockchain`"><code>Blockchain</code></a> trait can be used as backends for <a href="../../magical/wallet/struct.Wallet.html"><code>Wallet</code></a>s, but any
-action that requires interacting with the blockchain won't be available (<a href="../../magical/wallet/struct.Wallet.html#method.sync"><code>Wallet::sync</code></a> and
-<a href="../../magical/wallet/struct.Wallet.html#method.broadcast"><code>Wallet::broadcast</code></a>). This allows the creation of physically air-gapped wallets, that have no
-ability to contact the outside world. An example of an offline-only client is <a href="../../magical/blockchain/struct.OfflineBlockchain.html" title="`OfflineBlockchain`"><code>OfflineBlockchain</code></a>.</p>
-<p>Types that also implement <a href="../../magical/blockchain/trait.OnlineBlockchain.html" title="`OnlineBlockchain`"><code>OnlineBlockchain</code></a> will make the two aforementioned actions
-available.</p>
-</div><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
-<table><tr><td><code>pub use self::electrum::<a class="struct" href="../../magical/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct magical::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a>;</code></td></tr><tr><td><code>pub use self::esplora::<a class="struct" href="../../magical/blockchain/esplora/struct.EsploraBlockchain.html" title="struct magical::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a>;</code></td></tr><tr><td><code>pub use self::compact_filters::<a class="struct" href="../../magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct magical::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a>;</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
-<table><tr class='module-item'><td><a class="mod" href="compact_filters/index.html" title='magical::blockchain::compact_filters mod'>compact_filters</a></td><td class='docblock-short'><span class="stab portability"><code>feature="compact_filters"</code></span><p>Compact Filters</p>
-</td></tr><tr class='module-item'><td><a class="mod" href="electrum/index.html" title='magical::blockchain::electrum mod'>electrum</a></td><td class='docblock-short'><span class="stab portability"><code>feature="electrum"</code></span><p>Electrum</p>
-</td></tr><tr class='module-item'><td><a class="mod" href="esplora/index.html" title='magical::blockchain::esplora mod'>esplora</a></td><td class='docblock-short'><span class="stab portability"><code>feature="esplora"</code></span><p>Esplora</p>
-</td></tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
-<table><tr class='module-item'><td><a class="struct" href="struct.LogProgress.html" title='magical::blockchain::LogProgress struct'>LogProgress</a></td><td class='docblock-short'><p>Type that implements <a href="../../magical/blockchain/trait.Progress.html" title="`Progress`"><code>Progress</code></a> and logs at level <code>INFO</code> every update received</p>
-</td></tr><tr class='module-item'><td><a class="struct" href="struct.NoopProgress.html" title='magical::blockchain::NoopProgress struct'>NoopProgress</a></td><td class='docblock-short'><p>Type that implements <a href="../../magical/blockchain/trait.Progress.html" title="`Progress`"><code>Progress</code></a> and drops every update received</p>
-</td></tr><tr class='module-item'><td><a class="struct" href="struct.OfflineBlockchain.html" title='magical::blockchain::OfflineBlockchain struct'>OfflineBlockchain</a></td><td class='docblock-short'><p>Type that only implements <a href="../../magical/blockchain/trait.Blockchain.html" title="`Blockchain`"><code>Blockchain</code></a> and is always offline</p>
-</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
-<table><tr class='module-item'><td><a class="enum" href="enum.Capability.html" title='magical::blockchain::Capability enum'>Capability</a></td><td class='docblock-short'><p>Capabilities that can be supported by an <a href="../../magical/blockchain/trait.OnlineBlockchain.html" title="`OnlineBlockchain`"><code>OnlineBlockchain</code></a> backend</p>
-</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
-<table><tr class='module-item'><td><a class="trait" href="trait.Blockchain.html" title='magical::blockchain::Blockchain trait'>Blockchain</a></td><td class='docblock-short'><p>Base trait for a blockchain backend</p>
-</td></tr><tr class='module-item'><td><a class="trait" href="trait.OnlineBlockchain.html" title='magical::blockchain::OnlineBlockchain trait'>OnlineBlockchain</a></td><td class='docblock-short'><p>Trait that defines the actions that must be supported by an online <a href="../../magical/blockchain/trait.Blockchain.html" title="`Blockchain`"><code>Blockchain</code></a></p>
-</td></tr><tr class='module-item'><td><a class="trait" href="trait.Progress.html" title='magical::blockchain::Progress trait'>Progress</a></td><td class='docblock-short'><p>Trait for types that can receive and process progress updates during <a href="../../magical/blockchain/trait.OnlineBlockchain.html#method.sync" title="`OnlineBlockchain::sync`"><code>OnlineBlockchain::sync</code></a> and
-<a href="../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.setup" title="`OnlineBlockchain::setup`"><code>OnlineBlockchain::setup</code></a></p>
-</td></tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
-<table><tr class='module-item'><td><a class="fn" href="fn.log_progress.html" title='magical::blockchain::log_progress fn'>log_progress</a></td><td class='docblock-short'><p>Create a nwe instance of <a href="../../magical/blockchain/struct.LogProgress.html" title="`LogProgress`"><code>LogProgress</code></a></p>
-</td></tr><tr class='module-item'><td><a class="fn" href="fn.noop_progress.html" title='magical::blockchain::noop_progress fn'>noop_progress</a></td><td class='docblock-short'><p>Create a new instance of <a href="../../magical/blockchain/struct.NoopProgress.html" title="`NoopProgress`"><code>NoopProgress</code></a></p>
-</td></tr><tr class='module-item'><td><a class="fn" href="fn.progress.html" title='magical::blockchain::progress fn'>progress</a></td><td class='docblock-short'><p>Shortcut to create a <a href="https://doc.rust-lang.org/nightly/std/sync/mpsc/fn.channel.html" title="`channel`"><code>channel</code></a> (pair of <a href="https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Sender.html" title="`Sender`"><code>Sender</code></a> and <a href="https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Receiver.html" title="`Receiver`"><code>Receiver</code></a>) that can transport <a href="../../magical/blockchain/type.ProgressData.html" title="`ProgressData`"><code>ProgressData</code></a></p>
-</td></tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
-<table><tr class='module-item'><td><a class="type" href="type.ProgressData.html" title='magical::blockchain::ProgressData type'>ProgressData</a></td><td class='docblock-short'><p>Data sent with a progress update over a <a href="https://doc.rust-lang.org/nightly/std/sync/mpsc/fn.channel.html" title="`channel`"><code>channel</code></a></p>
-</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"enum":[["Capability","Capabilities that can be supported by an [`OnlineBlockchain`] backend"]],"fn":[["log_progress","Create a nwe instance of [`LogProgress`]"],["noop_progress","Create a new instance of [`NoopProgress`]"],["progress","Shortcut to create a [`channel`] (pair of [`Sender`] and [`Receiver`]) that can transport [`ProgressData`]"]],"mod":[["compact_filters","Compact Filters"],["electrum","Electrum"],["esplora","Esplora"]],"struct":[["LogProgress","Type that implements [`Progress`] and logs at level `INFO` every update received"],["NoopProgress","Type that implements [`Progress`] and drops every update received"],["OfflineBlockchain","Type that only implements [`Blockchain`] and is always offline"]],"trait":[["Blockchain","Base trait for a blockchain backend"],["OnlineBlockchain","Trait that defines the actions that must be supported by an online [`Blockchain`]"],["Progress","Trait for types that can receive and process progress updates during [`OnlineBlockchain::sync`] and [`OnlineBlockchain::setup`]"]],"type":[["ProgressData","Data sent with a progress update over a [`channel`]"]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `LogProgress` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, LogProgress"><title>magical::blockchain::LogProgress - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct LogProgress</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Progress">Progress</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'LogProgress', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#224' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="struct" href=''>LogProgress</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct LogProgress;</pre></div><div class='docblock'><p>Type that implements <a href="../../magical/blockchain/trait.Progress.html" title="`Progress`"><code>Progress</code></a> and logs at level <code>INFO</code> every update received</p>
-</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../magical/blockchain/struct.LogProgress.html" title="struct magical::blockchain::LogProgress">LogProgress</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#223' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../magical/blockchain/struct.LogProgress.html" title="struct magical::blockchain::LogProgress">LogProgress</a></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Progress' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a> for <a class="struct" href="../../magical/blockchain/struct.LogProgress.html" title="struct magical::blockchain::LogProgress">LogProgress</a></code><a href='#impl-Progress' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#231-237' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.update' class="method hidden"><code>fn <a href='../../magical/blockchain/trait.Progress.html#tymethod.update' class='fnname'>update</a>(&self, progress: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, message: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#232-236' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Send a new progress update <a href="../../magical/blockchain/trait.Progress.html#tymethod.update">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../magical/blockchain/struct.LogProgress.html" title="struct magical::blockchain::LogProgress">LogProgress</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../magical/blockchain/struct.LogProgress.html" title="struct magical::blockchain::LogProgress">LogProgress</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../magical/blockchain/struct.LogProgress.html" title="struct magical::blockchain::LogProgress">LogProgress</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../magical/blockchain/struct.LogProgress.html" title="struct magical::blockchain::LogProgress">LogProgress</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../magical/blockchain/struct.LogProgress.html" title="struct magical::blockchain::LogProgress">LogProgress</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `NoopProgress` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, NoopProgress"><title>magical::blockchain::NoopProgress - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct NoopProgress</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Progress">Progress</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'NoopProgress', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#209' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="struct" href=''>NoopProgress</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct NoopProgress;</pre></div><div class='docblock'><p>Type that implements <a href="../../magical/blockchain/trait.Progress.html" title="`Progress`"><code>Progress</code></a> and drops every update received</p>
-</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../magical/blockchain/struct.NoopProgress.html" title="struct magical::blockchain::NoopProgress">NoopProgress</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#208' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../magical/blockchain/struct.NoopProgress.html" title="struct magical::blockchain::NoopProgress">NoopProgress</a></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#208' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Progress' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a> for <a class="struct" href="../../magical/blockchain/struct.NoopProgress.html" title="struct magical::blockchain::NoopProgress">NoopProgress</a></code><a href='#impl-Progress' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#216-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.update' class="method hidden"><code>fn <a href='../../magical/blockchain/trait.Progress.html#tymethod.update' class='fnname'>update</a>(&self, _progress: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, _message: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#217-219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Send a new progress update <a href="../../magical/blockchain/trait.Progress.html#tymethod.update">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../magical/blockchain/struct.NoopProgress.html" title="struct magical::blockchain::NoopProgress">NoopProgress</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../magical/blockchain/struct.NoopProgress.html" title="struct magical::blockchain::NoopProgress">NoopProgress</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../magical/blockchain/struct.NoopProgress.html" title="struct magical::blockchain::NoopProgress">NoopProgress</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../magical/blockchain/struct.NoopProgress.html" title="struct magical::blockchain::NoopProgress">NoopProgress</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../magical/blockchain/struct.NoopProgress.html" title="struct magical::blockchain::NoopProgress">NoopProgress</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `OfflineBlockchain` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, OfflineBlockchain"><title>magical::blockchain::OfflineBlockchain - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct OfflineBlockchain</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Blockchain">Blockchain</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'OfflineBlockchain', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#106' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="struct" href=''>OfflineBlockchain</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct OfflineBlockchain;</pre></div><div class='docblock'><p>Type that only implements <a href="../../magical/blockchain/trait.Blockchain.html" title="`Blockchain`"><code>Blockchain</code></a> and is always offline</p>
-</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Blockchain' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/blockchain/trait.Blockchain.html" title="trait magical::blockchain::Blockchain">Blockchain</a> for <a class="struct" href="../../magical/blockchain/struct.OfflineBlockchain.html" title="struct magical::blockchain::OfflineBlockchain">OfflineBlockchain</a></code><a href='#impl-Blockchain' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#107-115' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.offline' class="method hidden"><code>fn <a href='../../magical/blockchain/trait.Blockchain.html#tymethod.offline' class='fnname'>offline</a>() -> Self</code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#108-110' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Create a new instance of the client that is offline-only <a href="../../magical/blockchain/trait.Blockchain.html#tymethod.offline">Read more</a></p>
-</div><h4 id='method.is_online' class="method hidden"><code>fn <a href='../../magical/blockchain/trait.Blockchain.html#tymethod.is_online' class='fnname'>is_online</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#112-114' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return whether or not the client has the ability to fullfill requests <a href="../../magical/blockchain/trait.Blockchain.html#tymethod.is_online">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../magical/blockchain/struct.OfflineBlockchain.html" title="struct magical::blockchain::OfflineBlockchain">OfflineBlockchain</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../magical/blockchain/struct.OfflineBlockchain.html" title="struct magical::blockchain::OfflineBlockchain">OfflineBlockchain</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../magical/blockchain/struct.OfflineBlockchain.html" title="struct magical::blockchain::OfflineBlockchain">OfflineBlockchain</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../magical/blockchain/struct.OfflineBlockchain.html" title="struct magical::blockchain::OfflineBlockchain">OfflineBlockchain</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../magical/blockchain/struct.OfflineBlockchain.html" title="struct magical::blockchain::OfflineBlockchain">OfflineBlockchain</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Blockchain` trait in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Blockchain"><title>magical::blockchain::Blockchain - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait Blockchain</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.is_online">is_online</a><a href="#tymethod.offline">offline</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-Blockchain-for-Arc%3CT%3E">Arc<T></a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'Blockchain', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#87-103' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="trait" href=''>Blockchain</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait Blockchain {
- fn <a href='#tymethod.is_online' class='fnname'>is_online</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>;
-<div class='item-spacer'></div> fn <a href='#tymethod.offline' class='fnname'>offline</a>() -> Self;
-}</pre></div><div class='docblock'><p>Base trait for a blockchain backend</p>
-<p>This trait is always required, even for "air-gapped" backends that don't actually make any
-external call. Clients that have the ability to make external calls must also implement <code>OnlineBlockchain</code>.</p>
-</div>
- <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.is_online' class='method'><code>fn <a href='#tymethod.is_online' class='fnname'>is_online</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h3><div class='docblock'><p>Return whether or not the client has the ability to fullfill requests</p>
-<p>This should always be <code>false</code> for offline-only types, and can be true for types that also
-implement <a href="../../magical/blockchain/trait.OnlineBlockchain.html" title="`OnlineBlockchain`"><code>OnlineBlockchain</code></a>, if they have the ability to fullfill requests.</p>
-</div><h3 id='tymethod.offline' class='method'><code>fn <a href='#tymethod.offline' class='fnname'>offline</a>() -> Self</code></h3><div class='docblock'><p>Create a new instance of the client that is offline-only</p>
-<p>For types that also implement <a href="../../magical/blockchain/trait.OnlineBlockchain.html" title="`OnlineBlockchain`"><code>OnlineBlockchain</code></a>, this means creating an instance that
-returns <a href="../../magical/enum.Error.html#variant.OfflineClient"><code>Error::OfflineClient</code></a> if any of the "online"
-methods are called.</p>
-<p>This is generally implemented by wrapping the client in an <a href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="`Option`"><code>Option</code></a> that has <a href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html#variant.None" title="`Option::None`"><code>Option::None</code></a> value
-when created with this method, and is <a href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html#variant.Some" title="`Option::Some`"><code>Option::Some</code></a> if properly instantiated.</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-Blockchain-for-Arc%3CT%3E' class='impl'><code class='in-band'>impl<T: <a class="trait" href="../../magical/blockchain/trait.Blockchain.html" title="trait magical::blockchain::Blockchain">Blockchain</a>> <a class="trait" href="../../magical/blockchain/trait.Blockchain.html" title="trait magical::blockchain::Blockchain">Blockchain</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><T></code><a href='#impl-Blockchain-for-Arc%3CT%3E' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#239-247' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.is_online' class="method hidden"><code>fn <a href='#method.is_online' class='fnname'>is_online</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#240-242' title='goto source code'>[src]</a></h4><h4 id='method.offline' class="method hidden"><code>fn <a href='#method.offline' class='fnname'>offline</a>() -> Self</code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#244-246' title='goto source code'>[src]</a></h4></div><span class='loading-content'>Loading content...</span>
- <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-Blockchain' class='impl'><code class='in-band'>impl Blockchain for <a class="struct" href="../../magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct magical::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-Blockchain' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/compact_filters/mod.rs.html#252-260' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.offline-1' class="method hidden"><code>fn <a href='#method.offline-1' class='fnname'>offline</a>() -> Self</code><a class='srclink' href='../../src/magical/blockchain/compact_filters/mod.rs.html#253-255' title='goto source code'>[src]</a></h4><h4 id='method.is_online-1' class="method hidden"><code>fn <a href='#method.is_online-1' class='fnname'>is_online</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/magical/blockchain/compact_filters/mod.rs.html#257-259' title='goto source code'>[src]</a></h4></div><h3 id='impl-Blockchain-1' class='impl'><code class='in-band'>impl Blockchain for <a class="struct" href="../../magical/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct magical::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-Blockchain-1' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/electrum.rs.html#74-82' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.offline-2' class="method hidden"><code>fn <a href='#method.offline-2' class='fnname'>offline</a>() -> Self</code><a class='srclink' href='../../src/magical/blockchain/electrum.rs.html#75-77' title='goto source code'>[src]</a></h4><h4 id='method.is_online-2' class="method hidden"><code>fn <a href='#method.is_online-2' class='fnname'>is_online</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/magical/blockchain/electrum.rs.html#79-81' title='goto source code'>[src]</a></h4></div><h3 id='impl-Blockchain-2' class='impl'><code class='in-band'>impl Blockchain for <a class="struct" href="../../magical/blockchain/esplora/struct.EsploraBlockchain.html" title="struct magical::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-Blockchain-2' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/esplora.rs.html#92-100' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.offline-3' class="method hidden"><code>fn <a href='#method.offline-3' class='fnname'>offline</a>() -> Self</code><a class='srclink' href='../../src/magical/blockchain/esplora.rs.html#93-95' title='goto source code'>[src]</a></h4><h4 id='method.is_online-3' class="method hidden"><code>fn <a href='#method.is_online-3' class='fnname'>is_online</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/magical/blockchain/esplora.rs.html#97-99' title='goto source code'>[src]</a></h4></div><h3 id='impl-Blockchain-3' class='impl'><code class='in-band'>impl Blockchain for <a class="struct" href="../../magical/blockchain/struct.OfflineBlockchain.html" title="struct magical::blockchain::OfflineBlockchain">OfflineBlockchain</a></code><a href='#impl-Blockchain-3' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#107-115' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.offline-4' class="method hidden"><code>fn <a href='#method.offline-4' class='fnname'>offline</a>() -> Self</code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#108-110' title='goto source code'>[src]</a></h4><h4 id='method.is_online-4' class="method hidden"><code>fn <a href='#method.is_online-4' class='fnname'>is_online</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#112-114' title='goto source code'>[src]</a></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/magical/blockchain/trait.Blockchain.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `OnlineBlockchain` trait in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, OnlineBlockchain"><title>magical::blockchain::OnlineBlockchain - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait OnlineBlockchain</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.broadcast">broadcast</a><a href="#tymethod.estimate_fee">estimate_fee</a><a href="#tymethod.get_capabilities">get_capabilities</a><a href="#tymethod.get_height">get_height</a><a href="#tymethod.get_tx">get_tx</a><a href="#tymethod.setup">setup</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.sync">sync</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-OnlineBlockchain-for-Arc%3CT%3E">Arc<T></a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'OnlineBlockchain', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#119-176' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="trait" href=''>OnlineBlockchain</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait OnlineBlockchain: <a class="trait" href="../../magical/blockchain/trait.Blockchain.html" title="trait magical::blockchain::Blockchain">Blockchain</a> {
- fn <a href='#tymethod.get_capabilities' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.setup' class='fnname'>setup</a><D: <a class="trait" href="../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.get_tx' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.broadcast' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.get_height' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.estimate_fee' class='fnname'>estimate_fee</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-
- fn <a href='#method.sync' class='fnname'>sync</a><D: <a class="trait" href="../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>> { ... }
-}</pre></div><div class='docblock'><p>Trait that defines the actions that must be supported by an online <a href="../../magical/blockchain/trait.Blockchain.html" title="`Blockchain`"><code>Blockchain</code></a></p>
-</div>
- <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.get_capabilities' class='method'><code>fn <a href='#tymethod.get_capabilities' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a>></code></h3><div class='docblock'><p>Return the set of <a href="../../magical/blockchain/enum.Capability.html" title="`Capability`"><code>Capability</code></a> supported by this backend</p>
-</div><h3 id='tymethod.setup' class='method'><code>fn <a href='#tymethod.setup' class='fnname'>setup</a><D: <a class="trait" href="../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Setup the backend and populate the internal database for the first time</p>
-<p>This method is the equivalent of <a href="../../magical/blockchain/trait.OnlineBlockchain.html#method.sync" title="`OnlineBlockchain::sync`"><code>OnlineBlockchain::sync</code></a>, but it's guaranteed to only be
-called once, at the first <a href="../../magical/wallet/struct.Wallet.html#method.sync"><code>Wallet::sync</code></a>.</p>
-<p>The rationale behind the distinction between <code>sync</code> and <code>setup</code> is that some custom backends
-might need to perform specific actions only the first time they are synced.</p>
-<p>For types that do not have that distinction, only this method can be implemented, since
-<a href="../../magical/blockchain/trait.OnlineBlockchain.html#method.sync" title="`OnlineBlockchain::sync`"><code>OnlineBlockchain::sync</code></a> defaults to calling this internally if not overridden.</p>
-</div><h3 id='tymethod.get_tx' class='method'><code>fn <a href='#tymethod.get_tx' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Fetch a transaction from the blockchain given its txid</p>
-</div><h3 id='tymethod.broadcast' class='method'><code>fn <a href='#tymethod.broadcast' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Broadcast a transaction</p>
-</div><h3 id='tymethod.get_height' class='method'><code>fn <a href='#tymethod.get_height' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Return the current height</p>
-</div><h3 id='tymethod.estimate_fee' class='method'><code>fn <a href='#tymethod.estimate_fee' class='fnname'>estimate_fee</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Estimate the fee rate required to confirm a transaction in a given <code>target</code> of blocks</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='provided-methods' class='small-section-header'>Provided methods<a href='#provided-methods' class='anchor'></a></h2><div class='methods'><h3 id='method.sync' class='method'><code>fn <a href='#method.sync' class='fnname'>sync</a><D: <a class="trait" href="../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Populate the internal database with transactions and UTXOs</p>
-<p>If not overridden, it defaults to calling <a href="../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.setup" title="`OnlineBlockchain::setup`"><code>OnlineBlockchain::setup</code></a> internally.</p>
-<p>This method should implement the logic required to iterate over the list of the wallet's
-script_pubkeys using <a href="../../magical/database/trait.Database.html#tymethod.iter_script_pubkeys"><code>Database::iter_script_pubkeys</code></a> and look for relevant transactions
-in the blockchain to populate the database with <a href="../../magical/database/trait.BatchOperations.html#tymethod.set_tx"><code>BatchOperations::set_tx</code></a> and
-<a href="../../magical/database/trait.BatchOperations.html#tymethod.set_utxo"><code>BatchOperations::set_utxo</code></a>.</p>
-<p>This method should also take care of removing UTXOs that are seen as spent in the
-blockchain, using <a href="../../magical/database/trait.BatchOperations.html#tymethod.del_utxo"><code>BatchOperations::del_utxo</code></a>.</p>
-<p>The <code>progress_update</code> object can be used to give the caller updates about the progress by using
-<a href="../../magical/blockchain/trait.Progress.html#tymethod.update" title="`Progress::update`"><code>Progress::update</code></a>.</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-OnlineBlockchain-for-Arc%3CT%3E' class='impl'><code class='in-band'>impl<T: <a class="trait" href="../../magical/blockchain/trait.OnlineBlockchain.html" title="trait magical::blockchain::OnlineBlockchain">OnlineBlockchain</a>> <a class="trait" href="../../magical/blockchain/trait.OnlineBlockchain.html" title="trait magical::blockchain::OnlineBlockchain">OnlineBlockchain</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><T></code><a href='#impl-OnlineBlockchain-for-Arc%3CT%3E' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#250-286' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_capabilities' class="method hidden"><code>fn <a href='#method.get_capabilities' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a>></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#251-253' title='goto source code'>[src]</a></h4><h4 id='method.setup' class="method hidden"><code>fn <a href='#method.setup' class='fnname'>setup</a><D: <a class="trait" href="../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#255-262' title='goto source code'>[src]</a></h4><h4 id='method.sync-1' class="method hidden"><code>fn <a href='#method.sync' class='fnname'>sync</a><D: <a class="trait" href="../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#264-271' title='goto source code'>[src]</a></h4><h4 id='method.get_tx' class="method hidden"><code>fn <a href='#method.get_tx' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#273-275' title='goto source code'>[src]</a></h4><h4 id='method.broadcast' class="method hidden"><code>fn <a href='#method.broadcast' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#276-278' title='goto source code'>[src]</a></h4><h4 id='method.get_height' class="method hidden"><code>fn <a href='#method.get_height' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#280-282' title='goto source code'>[src]</a></h4><h4 id='method.estimate_fee' class="method hidden"><code>fn <a href='#method.estimate_fee' class='fnname'>estimate_fee</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#283-285' title='goto source code'>[src]</a></h4></div><span class='loading-content'>Loading content...</span>
- <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-OnlineBlockchain' class='impl'><code class='in-band'>impl OnlineBlockchain for <a class="struct" href="../../magical/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct magical::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href='#impl-OnlineBlockchain' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/compact_filters/mod.rs.html#262-496' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_capabilities-1' class="method hidden"><code>fn <a href='#method.get_capabilities-1' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a>></code><a class='srclink' href='../../src/magical/blockchain/compact_filters/mod.rs.html#263-265' title='goto source code'>[src]</a></h4><h4 id='method.setup-1' class="method hidden"><code>fn <a href='#method.setup-1' class='fnname'>setup</a><D: <a class="trait" href="../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>, P: 'static + <a class="trait" href="../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a>>(<br> &self, <br> _stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/compact_filters/mod.rs.html#267-469' title='goto source code'>[src]</a></h4><h4 id='method.get_tx-1' class="method hidden"><code>fn <a href='#method.get_tx-1' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/compact_filters/mod.rs.html#471-477' title='goto source code'>[src]</a></h4><h4 id='method.broadcast-1' class="method hidden"><code>fn <a href='#method.broadcast-1' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/compact_filters/mod.rs.html#479-484' title='goto source code'>[src]</a></h4><h4 id='method.get_height-1' class="method hidden"><code>fn <a href='#method.get_height-1' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/compact_filters/mod.rs.html#486-490' title='goto source code'>[src]</a></h4><h4 id='method.estimate_fee-1' class="method hidden"><code>fn <a href='#method.estimate_fee-1' class='fnname'>estimate_fee</a>(&self, _target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/compact_filters/mod.rs.html#492-495' title='goto source code'>[src]</a></h4></div><h3 id='impl-OnlineBlockchain-1' class='impl'><code class='in-band'>impl OnlineBlockchain for <a class="struct" href="../../magical/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct magical::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href='#impl-OnlineBlockchain-1' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/electrum.rs.html#84-144' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_capabilities-2' class="method hidden"><code>fn <a href='#method.get_capabilities-2' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a>></code><a class='srclink' href='../../src/magical/blockchain/electrum.rs.html#85-93' title='goto source code'>[src]</a></h4><h4 id='method.setup-2' class="method hidden"><code>fn <a href='#method.setup-2' class='fnname'>setup</a><D: <a class="trait" href="../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>, P: <a class="trait" href="../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/electrum.rs.html#95-105' title='goto source code'>[src]</a></h4><h4 id='method.get_tx-2' class="method hidden"><code>fn <a href='#method.get_tx-2' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/electrum.rs.html#107-114' title='goto source code'>[src]</a></h4><h4 id='method.broadcast-2' class="method hidden"><code>fn <a href='#method.broadcast-2' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/electrum.rs.html#116-123' title='goto source code'>[src]</a></h4><h4 id='method.get_height-2' class="method hidden"><code>fn <a href='#method.get_height-2' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/electrum.rs.html#125-134' title='goto source code'>[src]</a></h4><h4 id='method.estimate_fee-2' class="method hidden"><code>fn <a href='#method.estimate_fee-2' class='fnname'>estimate_fee</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/electrum.rs.html#136-143' title='goto source code'>[src]</a></h4></div><h3 id='impl-OnlineBlockchain-2' class='impl'><code class='in-band'>impl OnlineBlockchain for <a class="struct" href="../../magical/blockchain/esplora/struct.EsploraBlockchain.html" title="struct magical::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href='#impl-OnlineBlockchain-2' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/esplora.rs.html#103-171' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_capabilities-3' class="method hidden"><code>fn <a href='#method.get_capabilities-3' class='fnname'>get_capabilities</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="../../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a>></code><a class='srclink' href='../../src/magical/blockchain/esplora.rs.html#104-112' title='goto source code'>[src]</a></h4><h4 id='method.setup-3' class="method hidden"><code>fn <a href='#method.setup-3' class='fnname'>setup</a><D: <a class="trait" href="../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>, P: <a class="trait" href="../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a>>(<br> &self, <br> stop_gap: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>D, <br> progress_update: P<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/esplora.rs.html#114-125' title='goto source code'>[src]</a></h4><h4 id='method.get_tx-3' class="method hidden"><code>fn <a href='#method.get_tx-3' class='fnname'>get_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/esplora.rs.html#127-133' title='goto source code'>[src]</a></h4><h4 id='method.broadcast-3' class="method hidden"><code>fn <a href='#method.broadcast-3' class='fnname'>broadcast</a>(&self, tx: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/esplora.rs.html#135-141' title='goto source code'>[src]</a></h4><h4 id='method.get_height-3' class="method hidden"><code>fn <a href='#method.get_height-3' class='fnname'>get_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/esplora.rs.html#143-149' title='goto source code'>[src]</a></h4><h4 id='method.estimate_fee-3' class="method hidden"><code>fn <a href='#method.estimate_fee-3' class='fnname'>estimate_fee</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/esplora.rs.html#151-170' title='goto source code'>[src]</a></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/magical/blockchain/trait.OnlineBlockchain.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Progress` trait in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Progress"><title>magical::blockchain::Progress - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait Progress</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.update">update</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-Progress-for-Sender%3CProgressData%3E">Sender<ProgressData></a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'Progress', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#183-189' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="trait" href=''>Progress</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait Progress: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> {
- fn <a href='#tymethod.update' class='fnname'>update</a>(<br> &self, <br> progress: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, <br> message: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-}</pre></div><div class='docblock'><p>Trait for types that can receive and process progress updates during <a href="../../magical/blockchain/trait.OnlineBlockchain.html#method.sync" title="`OnlineBlockchain::sync`"><code>OnlineBlockchain::sync</code></a> and
-<a href="../../magical/blockchain/trait.OnlineBlockchain.html#tymethod.setup" title="`OnlineBlockchain::setup`"><code>OnlineBlockchain::setup</code></a></p>
-</div>
- <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.update' class='method'><code>fn <a href='#tymethod.update' class='fnname'>update</a>(&self, progress: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, message: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Send a new progress update</p>
-<p>The <code>progress</code> value should be in the range 0.0 - 100.0, and the <code>message</code> value is an
-optional text message that can be displayed to the user.</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-Progress-for-Sender%3CProgressData%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Sender.html" title="struct std::sync::mpsc::Sender">Sender</a><<a class="type" href="../../magical/blockchain/type.ProgressData.html" title="type magical::blockchain::ProgressData">ProgressData</a>></code><a href='#impl-Progress-for-Sender%3CProgressData%3E' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#196-205' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.update' class="method hidden"><code>fn <a href='#method.update' class='fnname'>update</a>(&self, progress: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, message: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#197-204' title='goto source code'>[src]</a></h4></div><span class='loading-content'>Loading content...</span>
- <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-Progress' class='impl'><code class='in-band'>impl Progress for <a class="struct" href="../../magical/blockchain/struct.LogProgress.html" title="struct magical::blockchain::LogProgress">LogProgress</a></code><a href='#impl-Progress' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#231-237' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.update-1' class="method hidden"><code>fn <a href='#method.update-1' class='fnname'>update</a>(&self, progress: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, message: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#232-236' title='goto source code'>[src]</a></h4></div><h3 id='impl-Progress-1' class='impl'><code class='in-band'>impl Progress for <a class="struct" href="../../magical/blockchain/struct.NoopProgress.html" title="struct magical::blockchain::NoopProgress">NoopProgress</a></code><a href='#impl-Progress-1' class='anchor'></a><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#216-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.update-2' class="method hidden"><code>fn <a href='#method.update-2' class='fnname'>update</a>(&self, _progress: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, _message: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#217-219' title='goto source code'>[src]</a></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/magical/blockchain/trait.Progress.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ProgressData` type in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, ProgressData"><title>magical::blockchain::ProgressData - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition ProgressData</p><div class="sidebar-elems"><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a></p><script>window.sidebarCurrent = {name: 'ProgressData', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/blockchain/mod.rs.html#179' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='../index.html'>magical</a>::<wbr><a href='index.html'>blockchain</a>::<wbr><a class="type" href=''>ProgressData</a></span></h1><pre class='rust typedef'>type ProgressData = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>;</pre><div class='docblock'><p>Data sent with a progress update over a <a href="https://doc.rust-lang.org/nightly/std/sync/mpsc/fn.channel.html" title="`channel`"><code>channel</code></a></p>
-</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `database` mod in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, database"><title>magical::database - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module database</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#traits">Traits</a></li></ul></div><p class='location'><a href='../index.html'>magical</a></p><script>window.sidebarCurrent = {name: 'database', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/database/mod.rs.html#25-368' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>magical</a>::<wbr><a class="mod" href=''>database</a></span></h1><div class='docblock'><p>Database types</p>
-<p>This module provides the implementation of some defaults database types, along with traits that
-can be implemented externally to let <a href="../../magical/wallet/struct.Wallet.html"><code>Wallet</code></a>s use customized databases.</p>
-<p>It's important to note that the databases defined here only contains "blockchain-related" data.
-They can be seen more as a cache than a critical piece of storage that contains secrets and
-keys.</p>
-<p>The currently recommended database is [<code>sled</code>], which is a pretty simple key-value embedded
-database written in Rust. If the <code>key-value-db</code> feature is enabled (which by default is),
-this library automatically implements all the required traits for [<code>sled::Tree</code>].</p>
-</div><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
-<table><tr><td><code>pub use memory::<a class="struct" href="../../magical/database/memory/struct.MemoryDatabase.html" title="struct magical::database::memory::MemoryDatabase">MemoryDatabase</a>;</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
-<table><tr class='module-item'><td><a class="mod" href="memory/index.html" title='magical::database::memory mod'>memory</a></td><td class='docblock-short'><p>In-memory ephemeral database</p>
-</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
-<table><tr class='module-item'><td><a class="trait" href="trait.BatchDatabase.html" title='magical::database::BatchDatabase trait'>BatchDatabase</a></td><td class='docblock-short'><p>Trait for a database that supports batch operations</p>
-</td></tr><tr class='module-item'><td><a class="trait" href="trait.BatchOperations.html" title='magical::database::BatchOperations trait'>BatchOperations</a></td><td class='docblock-short'><p>Trait for operations that can be batched</p>
-</td></tr><tr class='module-item'><td><a class="trait" href="trait.Database.html" title='magical::database::Database trait'>Database</a></td><td class='docblock-short'><p>Trait for reading data from a database</p>
-</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `memory` mod in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, memory"><title>magical::database::memory - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module memory</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>database</a></p><script>window.sidebarCurrent = {name: 'memory', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/database/memory.rs.html#25-558' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>database</a>::<wbr><a class="mod" href=''>memory</a></span></h1><div class='docblock'><p>In-memory ephemeral database</p>
-<p>This module defines an in-memory database type called <a href="../../../magical/database/memory/struct.MemoryDatabase.html" title="`MemoryDatabase`"><code>MemoryDatabase</code></a> that is based on a
-<a href="https://doc.rust-lang.org/nightly/alloc/collections/btree/map/struct.BTreeMap.html" title="`BTreeMap`"><code>BTreeMap</code></a>.</p>
-</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
-<table><tr class='module-item'><td><a class="struct" href="struct.MemoryDatabase.html" title='magical::database::memory::MemoryDatabase struct'>MemoryDatabase</a></td><td class='docblock-short'><p>In-memory ephemeral database</p>
-</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"struct":[["MemoryDatabase","In-memory ephemeral database"]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `MemoryDatabase` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, MemoryDatabase"><title>magical::database::memory::MemoryDatabase - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct MemoryDatabase</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-BatchDatabase">BatchDatabase</a><a href="#impl-BatchOperations">BatchOperations</a><a href="#impl-Database">Database</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>database</a>::<wbr><a href='index.html'>memory</a></p><script>window.sidebarCurrent = {name: 'MemoryDatabase', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/database/memory.rs.html#125-128' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>database</a>::<wbr><a href='index.html'>memory</a>::<wbr><a class="struct" href=''>MemoryDatabase</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct MemoryDatabase { /* fields omitted */ }</pre></div><div class='docblock'><p>In-memory ephemeral database</p>
-<p>This database can be used as a temporary storage for wallets that are not kept permanently on
-a device, or on platforms that don't provide a filesystem, like <code>wasm32</code>.</p>
-<p>Once it's dropped its content will be lost.</p>
-<p>If you are looking for a permanent storage solution, you can try with the default key-value
-database called [<code>sled</code>]. See the <a href="../../../magical/database/index.html"><code>database</code></a> module documentation for more defailts.</p>
-</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../magical/database/memory/struct.MemoryDatabase.html" title="struct magical::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/magical/database/memory.rs.html#130-138' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code>pub fn <a href='#method.new' class='fnname'>new</a>() -> Self</code><a class='srclink' href='../../../src/magical/database/memory.rs.html#132-137' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new empty database</p>
-</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-BatchDatabase' class='impl'><code class='in-band'>impl <a class="trait" href="../../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a> for <a class="struct" href="../../../magical/database/memory/struct.MemoryDatabase.html" title="struct magical::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-BatchDatabase' class='anchor'></a><a class='srclink' href='../../../src/magical/database/memory.rs.html#437-451' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Batch' class="type"><code>type <a href='../../../magical/database/trait.BatchDatabase.html#associatedtype.Batch' class="type">Batch</a> = Self</code></h4><div class='docblock'><p>Container for the operations</p>
-</div><h4 id='method.begin_batch' class="method hidden"><code>fn <a href='../../../magical/database/trait.BatchDatabase.html#tymethod.begin_batch' class='fnname'>begin_batch</a>(&self) -> Self::<a class="type" href="../../../magical/database/trait.BatchDatabase.html#associatedtype.Batch" title="type magical::database::BatchDatabase::Batch">Batch</a></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#440-442' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Create a new batch container</p>
-</div><h4 id='method.commit_batch' class="method hidden"><code>fn <a href='../../../magical/database/trait.BatchDatabase.html#tymethod.commit_batch' class='fnname'>commit_batch</a>(&mut self, batch: Self::<a class="type" href="../../../magical/database/trait.BatchDatabase.html#associatedtype.Batch" title="type magical::database::BatchDatabase::Batch">Batch</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#444-450' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Consume and apply a batch of operations</p>
-</div></div><h3 id='impl-BatchOperations' class='impl'><code class='in-band'>impl <a class="trait" href="../../../magical/database/trait.BatchOperations.html" title="trait magical::database::BatchOperations">BatchOperations</a> for <a class="struct" href="../../../magical/database/memory/struct.MemoryDatabase.html" title="struct magical::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-BatchOperations' class='anchor'></a><a class='srclink' href='../../../src/magical/database/memory.rs.html#140-285' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.set_script_pubkey' class="method hidden"><code>fn <a href='../../../magical/database/trait.BatchOperations.html#tymethod.set_script_pubkey' class='fnname'>set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> script_type: <a class="enum" href="../../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#141-158' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Store a script_pubkey along with its script type and child number</p>
-</div><h4 id='method.set_utxo' class="method hidden"><code>fn <a href='../../../magical/database/trait.BatchOperations.html#tymethod.set_utxo' class='fnname'>set_utxo</a>(&mut self, utxo: &<a class="struct" href="../../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#160-166' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Store a <a href="../../../magical/struct.UTXO.html" title="`UTXO`"><code>UTXO</code></a></p>
-</div><h4 id='method.set_raw_tx' class="method hidden"><code>fn <a href='../../../magical/database/trait.BatchOperations.html#tymethod.set_raw_tx' class='fnname'>set_raw_tx</a>(&mut self, transaction: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#167-172' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Store a raw transaction</p>
-</div><h4 id='method.set_tx' class="method hidden"><code>fn <a href='../../../magical/database/trait.BatchOperations.html#tymethod.set_tx' class='fnname'>set_tx</a>(&mut self, transaction: &<a class="struct" href="../../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#173-188' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Store the metadata of a transaction</p>
-</div><h4 id='method.set_last_index' class="method hidden"><code>fn <a href='../../../magical/database/trait.BatchOperations.html#tymethod.set_last_index' class='fnname'>set_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#189-194' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Store the last derivation index for a given script type</p>
-</div><h4 id='method.del_script_pubkey_from_path' class="method hidden"><code>fn <a href='../../../magical/database/trait.BatchOperations.html#tymethod.del_script_pubkey_from_path' class='fnname'>del_script_pubkey_from_path</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#196-206' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Delete a script_pubkey given the script type and its child number</p>
-</div><h4 id='method.del_path_from_script_pubkey' class="method hidden"><code>fn <a href='../../../magical/database/trait.BatchOperations.html#tymethod.del_path_from_script_pubkey' class='fnname'>del_path_from_script_pubkey</a>(<br> &mut self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#207-225' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Delete the data related to a specific script_pubkey, meaning the script type and the child number <a href="../../../magical/database/trait.BatchOperations.html#tymethod.del_path_from_script_pubkey">Read more</a></p>
-</div><h4 id='method.del_utxo' class="method hidden"><code>fn <a href='../../../magical/database/trait.BatchOperations.html#tymethod.del_utxo' class='fnname'>del_utxo</a>(&mut self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#226-242' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Delete a <a href="../../../magical/struct.UTXO.html" title="`UTXO`"><code>UTXO</code></a> given its [<code>OutPoint</code>]</p>
-</div><h4 id='method.del_raw_tx' class="method hidden"><code>fn <a href='../../../magical/database/trait.BatchOperations.html#tymethod.del_raw_tx' class='fnname'>del_raw_tx</a>(&mut self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#243-249' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Delete a raw transaction given its [<code>Txid</code>]</p>
-</div><h4 id='method.del_tx' class="method hidden"><code>fn <a href='../../../magical/database/trait.BatchOperations.html#tymethod.del_tx' class='fnname'>del_tx</a>(<br> &mut self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#250-274' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Delete the metadata of a transaction and optionally the raw transaction itself</p>
-</div><h4 id='method.del_last_index' class="method hidden"><code>fn <a href='../../../magical/database/trait.BatchOperations.html#tymethod.del_last_index' class='fnname'>del_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#275-284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Delete the last derivation index for a script type</p>
-</div></div><h3 id='impl-Database' class='impl'><code class='in-band'>impl <a class="trait" href="../../../magical/database/trait.Database.html" title="trait magical::database::Database">Database</a> for <a class="struct" href="../../../magical/database/memory/struct.MemoryDatabase.html" title="struct magical::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-Database' class='anchor'></a><a class='srclink' href='../../../src/magical/database/memory.rs.html#287-435' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.check_descriptor_checksum' class="method hidden"><code>fn <a href='../../../magical/database/trait.Database.html#tymethod.check_descriptor_checksum' class='fnname'>check_descriptor_checksum</a><B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>>(<br> &mut self, <br> script_type: <a class="enum" href="../../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> bytes: B<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#288-309' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Read and checks the descriptor checksum for a given script type <a href="../../../magical/database/trait.Database.html#tymethod.check_descriptor_checksum">Read more</a></p>
-</div><h4 id='method.iter_script_pubkeys' class="method hidden"><code>fn <a href='../../../magical/database/trait.Database.html#tymethod.iter_script_pubkeys' class='fnname'>iter_script_pubkeys</a>(<br> &self, <br> script_type: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Script>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#311-317' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the list of script_pubkeys</p>
-</div><h4 id='method.iter_utxos' class="method hidden"><code>fn <a href='../../../magical/database/trait.Database.html#tymethod.iter_utxos' class='fnname'>iter_utxos</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#319-333' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the list of <a href="../../../magical/struct.UTXO.html" title="`UTXO`"><code>UTXO</code></a>s</p>
-</div><h4 id='method.iter_raw_txs' class="method hidden"><code>fn <a href='../../../magical/database/trait.Database.html#tymethod.iter_raw_txs' class='fnname'>iter_raw_txs</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Transaction>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#335-341' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the list of raw transactions</p>
-</div><h4 id='method.iter_txs' class="method hidden"><code>fn <a href='../../../magical/database/trait.Database.html#tymethod.iter_txs' class='fnname'>iter_txs</a>(&self, include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#343-357' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the list of transactions metadata</p>
-</div><h4 id='method.get_script_pubkey_from_path' class="method hidden"><code>fn <a href='../../../magical/database/trait.Database.html#tymethod.get_script_pubkey_from_path' class='fnname'>get_script_pubkey_from_path</a>(<br> &self, <br> script_type: <a class="enum" href="../../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#359-369' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Fetch a script_pubkey given the script type and child number</p>
-</div><h4 id='method.get_path_from_script_pubkey' class="method hidden"><code>fn <a href='../../../magical/database/trait.Database.html#tymethod.get_path_from_script_pubkey' class='fnname'>get_path_from_script_pubkey</a>(<br> &self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#371-383' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Fetch the script type and child number of a given script_pubkey</p>
-</div><h4 id='method.get_utxo' class="method hidden"><code>fn <a href='../../../magical/database/trait.Database.html#tymethod.get_utxo' class='fnname'>get_utxo</a>(&self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#385-395' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Fetch a <a href="../../../magical/struct.UTXO.html" title="`UTXO`"><code>UTXO</code></a> given its [<code>OutPoint</code>]</p>
-</div><h4 id='method.get_raw_tx' class="method hidden"><code>fn <a href='../../../magical/database/trait.Database.html#tymethod.get_raw_tx' class='fnname'>get_raw_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#397-403' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Fetch a raw transaction given its [<code>Txid</code>]</p>
-</div><h4 id='method.get_tx' class="method hidden"><code>fn <a href='../../../magical/database/trait.Database.html#tymethod.get_tx' class='fnname'>get_tx</a>(<br> &self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#405-415' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Fetch the transaction metadata and optionally also the raw transaction</p>
-</div><h4 id='method.get_last_index' class="method hidden"><code>fn <a href='../../../magical/database/trait.Database.html#tymethod.get_last_index' class='fnname'>get_last_index</a>(&self, script_type: <a class="enum" href="../../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#417-420' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Return the last defivation index for a script type</p>
-</div><h4 id='method.increment_last_index' class="method hidden"><code>fn <a href='../../../magical/database/trait.Database.html#tymethod.increment_last_index' class='fnname'>increment_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#423-434' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Increment the last derivation index for a script type and returns it <a href="../../../magical/database/trait.Database.html#tymethod.increment_last_index">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../magical/database/memory/struct.MemoryDatabase.html" title="struct magical::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/database/memory.rs.html#124' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#124' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../../magical/database/memory/struct.MemoryDatabase.html" title="struct magical::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/magical/database/memory.rs.html#124' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../../magical/database/memory/struct.MemoryDatabase.html" title="struct magical::database::memory::MemoryDatabase">MemoryDatabase</a></code><a class='srclink' href='../../../src/magical/database/memory.rs.html#124' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../magical/database/memory/struct.MemoryDatabase.html" title="struct magical::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../magical/database/memory/struct.MemoryDatabase.html" title="struct magical::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../magical/database/memory/struct.MemoryDatabase.html" title="struct magical::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../magical/database/memory/struct.MemoryDatabase.html" title="struct magical::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../magical/database/memory/struct.MemoryDatabase.html" title="struct magical::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"mod":[["memory","In-memory ephemeral database"]],"trait":[["BatchDatabase","Trait for a database that supports batch operations"],["BatchOperations","Trait for operations that can be batched"],["Database","Trait for reading data from a database"]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BatchDatabase` trait in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, BatchDatabase"><title>magical::database::BatchDatabase - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait BatchDatabase</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-types">Associated Types</a><div class="sidebar-links"><a href="#associatedtype.Batch">Batch</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.begin_batch">begin_batch</a><a href="#tymethod.commit_batch">commit_batch</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-BatchDatabase-for-Tree">Tree</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>database</a></p><script>window.sidebarCurrent = {name: 'BatchDatabase', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/database/mod.rs.html#152-160' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>magical</a>::<wbr><a href='index.html'>database</a>::<wbr><a class="trait" href=''>BatchDatabase</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait BatchDatabase: <a class="trait" href="../../magical/database/trait.Database.html" title="trait magical::database::Database">Database</a> {
- type <a href='#associatedtype.Batch' class="type">Batch</a>: <a class="trait" href="../../magical/database/trait.BatchOperations.html" title="trait magical::database::BatchOperations">BatchOperations</a>;
- fn <a href='#tymethod.begin_batch' class='fnname'>begin_batch</a>(&self) -> Self::<a class="type" href="../../magical/database/trait.BatchDatabase.html#associatedtype.Batch" title="type magical::database::BatchDatabase::Batch">Batch</a>;
-<div class='item-spacer'></div> fn <a href='#tymethod.commit_batch' class='fnname'>commit_batch</a>(&mut self, batch: Self::<a class="type" href="../../magical/database/trait.BatchDatabase.html#associatedtype.Batch" title="type magical::database::BatchDatabase::Batch">Batch</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-}</pre></div><div class='docblock'><p>Trait for a database that supports batch operations</p>
-<p>This trait defines the methods to start and apply a batch of operations.</p>
-</div>
- <h2 id='associated-types' class='small-section-header'>Associated Types<a href='#associated-types' class='anchor'></a></h2><div class='methods'><h3 id='associatedtype.Batch' class='method'><code>type <a href='#associatedtype.Batch' class="type">Batch</a>: <a class="trait" href="../../magical/database/trait.BatchOperations.html" title="trait magical::database::BatchOperations">BatchOperations</a></code></h3><div class='docblock'><p>Container for the operations</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.begin_batch' class='method'><code>fn <a href='#tymethod.begin_batch' class='fnname'>begin_batch</a>(&self) -> Self::<a class="type" href="../../magical/database/trait.BatchDatabase.html#associatedtype.Batch" title="type magical::database::BatchDatabase::Batch">Batch</a></code></h3><div class='docblock'><p>Create a new batch container</p>
-</div><h3 id='tymethod.commit_batch' class='method'><code>fn <a href='#tymethod.commit_batch' class='fnname'>commit_batch</a>(&mut self, batch: Self::<a class="type" href="../../magical/database/trait.BatchDatabase.html#associatedtype.Batch" title="type magical::database::BatchDatabase::Batch">Batch</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Consume and apply a batch of operations</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-BatchDatabase-for-Tree' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a> for Tree</code><a href='#impl-BatchDatabase-for-Tree' class='anchor'></a><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#385-395' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Batch-1' class="type"><code>type <a href='#associatedtype.Batch' class="type">Batch</a> = Batch</code></h4><h4 id='method.begin_batch' class="method hidden"><code>fn <a href='#method.begin_batch' class='fnname'>begin_batch</a>(&self) -> Self::<a class="type" href="../../magical/database/trait.BatchDatabase.html#associatedtype.Batch" title="type magical::database::BatchDatabase::Batch">Batch</a></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#388-390' title='goto source code'>[src]</a></h4><h4 id='method.commit_batch' class="method hidden"><code>fn <a href='#method.commit_batch' class='fnname'>commit_batch</a>(&mut self, batch: Self::<a class="type" href="../../magical/database/trait.BatchDatabase.html#associatedtype.Batch" title="type magical::database::BatchDatabase::Batch">Batch</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#392-394' title='goto source code'>[src]</a></h4></div><span class='loading-content'>Loading content...</span>
- <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-BatchDatabase' class='impl'><code class='in-band'>impl BatchDatabase for <a class="struct" href="../../magical/database/memory/struct.MemoryDatabase.html" title="struct magical::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-BatchDatabase' class='anchor'></a><a class='srclink' href='../../src/magical/database/memory.rs.html#437-451' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Batch-2' class="type"><code>type <a href='#associatedtype.Batch-2' class="type">Batch</a> = Self</code></h4><h4 id='method.begin_batch-1' class="method hidden"><code>fn <a href='#method.begin_batch-1' class='fnname'>begin_batch</a>(&self) -> Self::<a class="type" href="../../magical/database/trait.BatchDatabase.html#associatedtype.Batch" title="type magical::database::BatchDatabase::Batch">Batch</a></code><a class='srclink' href='../../src/magical/database/memory.rs.html#440-442' title='goto source code'>[src]</a></h4><h4 id='method.commit_batch-1' class="method hidden"><code>fn <a href='#method.commit_batch-1' class='fnname'>commit_batch</a>(&mut self, batch: Self::<a class="type" href="../../magical/database/trait.BatchDatabase.html#associatedtype.Batch" title="type magical::database::BatchDatabase::Batch">Batch</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#444-450' title='goto source code'>[src]</a></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/magical/database/trait.BatchDatabase.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BatchOperations` trait in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, BatchOperations"><title>magical::database::BatchOperations - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait BatchOperations</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.del_last_index">del_last_index</a><a href="#tymethod.del_path_from_script_pubkey">del_path_from_script_pubkey</a><a href="#tymethod.del_raw_tx">del_raw_tx</a><a href="#tymethod.del_script_pubkey_from_path">del_script_pubkey_from_path</a><a href="#tymethod.del_tx">del_tx</a><a href="#tymethod.del_utxo">del_utxo</a><a href="#tymethod.set_last_index">set_last_index</a><a href="#tymethod.set_raw_tx">set_raw_tx</a><a href="#tymethod.set_script_pubkey">set_script_pubkey</a><a href="#tymethod.set_tx">set_tx</a><a href="#tymethod.set_utxo">set_utxo</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-BatchOperations-for-Batch">Batch</a><a href="#impl-BatchOperations-for-Tree">Tree</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>database</a></p><script>window.sidebarCurrent = {name: 'BatchOperations', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/database/mod.rs.html#56-97' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>magical</a>::<wbr><a href='index.html'>database</a>::<wbr><a class="trait" href=''>BatchOperations</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait BatchOperations {
- fn <a href='#tymethod.set_script_pubkey' class='fnname'>set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> child: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.set_utxo' class='fnname'>set_utxo</a>(&mut self, utxo: &<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.set_raw_tx' class='fnname'>set_raw_tx</a>(&mut self, transaction: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.set_tx' class='fnname'>set_tx</a>(&mut self, transaction: &<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.set_last_index' class='fnname'>set_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.del_script_pubkey_from_path' class='fnname'>del_script_pubkey_from_path</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> child: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.del_path_from_script_pubkey' class='fnname'>del_path_from_script_pubkey</a>(<br> &mut self, <br> script: &Script<br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.del_utxo' class='fnname'>del_utxo</a>(&mut self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.del_raw_tx' class='fnname'>del_raw_tx</a>(&mut self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.del_tx' class='fnname'>del_tx</a>(<br> &mut self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.del_last_index' class='fnname'>del_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-}</pre></div><div class='docblock'><p>Trait for operations that can be batched</p>
-<p>This trait defines the list of operations that must be implemented on the <a href="../../magical/database/trait.Database.html" title="`Database`"><code>Database</code></a> type and
-the <a href="../../magical/database/trait.BatchDatabase.html#associatedtype.Batch" title="`BatchDatabase::Batch`"><code>BatchDatabase::Batch</code></a> type.</p>
-</div>
- <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.set_script_pubkey' class='method'><code>fn <a href='#tymethod.set_script_pubkey' class='fnname'>set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> child: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Store a script_pubkey along with its script type and child number</p>
-</div><h3 id='tymethod.set_utxo' class='method'><code>fn <a href='#tymethod.set_utxo' class='fnname'>set_utxo</a>(&mut self, utxo: &<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Store a <a href="../../magical/struct.UTXO.html" title="`UTXO`"><code>UTXO</code></a></p>
-</div><h3 id='tymethod.set_raw_tx' class='method'><code>fn <a href='#tymethod.set_raw_tx' class='fnname'>set_raw_tx</a>(&mut self, transaction: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Store a raw transaction</p>
-</div><h3 id='tymethod.set_tx' class='method'><code>fn <a href='#tymethod.set_tx' class='fnname'>set_tx</a>(&mut self, transaction: &<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Store the metadata of a transaction</p>
-</div><h3 id='tymethod.set_last_index' class='method'><code>fn <a href='#tymethod.set_last_index' class='fnname'>set_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Store the last derivation index for a given script type</p>
-</div><h3 id='tymethod.del_script_pubkey_from_path' class='method'><code>fn <a href='#tymethod.del_script_pubkey_from_path' class='fnname'>del_script_pubkey_from_path</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> child: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Delete a script_pubkey given the script type and its child number</p>
-</div><h3 id='tymethod.del_path_from_script_pubkey' class='method'><code>fn <a href='#tymethod.del_path_from_script_pubkey' class='fnname'>del_path_from_script_pubkey</a>(<br> &mut self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Delete the data related to a specific script_pubkey, meaning the script type and the child
-number</p>
-</div><h3 id='tymethod.del_utxo' class='method'><code>fn <a href='#tymethod.del_utxo' class='fnname'>del_utxo</a>(&mut self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Delete a <a href="../../magical/struct.UTXO.html" title="`UTXO`"><code>UTXO</code></a> given its [<code>OutPoint</code>]</p>
-</div><h3 id='tymethod.del_raw_tx' class='method'><code>fn <a href='#tymethod.del_raw_tx' class='fnname'>del_raw_tx</a>(&mut self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Delete a raw transaction given its [<code>Txid</code>]</p>
-</div><h3 id='tymethod.del_tx' class='method'><code>fn <a href='#tymethod.del_tx' class='fnname'>del_tx</a>(<br> &mut self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Delete the metadata of a transaction and optionally the raw transaction itself</p>
-</div><h3 id='tymethod.del_last_index' class='method'><code>fn <a href='#tymethod.del_last_index' class='fnname'>del_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Delete the last derivation index for a script type</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-BatchOperations-for-Tree' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/database/trait.BatchOperations.html" title="trait magical::database::BatchOperations">BatchOperations</a> for Tree</code><a href='#impl-BatchOperations-for-Tree' class='anchor'></a><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#192-194' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.set_script_pubkey' class="method hidden"><code>fn <a href='#method.set_script_pubkey' class='fnname'>set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#40-52' title='goto source code'>[src]</a></h4><h4 id='method.set_utxo' class="method hidden"><code>fn <a href='#method.set_utxo' class='fnname'>set_utxo</a>(&mut self, utxo: &<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#54-63' title='goto source code'>[src]</a></h4><h4 id='method.set_raw_tx' class="method hidden"><code>fn <a href='#method.set_raw_tx' class='fnname'>set_raw_tx</a>(&mut self, transaction: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#65-71' title='goto source code'>[src]</a></h4><h4 id='method.set_tx' class="method hidden"><code>fn <a href='#method.set_tx' class='fnname'>set_tx</a>(&mut self, transaction: &<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#73-89' title='goto source code'>[src]</a></h4><h4 id='method.set_last_index' class="method hidden"><code>fn <a href='#method.set_last_index' class='fnname'>set_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#91-96' title='goto source code'>[src]</a></h4><h4 id='method.del_script_pubkey_from_path' class="method hidden"><code>fn <a href='#method.del_script_pubkey_from_path' class='fnname'>del_script_pubkey_from_path</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#98-104' title='goto source code'>[src]</a></h4><h4 id='method.del_path_from_script_pubkey' class="method hidden"><code>fn <a href='#method.del_path_from_script_pubkey' class='fnname'>del_path_from_script_pubkey</a>(<br> &mut self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#106-121' title='goto source code'>[src]</a></h4><h4 id='method.del_utxo' class="method hidden"><code>fn <a href='#method.del_utxo' class='fnname'>del_utxo</a>(&mut self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#123-138' title='goto source code'>[src]</a></h4><h4 id='method.del_raw_tx' class="method hidden"><code>fn <a href='#method.del_raw_tx' class='fnname'>del_raw_tx</a>(&mut self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#140-146' title='goto source code'>[src]</a></h4><h4 id='method.del_tx' class="method hidden"><code>fn <a href='#method.del_tx' class='fnname'>del_tx</a>(<br> &mut self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#148-168' title='goto source code'>[src]</a></h4><h4 id='method.del_last_index' class="method hidden"><code>fn <a href='#method.del_last_index' class='fnname'>del_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#170-183' title='goto source code'>[src]</a></h4></div><h3 id='impl-BatchOperations-for-Batch' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/database/trait.BatchOperations.html" title="trait magical::database::BatchOperations">BatchOperations</a> for Batch</code><a href='#impl-BatchOperations-for-Batch' class='anchor'></a><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#202-204' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.set_script_pubkey-1' class="method hidden"><code>fn <a href='#method.set_script_pubkey' class='fnname'>set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#40-52' title='goto source code'>[src]</a></h4><h4 id='method.set_utxo-1' class="method hidden"><code>fn <a href='#method.set_utxo' class='fnname'>set_utxo</a>(&mut self, utxo: &<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#54-63' title='goto source code'>[src]</a></h4><h4 id='method.set_raw_tx-1' class="method hidden"><code>fn <a href='#method.set_raw_tx' class='fnname'>set_raw_tx</a>(&mut self, transaction: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#65-71' title='goto source code'>[src]</a></h4><h4 id='method.set_tx-1' class="method hidden"><code>fn <a href='#method.set_tx' class='fnname'>set_tx</a>(&mut self, transaction: &<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#73-89' title='goto source code'>[src]</a></h4><h4 id='method.set_last_index-1' class="method hidden"><code>fn <a href='#method.set_last_index' class='fnname'>set_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#91-96' title='goto source code'>[src]</a></h4><h4 id='method.del_script_pubkey_from_path-1' class="method hidden"><code>fn <a href='#method.del_script_pubkey_from_path' class='fnname'>del_script_pubkey_from_path</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#98-104' title='goto source code'>[src]</a></h4><h4 id='method.del_path_from_script_pubkey-1' class="method hidden"><code>fn <a href='#method.del_path_from_script_pubkey' class='fnname'>del_path_from_script_pubkey</a>(<br> &mut self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#106-121' title='goto source code'>[src]</a></h4><h4 id='method.del_utxo-1' class="method hidden"><code>fn <a href='#method.del_utxo' class='fnname'>del_utxo</a>(&mut self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#123-138' title='goto source code'>[src]</a></h4><h4 id='method.del_raw_tx-1' class="method hidden"><code>fn <a href='#method.del_raw_tx' class='fnname'>del_raw_tx</a>(&mut self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#140-146' title='goto source code'>[src]</a></h4><h4 id='method.del_tx-1' class="method hidden"><code>fn <a href='#method.del_tx' class='fnname'>del_tx</a>(<br> &mut self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#148-168' title='goto source code'>[src]</a></h4><h4 id='method.del_last_index-1' class="method hidden"><code>fn <a href='#method.del_last_index' class='fnname'>del_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#170-183' title='goto source code'>[src]</a></h4></div><span class='loading-content'>Loading content...</span>
- <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-BatchOperations' class='impl'><code class='in-band'>impl BatchOperations for <a class="struct" href="../../magical/database/memory/struct.MemoryDatabase.html" title="struct magical::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-BatchOperations' class='anchor'></a><a class='srclink' href='../../src/magical/database/memory.rs.html#140-285' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.set_script_pubkey-2' class="method hidden"><code>fn <a href='#method.set_script_pubkey-2' class='fnname'>set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#141-158' title='goto source code'>[src]</a></h4><h4 id='method.set_utxo-2' class="method hidden"><code>fn <a href='#method.set_utxo-2' class='fnname'>set_utxo</a>(&mut self, utxo: &<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#160-166' title='goto source code'>[src]</a></h4><h4 id='method.set_raw_tx-2' class="method hidden"><code>fn <a href='#method.set_raw_tx-2' class='fnname'>set_raw_tx</a>(&mut self, transaction: &Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#167-172' title='goto source code'>[src]</a></h4><h4 id='method.set_tx-2' class="method hidden"><code>fn <a href='#method.set_tx-2' class='fnname'>set_tx</a>(&mut self, transaction: &<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#173-188' title='goto source code'>[src]</a></h4><h4 id='method.set_last_index-2' class="method hidden"><code>fn <a href='#method.set_last_index-2' class='fnname'>set_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#189-194' title='goto source code'>[src]</a></h4><h4 id='method.del_script_pubkey_from_path-2' class="method hidden"><code>fn <a href='#method.del_script_pubkey_from_path-2' class='fnname'>del_script_pubkey_from_path</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#196-206' title='goto source code'>[src]</a></h4><h4 id='method.del_path_from_script_pubkey-2' class="method hidden"><code>fn <a href='#method.del_path_from_script_pubkey-2' class='fnname'>del_path_from_script_pubkey</a>(<br> &mut self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#207-225' title='goto source code'>[src]</a></h4><h4 id='method.del_utxo-2' class="method hidden"><code>fn <a href='#method.del_utxo-2' class='fnname'>del_utxo</a>(&mut self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#226-242' title='goto source code'>[src]</a></h4><h4 id='method.del_raw_tx-2' class="method hidden"><code>fn <a href='#method.del_raw_tx-2' class='fnname'>del_raw_tx</a>(&mut self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#243-249' title='goto source code'>[src]</a></h4><h4 id='method.del_tx-2' class="method hidden"><code>fn <a href='#method.del_tx-2' class='fnname'>del_tx</a>(<br> &mut self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#250-274' title='goto source code'>[src]</a></h4><h4 id='method.del_last_index-2' class="method hidden"><code>fn <a href='#method.del_last_index-2' class='fnname'>del_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#275-284' title='goto source code'>[src]</a></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/magical/database/trait.BatchOperations.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Database` trait in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Database"><title>magical::database::Database - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait Database</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.check_descriptor_checksum">check_descriptor_checksum</a><a href="#tymethod.get_last_index">get_last_index</a><a href="#tymethod.get_path_from_script_pubkey">get_path_from_script_pubkey</a><a href="#tymethod.get_raw_tx">get_raw_tx</a><a href="#tymethod.get_script_pubkey_from_path">get_script_pubkey_from_path</a><a href="#tymethod.get_tx">get_tx</a><a href="#tymethod.get_utxo">get_utxo</a><a href="#tymethod.increment_last_index">increment_last_index</a><a href="#tymethod.iter_raw_txs">iter_raw_txs</a><a href="#tymethod.iter_script_pubkeys">iter_script_pubkeys</a><a href="#tymethod.iter_txs">iter_txs</a><a href="#tymethod.iter_utxos">iter_utxos</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-Database-for-Tree">Tree</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>database</a></p><script>window.sidebarCurrent = {name: 'Database', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/database/mod.rs.html#102-147' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>magical</a>::<wbr><a href='index.html'>database</a>::<wbr><a class="trait" href=''>Database</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait Database: <a class="trait" href="../../magical/database/trait.BatchOperations.html" title="trait magical::database::BatchOperations">BatchOperations</a> {
- fn <a href='#tymethod.check_descriptor_checksum' class='fnname'>check_descriptor_checksum</a><B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> bytes: B<br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.iter_script_pubkeys' class='fnname'>iter_script_pubkeys</a>(<br> &self, <br> script_type: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Script>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.iter_utxos' class='fnname'>iter_utxos</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.iter_raw_txs' class='fnname'>iter_raw_txs</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.iter_txs' class='fnname'>iter_txs</a>(<br> &self, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.get_script_pubkey_from_path' class='fnname'>get_script_pubkey_from_path</a>(<br> &self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> child: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.get_path_from_script_pubkey' class='fnname'>get_path_from_script_pubkey</a>(<br> &self, <br> script: &Script<br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.get_utxo' class='fnname'>get_utxo</a>(&self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.get_raw_tx' class='fnname'>get_raw_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.get_tx' class='fnname'>get_tx</a>(<br> &self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.get_last_index' class='fnname'>get_last_index</a>(<br> &self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.increment_last_index' class='fnname'>increment_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-}</pre></div><div class='docblock'><p>Trait for reading data from a database</p>
-<p>This traits defines the operations that can be used to read data out of a database</p>
-</div>
- <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.check_descriptor_checksum' class='method'><code>fn <a href='#tymethod.check_descriptor_checksum' class='fnname'>check_descriptor_checksum</a><B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> bytes: B<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Read and checks the descriptor checksum for a given script type</p>
-<p>Should return <a href="../../magical/enum.Error.html#variant.ChecksumMismatch"><code>Error::ChecksumMismatch</code></a> if the
-checksum doesn't match. If there's no checksum in the database, simply store it for the
-next time.</p>
-</div><h3 id='tymethod.iter_script_pubkeys' class='method'><code>fn <a href='#tymethod.iter_script_pubkeys' class='fnname'>iter_script_pubkeys</a>(<br> &self, <br> script_type: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Script>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Return the list of script_pubkeys</p>
-</div><h3 id='tymethod.iter_utxos' class='method'><code>fn <a href='#tymethod.iter_utxos' class='fnname'>iter_utxos</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Return the list of <a href="../../magical/struct.UTXO.html" title="`UTXO`"><code>UTXO</code></a>s</p>
-</div><h3 id='tymethod.iter_raw_txs' class='method'><code>fn <a href='#tymethod.iter_raw_txs' class='fnname'>iter_raw_txs</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Return the list of raw transactions</p>
-</div><h3 id='tymethod.iter_txs' class='method'><code>fn <a href='#tymethod.iter_txs' class='fnname'>iter_txs</a>(&self, include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Return the list of transactions metadata</p>
-</div><h3 id='tymethod.get_script_pubkey_from_path' class='method'><code>fn <a href='#tymethod.get_script_pubkey_from_path' class='fnname'>get_script_pubkey_from_path</a>(<br> &self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> child: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Fetch a script_pubkey given the script type and child number</p>
-</div><h3 id='tymethod.get_path_from_script_pubkey' class='method'><code>fn <a href='#tymethod.get_path_from_script_pubkey' class='fnname'>get_path_from_script_pubkey</a>(<br> &self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Fetch the script type and child number of a given script_pubkey</p>
-</div><h3 id='tymethod.get_utxo' class='method'><code>fn <a href='#tymethod.get_utxo' class='fnname'>get_utxo</a>(&self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Fetch a <a href="../../magical/struct.UTXO.html" title="`UTXO`"><code>UTXO</code></a> given its [<code>OutPoint</code>]</p>
-</div><h3 id='tymethod.get_raw_tx' class='method'><code>fn <a href='#tymethod.get_raw_tx' class='fnname'>get_raw_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Fetch a raw transaction given its [<code>Txid</code>]</p>
-</div><h3 id='tymethod.get_tx' class='method'><code>fn <a href='#tymethod.get_tx' class='fnname'>get_tx</a>(<br> &self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Fetch the transaction metadata and optionally also the raw transaction</p>
-</div><h3 id='tymethod.get_last_index' class='method'><code>fn <a href='#tymethod.get_last_index' class='fnname'>get_last_index</a>(&self, script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Return the last defivation index for a script type</p>
-</div><h3 id='tymethod.increment_last_index' class='method'><code>fn <a href='#tymethod.increment_last_index' class='fnname'>increment_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Increment the last derivation index for a script type and returns it</p>
-<p>It should insert and return <code>0</code> if not present in the database</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-Database-for-Tree' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/database/trait.Database.html" title="trait magical::database::Database">Database</a> for Tree</code><a href='#impl-Database-for-Tree' class='anchor'></a><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#206-383' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.check_descriptor_checksum' class="method hidden"><code>fn <a href='#method.check_descriptor_checksum' class='fnname'>check_descriptor_checksum</a><B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> bytes: B<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#207-225' title='goto source code'>[src]</a></h4><h4 id='method.iter_script_pubkeys' class="method hidden"><code>fn <a href='#method.iter_script_pubkeys' class='fnname'>iter_script_pubkeys</a>(<br> &self, <br> script_type: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Script>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#227-235' title='goto source code'>[src]</a></h4><h4 id='method.iter_utxos' class="method hidden"><code>fn <a href='#method.iter_utxos' class='fnname'>iter_utxos</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#237-255' title='goto source code'>[src]</a></h4><h4 id='method.iter_raw_txs' class="method hidden"><code>fn <a href='#method.iter_raw_txs' class='fnname'>iter_raw_txs</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#257-265' title='goto source code'>[src]</a></h4><h4 id='method.iter_txs' class="method hidden"><code>fn <a href='#method.iter_txs' class='fnname'>iter_txs</a>(&self, include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#267-281' title='goto source code'>[src]</a></h4><h4 id='method.get_script_pubkey_from_path' class="method hidden"><code>fn <a href='#method.get_script_pubkey_from_path' class='fnname'>get_script_pubkey_from_path</a>(<br> &self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#283-290' title='goto source code'>[src]</a></h4><h4 id='method.get_path_from_script_pubkey' class="method hidden"><code>fn <a href='#method.get_path_from_script_pubkey' class='fnname'>get_path_from_script_pubkey</a>(<br> &self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#292-306' title='goto source code'>[src]</a></h4><h4 id='method.get_utxo' class="method hidden"><code>fn <a href='#method.get_utxo' class='fnname'>get_utxo</a>(&self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#308-323' title='goto source code'>[src]</a></h4><h4 id='method.get_raw_tx' class="method hidden"><code>fn <a href='#method.get_raw_tx' class='fnname'>get_raw_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#325-328' title='goto source code'>[src]</a></h4><h4 id='method.get_tx' class="method hidden"><code>fn <a href='#method.get_tx' class='fnname'>get_tx</a>(<br> &self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#330-342' title='goto source code'>[src]</a></h4><h4 id='method.get_last_index' class="method hidden"><code>fn <a href='#method.get_last_index' class='fnname'>get_last_index</a>(&self, script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#344-356' title='goto source code'>[src]</a></h4><h4 id='method.increment_last_index' class="method hidden"><code>fn <a href='#method.increment_last_index' class='fnname'>increment_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/keyvalue.rs.html#359-382' title='goto source code'>[src]</a></h4></div><span class='loading-content'>Loading content...</span>
- <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-Database' class='impl'><code class='in-band'>impl Database for <a class="struct" href="../../magical/database/memory/struct.MemoryDatabase.html" title="struct magical::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href='#impl-Database' class='anchor'></a><a class='srclink' href='../../src/magical/database/memory.rs.html#287-435' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.check_descriptor_checksum-1' class="method hidden"><code>fn <a href='#method.check_descriptor_checksum-1' class='fnname'>check_descriptor_checksum</a><B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> bytes: B<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#288-309' title='goto source code'>[src]</a></h4><h4 id='method.iter_script_pubkeys-1' class="method hidden"><code>fn <a href='#method.iter_script_pubkeys-1' class='fnname'>iter_script_pubkeys</a>(<br> &self, <br> script_type: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Script>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#311-317' title='goto source code'>[src]</a></h4><h4 id='method.iter_utxos-1' class="method hidden"><code>fn <a href='#method.iter_utxos-1' class='fnname'>iter_utxos</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#319-333' title='goto source code'>[src]</a></h4><h4 id='method.iter_raw_txs-1' class="method hidden"><code>fn <a href='#method.iter_raw_txs-1' class='fnname'>iter_raw_txs</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#335-341' title='goto source code'>[src]</a></h4><h4 id='method.iter_txs-1' class="method hidden"><code>fn <a href='#method.iter_txs-1' class='fnname'>iter_txs</a>(&self, include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#343-357' title='goto source code'>[src]</a></h4><h4 id='method.get_script_pubkey_from_path-1' class="method hidden"><code>fn <a href='#method.get_script_pubkey_from_path-1' class='fnname'>get_script_pubkey_from_path</a>(<br> &self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Script>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#359-369' title='goto source code'>[src]</a></h4><h4 id='method.get_path_from_script_pubkey-1' class="method hidden"><code>fn <a href='#method.get_path_from_script_pubkey-1' class='fnname'>get_path_from_script_pubkey</a>(<br> &self, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#371-383' title='goto source code'>[src]</a></h4><h4 id='method.get_utxo-1' class="method hidden"><code>fn <a href='#method.get_utxo-1' class='fnname'>get_utxo</a>(&self, outpoint: &OutPoint) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#385-395' title='goto source code'>[src]</a></h4><h4 id='method.get_raw_tx-1' class="method hidden"><code>fn <a href='#method.get_raw_tx-1' class='fnname'>get_raw_tx</a>(&self, txid: &Txid) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#397-403' title='goto source code'>[src]</a></h4><h4 id='method.get_tx-1' class="method hidden"><code>fn <a href='#method.get_tx-1' class='fnname'>get_tx</a>(<br> &self, <br> txid: &Txid, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#405-415' title='goto source code'>[src]</a></h4><h4 id='method.get_last_index-1' class="method hidden"><code>fn <a href='#method.get_last_index-1' class='fnname'>get_last_index</a>(&self, script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#417-420' title='goto source code'>[src]</a></h4><h4 id='method.increment_last_index-1' class="method hidden"><code>fn <a href='#method.increment_last_index-1' class='fnname'>increment_last_index</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/database/memory.rs.html#423-434' title='goto source code'>[src]</a></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/magical/database/trait.Database.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `get_checksum` fn in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, get_checksum"><title>magical::descriptor::checksum::get_checksum - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>checksum</a></p><script>window.sidebarCurrent = {name: 'get_checksum', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/descriptor/checksum.rs.html#60-94' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>checksum</a>::<wbr><a class="fn" href=''>get_checksum</a></span></h1><pre class='rust fn'>pub fn get_checksum(desc: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a>></pre><div class='docblock'><p>Compute the checksum of a descriptor</p>
-</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `checksum` mod in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, checksum"><title>magical::descriptor::checksum - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module checksum</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'checksum', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/descriptor/checksum.rs.html#25-94' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a class="mod" href=''>checksum</a></span></h1><div class='docblock'><p>Descriptor checksum</p>
-<p>This module contains a re-implementation of the function used by Bitcoin Core to calculate the
-checksum of a descriptor</p>
-</div><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
-<table><tr class='module-item'><td><a class="fn" href="fn.get_checksum.html" title='magical::descriptor::checksum::get_checksum fn'>get_checksum</a></td><td class='docblock-short'><p>Compute the checksum of a descriptor</p>
-</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"fn":[["get_checksum","Compute the checksum of a descriptor"]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Descriptor` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Descriptor"><title>magical::descriptor::Descriptor - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Descriptor</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Bare">Bare</a><a href="#variant.Pk">Pk</a><a href="#variant.Pkh">Pkh</a><a href="#variant.Sh">Sh</a><a href="#variant.ShWpkh">ShWpkh</a><a href="#variant.ShWsh">ShWsh</a><a href="#variant.Wpkh">Wpkh</a><a href="#variant.Wsh">Wsh</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.address">address</a><a href="#method.derive">derive</a><a href="#method.max_satisfaction_weight">max_satisfaction_weight</a><a href="#method.parse_secret">parse_secret</a><a href="#method.satisfy">satisfy</a><a href="#method.script_pubkey">script_pubkey</a><a href="#method.to_string_with_secret">to_string_with_secret</a><a href="#method.translate_pk">translate_pk</a><a href="#method.unsigned_script_sig">unsigned_script_sig</a><a href="#method.witness_script">witness_script</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-ExtractPolicy">ExtractPolicy</a><a href="#impl-FromStr">FromStr</a><a href="#impl-FromTree">FromTree</a><a href="#impl-Liftable%3CPk%3E">Liftable<Pk></a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CDescriptor%3CPk%3E%3E">PartialEq<Descriptor<Pk>></a><a href="#impl-PartialOrd%3CDescriptor%3CPk%3E%3E">PartialOrd<Descriptor<Pk>></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'Descriptor', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span></span><span class='in-band'>Enum <a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="enum" href=''>Descriptor</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Descriptor<Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span> {
- Bare(<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a>>),
- Pk(Pk),
- Pkh(Pk),
- Wpkh(Pk),
- ShWpkh(Pk),
- Sh(<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a>>),
- Wsh(<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a>>),
- ShWsh(<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a>>),
-}</pre></div><div class='docblock'><p>Script descriptor</p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<div id="variant.Bare" class="variant small-section-header"><a href="#variant.Bare" class="anchor field"></a><code>Bare(<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a>>)</code></div><div class='docblock'><p>A raw scriptpubkey (including pay-to-pubkey) under Legacy context</p>
-</div><div id="variant.Pk" class="variant small-section-header"><a href="#variant.Pk" class="anchor field"></a><code>Pk(Pk)</code></div><div class='docblock'><p>Pay-to-Pubkey</p>
-</div><div id="variant.Pkh" class="variant small-section-header"><a href="#variant.Pkh" class="anchor field"></a><code>Pkh(Pk)</code></div><div class='docblock'><p>Pay-to-PubKey-Hash</p>
-</div><div id="variant.Wpkh" class="variant small-section-header"><a href="#variant.Wpkh" class="anchor field"></a><code>Wpkh(Pk)</code></div><div class='docblock'><p>Pay-to-Witness-PubKey-Hash</p>
-</div><div id="variant.ShWpkh" class="variant small-section-header"><a href="#variant.ShWpkh" class="anchor field"></a><code>ShWpkh(Pk)</code></div><div class='docblock'><p>Pay-to-Witness-PubKey-Hash inside P2SH</p>
-</div><div id="variant.Sh" class="variant small-section-header"><a href="#variant.Sh" class="anchor field"></a><code>Sh(<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a>>)</code></div><div class='docblock'><p>Pay-to-ScriptHash with Legacy context</p>
-</div><div id="variant.Wsh" class="variant small-section-header"><a href="#variant.Wsh" class="anchor field"></a><code>Wsh(<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a>>)</code></div><div class='docblock'><p>Pay-to-Witness-ScriptHash with Segwitv0 context</p>
-</div><div id="variant.ShWsh" class="variant small-section-header"><a href="#variant.ShWsh" class="anchor field"></a><code>ShWsh(<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a>>)</code></div><div class='docblock'><p>P2SH-P2WSH with Segwitv0 context</p>
-</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<Pk> <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl' class='anchor'></a></h3><div class='impl-items'><h4 id='method.translate_pk' class="method"><code>pub fn <a href='#method.translate_pk' class='fnname'>translate_pk</a><Fpk, Fpkh, Q, E>(<br> &self, <br> translatefpk: Fpk, <br> translatefpkh: Fpkh<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Q>, E> <span class="where fmt-newline">where<br> Fpk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Pk) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Q, E>,<br> Fpkh: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&<Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Q as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>, E>,<br> Q: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><div class='docblock'><p>Convert a descriptor using abstract keys to one using specific keys
-This will panic if translatefpk returns an uncompressed key when
-converting to a Segwit descriptor. To prevent this panic, ensure
-translatefpk returns an error in this case instead.</p>
-</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl<Pk> <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="../../magical/descriptor/trait.ToPublicKey.html" title="trait magical::descriptor::ToPublicKey">ToPublicKey</a>, </span></code><a href='#impl-1' class='anchor'></a></h3><div class='impl-items'><h4 id='method.address' class="method"><code>pub fn <a href='#method.address' class='fnname'>address</a>(&self, network: Network) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Address></code></h4><div class='docblock'><p>Computes the Bitcoin address of the descriptor, if one exists</p>
-</div><h4 id='method.script_pubkey' class="method"><code>pub fn <a href='#method.script_pubkey' class='fnname'>script_pubkey</a>(&self) -> Script</code></h4><div class='docblock'><p>Computes the scriptpubkey of the descriptor</p>
-</div><h4 id='method.unsigned_script_sig' class="method"><code>pub fn <a href='#method.unsigned_script_sig' class='fnname'>unsigned_script_sig</a>(&self) -> Script</code></h4><div class='docblock'><p>Computes the scriptSig that will be in place for an unsigned
-input spending an output with this descriptor. For pre-segwit
-descriptors, which use the scriptSig for signatures, this
-returns the empty script.</p>
-<p>This is used in Segwit transactions to produce an unsigned
-transaction whose txid will not change during signing (since
-only the witness data will change).</p>
-</div><h4 id='method.witness_script' class="method"><code>pub fn <a href='#method.witness_script' class='fnname'>witness_script</a>(&self) -> Script</code></h4><div class='docblock'><p>Computes the "witness script" of the descriptor, i.e. the underlying
-script before any hashing is done. For <code>Bare</code>, <code>Pkh</code> and <code>Wpkh</code> this
-is the scriptPubkey; for <code>ShWpkh</code> and <code>Sh</code> this is the redeemScript;
-for the others it is the witness script.</p>
-</div><h4 id='method.satisfy' class="method"><code>pub fn <a href='#method.satisfy' class='fnname'>satisfy</a><S>(&self, txin: &mut TxIn, satisfier: S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Error> <span class="where fmt-newline">where<br> S: Satisfier<Pk>, </span></code></h4><div class='docblock'><p>Attempts to produce a satisfying witness and scriptSig to spend an
-output controlled by the given descriptor; add the data to a given
-<code>TxIn</code> output.</p>
-</div><h4 id='method.max_satisfaction_weight' class="method"><code>pub fn <a href='#method.max_satisfaction_weight' class='fnname'>max_satisfaction_weight</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock'><p>Computes an upper bound on the weight of a satisfying witness to the
-transaction. Assumes all signatures are 73 bytes, including push opcode
-and sighash suffix. Includes the weight of the VarInts encoding the
-scriptSig and witness stack length.</p>
-</div></div><h3 id='impl-2' class='impl'><code class='in-band'>impl <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><DescriptorPublicKey></code><a href='#impl-2' class='anchor'></a></h3><div class='impl-items'><h4 id='method.derive' class="method"><code>pub fn <a href='#method.derive' class='fnname'>derive</a>(&self, path: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a>ChildNumber<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><DescriptorPublicKey></code></h4><div class='docblock'><p>Derives all wildcard keys in the descriptor using the supplied <code>path</code></p>
-</div><h4 id='method.parse_secret' class="method"><code>pub fn <a href='#method.parse_secret' class='fnname'>parse_secret</a>(<br> s: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><DescriptorPublicKey>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><DescriptorPublicKey, DescriptorSecretKey, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.RandomState.html" title="struct std::collections::hash::map::RandomState">RandomState</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, Error></code></h4><h4 id='method.to_string_with_secret' class="method"><code>pub fn <a href='#method.to_string_with_secret' class='fnname'>to_string_with_secret</a>(<br> &self, <br> key_map: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><DescriptorPublicKey, DescriptorSecretKey, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.RandomState.html" title="struct std::collections::hash::map::RandomState">RandomState</a>><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-Clone' class='anchor'></a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk></code></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Debug' class='anchor'></a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></code></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Display' class='anchor'></a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></code></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>, </span></code><a href='#impl-Eq' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-ExtractPolicy' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/descriptor/trait.ExtractPolicy.html" title="trait magical::descriptor::ExtractPolicy">ExtractPolicy</a> for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><DescriptorPublicKey></code><a href='#impl-ExtractPolicy' class='anchor'></a><a class='srclink' href='../../src/magical/descriptor/policy.rs.html#781-795' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.extract_policy' class="method hidden"><code>fn <a href='../../magical/descriptor/trait.ExtractPolicy.html#tymethod.extract_policy' class='fnname'>extract_policy</a>(<br> &self, <br> signers: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a>>, <a class="enum" href="../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a>></code><a class='srclink' href='../../src/magical/descriptor/policy.rs.html#782-794' title='goto source code'>[src]</a></h4></div><h3 id='impl-FromStr' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a> for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>,<br> <Pk as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>,<br> <<Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>, </span></code><a href='#impl-FromStr' class='anchor'></a></h3><div class='impl-items'><h4 id='associatedtype.Err' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err' class="type">Err</a> = Error</code></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
-</div><h4 id='method.from_str' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str' class='fnname'>from_str</a>(s: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk>, Error></code></h4><div class='docblock hidden'><p>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str">Read more</a></p>
-</div></div><h3 id='impl-FromTree' class='impl'><code class='in-band'>impl<Pk> FromTree for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>,<br> <Pk as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>,<br> <<Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>, </span></code><a href='#impl-FromTree' class='anchor'></a></h3><div class='impl-items'><h4 id='method.from_tree' class="method"><code>fn <a href='#method.from_tree' class='fnname'>from_tree</a>(top: &Tree) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk>, Error></code></h4><div class='docblock'><p>Parse an expression tree into a descriptor</p>
-</div></div><h3 id='impl-Liftable%3CPk%3E' class='impl'><code class='in-band'>impl<Pk> Liftable<Pk> for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Liftable%3CPk%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.lift' class="method hidden"><code>fn <a href='#method.lift' class='fnname'>lift</a>(&self) -> Policy<Pk></code></h4><div class='docblock hidden'><p>Convert the object into an abstract policy</p>
-</div></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, </span></code><a href='#impl-Ord' class='anchor'></a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
-</div><h4 id='method.max' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#599-604' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
-</div><h4 id='method.min' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#619-624' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
-</div><h4 id='method.clamp' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#646-658' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
-</div></div><h3 id='impl-PartialEq%3CDescriptor%3CPk%3E%3E' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk>> for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><Pk>, </span></code><a href='#impl-PartialEq%3CDescriptor%3CPk%3E%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-PartialOrd%3CDescriptor%3CPk%3E%3E' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk>> for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><Pk>, </span></code><a href='#impl-PartialOrd%3CDescriptor%3CPk%3E%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
-</div><h4 id='method.lt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
-</div><h4 id='method.le' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
-</div><h4 id='method.gt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
-</div><h4 id='method.ge' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
-</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-StructuralEq' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-StructuralPartialEq' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>, </span></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><Pk> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>, </span></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2237-2247' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2239-2246' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Legacy` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Legacy"><title>magical::descriptor::Legacy - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Legacy</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Eq">Eq</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CLegacy%3E">PartialEq<Legacy></a><a href="#impl-PartialOrd%3CLegacy%3E">PartialOrd<Legacy></a><a href="#impl-ScriptContext">ScriptContext</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'Legacy', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span></span><span class='in-band'>Enum <a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="enum" href=''>Legacy</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Legacy {}</pre></div><div class='docblock'><p>Legacy ScriptContext</p>
-</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a></code><a href='#impl-Clone' class='anchor'></a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a></code></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a></code><a href='#impl-Debug' class='anchor'></a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></code></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a></code><a href='#impl-Eq' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a></code><a href='#impl-Ord' class='anchor'></a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
-</div><h4 id='method.max' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#599-604' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
-</div><h4 id='method.min' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#619-624' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
-</div><h4 id='method.clamp' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#646-658' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
-</div></div><h3 id='impl-PartialEq%3CLegacy%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a>> for <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a></code><a href='#impl-PartialEq%3CLegacy%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-PartialOrd%3CLegacy%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a>> for <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a></code><a href='#impl-PartialOrd%3CLegacy%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
-</div><h4 id='method.lt' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#841-843' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
-</div><h4 id='method.le' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#860-862' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
-</div><h4 id='method.gt' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#878-880' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
-</div><h4 id='method.ge' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#897-899' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
-</div></div><h3 id='impl-ScriptContext' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a> for <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a></code><a href='#impl-ScriptContext' class='anchor'></a></h3><div class='impl-items'><h4 id='method.check_frag_non_malleable' class="method hidden"><code>fn <a href='../../magical/descriptor/trait.ScriptContext.html#tymethod.check_frag_non_malleable' class='fnname'>check_frag_non_malleable</a><Pk, Ctx>(<br> frag: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><div class='docblock hidden'><p>Depending on ScriptContext, fragments can be malleable. For Example, under Legacy context, PkH is malleable because it is possible to estimate the cost of satisfaction because of compressed keys This is currently only used in compiler code for removing malleable compilations. This does NOT recursively check if the children of the fragment are valid or not. Since the compilation proceeds in a leaf to root fashion, a recursive check is unnecessary. <a href="../../magical/descriptor/trait.ScriptContext.html#tymethod.check_frag_non_malleable">Read more</a></p>
-</div><h4 id='method.check_frag_validity' class="method hidden"><code>fn <a href='../../magical/descriptor/trait.ScriptContext.html#tymethod.check_frag_validity' class='fnname'>check_frag_validity</a><Pk, Ctx>(<br> _frag: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><div class='docblock hidden'><p>Depending on script Context, some of the Terminals might not be valid. For example, in Segwit Context with MiniscriptKey as bitcoin::PublicKey uncompressed public keys are non-standard and thus invalid. Post Tapscript upgrade, this would have to consider other nodes. This does not recursively check <a href="../../magical/descriptor/trait.ScriptContext.html#tymethod.check_frag_validity">Read more</a></p>
-</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a></code><a href='#impl-StructuralEq' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Segwitv0` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Segwitv0"><title>magical::descriptor::Segwitv0 - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Segwitv0</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Eq">Eq</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CSegwitv0%3E">PartialEq<Segwitv0></a><a href="#impl-PartialOrd%3CSegwitv0%3E">PartialOrd<Segwitv0></a><a href="#impl-ScriptContext">ScriptContext</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'Segwitv0', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span></span><span class='in-band'>Enum <a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="enum" href=''>Segwitv0</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Segwitv0 {}</pre></div><div class='docblock'><p>Segwitv0 ScriptContext</p>
-</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-Clone' class='anchor'></a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a></code></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-Debug' class='anchor'></a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></code></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-Eq' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-Ord' class='anchor'></a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
-</div><h4 id='method.max' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#599-604' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
-</div><h4 id='method.min' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#619-624' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
-</div><h4 id='method.clamp' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#646-658' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
-</div></div><h3 id='impl-PartialEq%3CSegwitv0%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a>> for <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-PartialEq%3CSegwitv0%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-PartialOrd%3CSegwitv0%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a>> for <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-PartialOrd%3CSegwitv0%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
-</div><h4 id='method.lt' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#841-843' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
-</div><h4 id='method.le' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#860-862' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
-</div><h4 id='method.gt' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#878-880' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
-</div><h4 id='method.ge' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#897-899' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
-</div></div><h3 id='impl-ScriptContext' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a> for <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-ScriptContext' class='anchor'></a></h3><div class='impl-items'><h4 id='method.check_frag_non_malleable' class="method hidden"><code>fn <a href='../../magical/descriptor/trait.ScriptContext.html#tymethod.check_frag_non_malleable' class='fnname'>check_frag_non_malleable</a><Pk, Ctx>(<br> _frag: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><div class='docblock hidden'><p>Depending on ScriptContext, fragments can be malleable. For Example, under Legacy context, PkH is malleable because it is possible to estimate the cost of satisfaction because of compressed keys This is currently only used in compiler code for removing malleable compilations. This does NOT recursively check if the children of the fragment are valid or not. Since the compilation proceeds in a leaf to root fashion, a recursive check is unnecessary. <a href="../../magical/descriptor/trait.ScriptContext.html#tymethod.check_frag_non_malleable">Read more</a></p>
-</div><h4 id='method.check_frag_validity' class="method hidden"><code>fn <a href='../../magical/descriptor/trait.ScriptContext.html#tymethod.check_frag_validity' class='fnname'>check_frag_validity</a><Pk, Ctx>(<br> frag: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><div class='docblock hidden'><p>Depending on script Context, some of the Terminals might not be valid. For example, in Segwit Context with MiniscriptKey as bitcoin::PublicKey uncompressed public keys are non-standard and thus invalid. Post Tapscript upgrade, this would have to consider other nodes. This does not recursively check <a href="../../magical/descriptor/trait.ScriptContext.html#tymethod.check_frag_validity">Read more</a></p>
-</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-StructuralEq' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Terminal` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Terminal"><title>magical::descriptor::Terminal - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Terminal</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.After">After</a><a href="#variant.Alt">Alt</a><a href="#variant.AndB">AndB</a><a href="#variant.AndOr">AndOr</a><a href="#variant.AndV">AndV</a><a href="#variant.Check">Check</a><a href="#variant.DupIf">DupIf</a><a href="#variant.False">False</a><a href="#variant.Hash160">Hash160</a><a href="#variant.Hash256">Hash256</a><a href="#variant.Multi">Multi</a><a href="#variant.NonZero">NonZero</a><a href="#variant.Older">Older</a><a href="#variant.OrB">OrB</a><a href="#variant.OrC">OrC</a><a href="#variant.OrD">OrD</a><a href="#variant.OrI">OrI</a><a href="#variant.PkH">PkH</a><a href="#variant.PkK">PkK</a><a href="#variant.Ripemd160">Ripemd160</a><a href="#variant.Sha256">Sha256</a><a href="#variant.Swap">Swap</a><a href="#variant.Thresh">Thresh</a><a href="#variant.True">True</a><a href="#variant.Verify">Verify</a><a href="#variant.ZeroNotEqual">ZeroNotEqual</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.encode">encode</a><a href="#method.max_dissatisfaction_size">max_dissatisfaction_size</a><a href="#method.max_dissatisfaction_witness_elements">max_dissatisfaction_witness_elements</a><a href="#method.max_satisfaction_size">max_satisfaction_size</a><a href="#method.max_satisfaction_witness_elements">max_satisfaction_witness_elements</a><a href="#method.script_size">script_size</a><a href="#method.translate_pk">translate_pk</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-FromTree">FromTree</a><a href="#impl-Hash">Hash</a><a href="#impl-Liftable%3CPk%3E">Liftable<Pk></a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CTerminal%3CPk%2C%20Ctx%3E%3E">PartialEq<Terminal<Pk, Ctx>></a><a href="#impl-PartialOrd%3CTerminal%3CPk%2C%20Ctx%3E%3E">PartialOrd<Terminal<Pk, Ctx>></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'Terminal', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span></span><span class='in-band'>Enum <a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="enum" href=''>Terminal</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Terminal<Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span> {
- True,
- False,
- PkK(Pk),
- PkH(<Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>),
- After(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>),
- Older(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>),
- Sha256(Hash),
- Hash256(Hash),
- Ripemd160(Hash),
- Hash160(Hash),
- Alt(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
- Swap(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
- Check(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
- DupIf(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
- Verify(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
- NonZero(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
- ZeroNotEqual(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
- AndV(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
- AndB(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
- AndOr(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
- OrB(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
- OrD(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
- OrC(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
- OrI(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>),
- Thresh(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>>),
- Multi(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Pk>),
-}</pre></div><div class='docblock'><p>All AST elements</p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<div id="variant.True" class="variant small-section-header"><a href="#variant.True" class="anchor field"></a><code>True</code></div><div class='docblock'><p><code>1</code></p>
-</div><div id="variant.False" class="variant small-section-header"><a href="#variant.False" class="anchor field"></a><code>False</code></div><div class='docblock'><p><code>0</code></p>
-</div><div id="variant.PkK" class="variant small-section-header"><a href="#variant.PkK" class="anchor field"></a><code>PkK(Pk)</code></div><div class='docblock'><p><code><key></code></p>
-</div><div id="variant.PkH" class="variant small-section-header"><a href="#variant.PkH" class="anchor field"></a><code>PkH(<Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>)</code></div><div class='docblock'><p><code>DUP HASH160 <keyhash> EQUALVERIFY</code></p>
-</div><div id="variant.After" class="variant small-section-header"><a href="#variant.After" class="anchor field"></a><code>After(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>)</code></div><div class='docblock'><p><code>n CHECKLOCKTIMEVERIFY</code></p>
-</div><div id="variant.Older" class="variant small-section-header"><a href="#variant.Older" class="anchor field"></a><code>Older(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>)</code></div><div class='docblock'><p><code>n CHECKSEQUENCEVERIFY</code></p>
-</div><div id="variant.Sha256" class="variant small-section-header"><a href="#variant.Sha256" class="anchor field"></a><code>Sha256(Hash)</code></div><div class='docblock'><p><code>SIZE 32 EQUALVERIFY SHA256 <hash> EQUAL</code></p>
-</div><div id="variant.Hash256" class="variant small-section-header"><a href="#variant.Hash256" class="anchor field"></a><code>Hash256(Hash)</code></div><div class='docblock'><p><code>SIZE 32 EQUALVERIFY HASH256 <hash> EQUAL</code></p>
-</div><div id="variant.Ripemd160" class="variant small-section-header"><a href="#variant.Ripemd160" class="anchor field"></a><code>Ripemd160(Hash)</code></div><div class='docblock'><p><code>SIZE 32 EQUALVERIFY RIPEMD160 <hash> EQUAL</code></p>
-</div><div id="variant.Hash160" class="variant small-section-header"><a href="#variant.Hash160" class="anchor field"></a><code>Hash160(Hash)</code></div><div class='docblock'><p><code>SIZE 32 EQUALVERIFY HASH160 <hash> EQUAL</code></p>
-</div><div id="variant.Alt" class="variant small-section-header"><a href="#variant.Alt" class="anchor field"></a><code>Alt(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p><code>TOALTSTACK [E] FROMALTSTACK</code></p>
-</div><div id="variant.Swap" class="variant small-section-header"><a href="#variant.Swap" class="anchor field"></a><code>Swap(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p><code>SWAP [E1]</code></p>
-</div><div id="variant.Check" class="variant small-section-header"><a href="#variant.Check" class="anchor field"></a><code>Check(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p><code>[Kt]/[Ke] CHECKSIG</code></p>
-</div><div id="variant.DupIf" class="variant small-section-header"><a href="#variant.DupIf" class="anchor field"></a><code>DupIf(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p><code>DUP IF [V] ENDIF</code></p>
-</div><div id="variant.Verify" class="variant small-section-header"><a href="#variant.Verify" class="anchor field"></a><code>Verify(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>[T] VERIFY</p>
-</div><div id="variant.NonZero" class="variant small-section-header"><a href="#variant.NonZero" class="anchor field"></a><code>NonZero(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>SIZE 0NOTEQUAL IF <a href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="Fn">Fn</a> ENDIF</p>
-</div><div id="variant.ZeroNotEqual" class="variant small-section-header"><a href="#variant.ZeroNotEqual" class="anchor field"></a><code>ZeroNotEqual(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>[X] 0NOTEQUAL</p>
-</div><div id="variant.AndV" class="variant small-section-header"><a href="#variant.AndV" class="anchor field"></a><code>AndV(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>[V] [T]/[V]/[F]/[Kt]</p>
-</div><div id="variant.AndB" class="variant small-section-header"><a href="#variant.AndB" class="anchor field"></a><code>AndB(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>[E] [W] BOOLAND</p>
-</div><div id="variant.AndOr" class="variant small-section-header"><a href="#variant.AndOr" class="anchor field"></a><code>AndOr(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>[various] NOTIF [various] ELSE [various] ENDIF</p>
-</div><div id="variant.OrB" class="variant small-section-header"><a href="#variant.OrB" class="anchor field"></a><code>OrB(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>[E] [W] BOOLOR</p>
-</div><div id="variant.OrD" class="variant small-section-header"><a href="#variant.OrD" class="anchor field"></a><code>OrD(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>[E] IFDUP NOTIF [T]/[E] ENDIF</p>
-</div><div id="variant.OrC" class="variant small-section-header"><a href="#variant.OrC" class="anchor field"></a><code>OrC(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>[E] NOTIF [V] ENDIF</p>
-</div><div id="variant.OrI" class="variant small-section-header"><a href="#variant.OrI" class="anchor field"></a><code>OrI(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>)</code></div><div class='docblock'><p>IF [various] ELSE [various] ENDIF</p>
-</div><div id="variant.Thresh" class="variant small-section-header"><a href="#variant.Thresh" class="anchor field"></a><code>Thresh(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>>>)</code></div><div class='docblock'><p>[E] ([W] ADD)* k EQUAL</p>
-</div><div id="variant.Multi" class="variant small-section-header"><a href="#variant.Multi" class="anchor field"></a><code>Multi(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Pk>)</code></div><div class='docblock'><p>k (<key>)* n CHECKMULTISIG</p>
-</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl' class='anchor'></a></h3><div class='impl-items'><h4 id='method.translate_pk' class="method"><code>pub fn <a href='#method.translate_pk' class='fnname'>translate_pk</a><FPk, FPkh, Q, Error>(<br> &self, <br> translatefpk: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>FPk, <br> translatefpkh: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>FPkh<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Q, Ctx>, Error> <span class="where fmt-newline">where<br> FPk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Pk) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Q, Error>,<br> FPkh: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&<Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Q as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>, Error>,<br> Q: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><div class='docblock'><p>Convert an AST element with one public key type to one of another
-public key type .This will panic while converting to
-Segwit Miniscript using uncompressed public keys</p>
-</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="../../magical/descriptor/trait.ToPublicKey.html" title="trait magical::descriptor::ToPublicKey">ToPublicKey</a>, </span></code><a href='#impl-1' class='anchor'></a></h3><div class='impl-items'><h4 id='method.encode' class="method"><code>pub fn <a href='#method.encode' class='fnname'>encode</a>(&self, builder: Builder) -> Builder</code></h4><div class='docblock'><p>Encode the element as a fragment of Bitcoin Script. The inverse
-function, from Script to an AST element, is implemented in the
-<code>parse</code> module.</p>
-</div><h4 id='method.script_size' class="method"><code>pub fn <a href='#method.script_size' class='fnname'>script_size</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock'><p>Size, in bytes of the script-pubkey. If this Miniscript is used outside
-of segwit (e.g. in a bare or P2SH descriptor), this quantity should be
-multiplied by 4 to compute the weight.</p>
-<p>In general, it is not recommended to use this function directly, but
-to instead call the corresponding function on a <code>Descriptor</code>, which
-will handle the segwit/non-segwit technicalities for you.</p>
-</div><h4 id='method.max_dissatisfaction_witness_elements' class="method"><code>pub fn <a href='#method.max_dissatisfaction_witness_elements' class='fnname'>max_dissatisfaction_witness_elements</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code></h4><div class='docblock'><p>Maximum number of witness elements used to dissatisfy the Miniscript
-fragment. Used to estimate the weight of the <code>VarInt</code> that specifies
-this number in a serialized transaction.</p>
-<p>Will panic if the fragment is not an E, W or Ke.</p>
-</div><h4 id='method.max_dissatisfaction_size' class="method"><code>pub fn <a href='#method.max_dissatisfaction_size' class='fnname'>max_dissatisfaction_size</a>(&self, one_cost: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code></h4><div class='docblock'><p>Maximum dissatisfaction cost, in bytes, of a Miniscript fragment,
-if it is possible to compute this. This function should probably
-not ever be used directly. It is called from <code>max_satisfaction_size</code>.</p>
-<p>Will panic if the fragment is not E, W or Ke</p>
-</div><h4 id='method.max_satisfaction_witness_elements' class="method"><code>pub fn <a href='#method.max_satisfaction_witness_elements' class='fnname'>max_satisfaction_witness_elements</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock'><p>Maximum number of witness elements used to satisfy the Miniscript
-fragment. Used to estimate the weight of the <code>VarInt</code> that specifies
-this number in a serialized transaction.</p>
-<p>This number does not include the witness script itself, so 1 needs
-to be added to the final result.</p>
-</div><h4 id='method.max_satisfaction_size' class="method"><code>pub fn <a href='#method.max_satisfaction_size' class='fnname'>max_satisfaction_size</a>(&self, one_cost: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock'><p>Maximum size, in bytes, of a satisfying witness. For Segwit outputs
-<code>one_cost</code> should be set to 2, since the number <code>1</code> requires two
-bytes to encode. For non-segwit outputs <code>one_cost</code> should be set to
-1, since <code>OP_1</code> is available in scriptSigs.</p>
-<p>In general, it is not recommended to use this function directly, but
-to instead call the corresponding function on a <code>Descriptor</code>, which
-will handle the segwit/non-segwit technicalities for you.</p>
-<p>All signatures are assumed to be 73 bytes in size, including the
-length prefix (segwit) or push opcode (pre-segwit) and sighash
-postfix.</p>
-<p>This function may panic on misformed <code>Miniscript</code> objects which do not
-correspond to semantically sane Scripts. (Such scripts should be rejected
-at parse time. Any exceptions are bugs.)</p>
-</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-Clone' class='anchor'></a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx></code></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Debug' class='anchor'></a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></code></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Display' class='anchor'></a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></code></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>, </span></code><a href='#impl-Eq' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-FromTree' class='impl'><code class='in-band'>impl<Pk, Ctx> FromTree for <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>,<br> <Pk as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>,<br> <<Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>, </span></code><a href='#impl-FromTree' class='anchor'></a></h3><div class='impl-items'><h4 id='method.from_tree' class="method hidden"><code>fn <a href='#method.from_tree' class='fnname'>from_tree</a>(top: &Tree) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx>, Error></code></h4></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>, </span></code><a href='#impl-Hash' class='anchor'></a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H) <span class="where fmt-newline">where<br> __H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
-</div><h4 id='method.hash_slice' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#192-199' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
-</div></div><h3 id='impl-Liftable%3CPk%3E' class='impl'><code class='in-band'>impl<Pk, Ctx> Liftable<Pk> for <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Liftable%3CPk%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.lift' class="method hidden"><code>fn <a href='#method.lift' class='fnname'>lift</a>(&self) -> Policy<Pk></code></h4><div class='docblock hidden'><p>Convert the object into an abstract policy</p>
-</div></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, </span></code><a href='#impl-Ord' class='anchor'></a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
-</div><h4 id='method.max' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#599-604' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
-</div><h4 id='method.min' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#619-624' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
-</div><h4 id='method.clamp' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#646-658' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
-</div></div><h3 id='impl-PartialEq%3CTerminal%3CPk%2C%20Ctx%3E%3E' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx>> for <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><Ctx>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><Pk>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>>, </span></code><a href='#impl-PartialEq%3CTerminal%3CPk%2C%20Ctx%3E%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-PartialOrd%3CTerminal%3CPk%2C%20Ctx%3E%3E' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx>> for <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><Ctx>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><Pk>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>>, </span></code><a href='#impl-PartialOrd%3CTerminal%3CPk%2C%20Ctx%3E%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
-</div><h4 id='method.lt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
-</div><h4 id='method.le' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
-</div><h4 id='method.gt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
-</div><h4 id='method.ge' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
-</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-StructuralEq' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-StructuralPartialEq' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>, </span></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>, </span></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2237-2247' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2239-2246' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Error` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Error"><title>magical::descriptor::error::Error - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Error</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.BIP32">BIP32</a><a href="#variant.Base58">Base58</a><a href="#variant.CantDeriveWithMiniscript">CantDeriveWithMiniscript</a><a href="#variant.HardenedDerivationOnXpub">HardenedDerivationOnXpub</a><a href="#variant.Hex">Hex</a><a href="#variant.InputIndexDoesntExist">InputIndexDoesntExist</a><a href="#variant.InternalError">InternalError</a><a href="#variant.InvalidDescriptorCharacter">InvalidDescriptorCharacter</a><a href="#variant.InvalidPrefix">InvalidPrefix</a><a href="#variant.KeyParsingError">KeyParsingError</a><a href="#variant.MalformedInput">MalformedInput</a><a href="#variant.Miniscript">Miniscript</a><a href="#variant.MissingDetails">MissingDetails</a><a href="#variant.MissingPublicKey">MissingPublicKey</a><a href="#variant.PK">PK</a><a href="#variant.Policy">Policy</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Error">Error</a><a href="#impl-From%3CError%3E">From<Error></a><a href="#impl-From%3CPolicyError%3E">From<PolicyError></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>error</a></p><script>window.sidebarCurrent = {name: 'Error', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/descriptor/error.rs.html#29-51' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>error</a>::<wbr><a class="enum" href=''>Error</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Error {
- InternalError,
- InvalidPrefix(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>),
- HardenedDerivationOnXpub,
- MalformedInput,
- KeyParsingError(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
- Policy(<a class="enum" href="../../../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a>),
- InputIndexDoesntExist,
- MissingPublicKey,
- MissingDetails,
- InvalidDescriptorCharacter(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a>),
- CantDeriveWithMiniscript,
- BIP32(Error),
- Base58(Error),
- PK(Error),
- Miniscript(Error),
- Hex(Error),
-}</pre></div><div class='docblock'><p>Errors related to the parsing and usage of descriptors</p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<div id="variant.InternalError" class="variant small-section-header"><a href="#variant.InternalError" class="anchor field"></a><code>InternalError</code></div><div id="variant.InvalidPrefix" class="variant small-section-header"><a href="#variant.InvalidPrefix" class="anchor field"></a><code>InvalidPrefix(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>)</code></div><div id="variant.HardenedDerivationOnXpub" class="variant small-section-header"><a href="#variant.HardenedDerivationOnXpub" class="anchor field"></a><code>HardenedDerivationOnXpub</code></div><div id="variant.MalformedInput" class="variant small-section-header"><a href="#variant.MalformedInput" class="anchor field"></a><code>MalformedInput</code></div><div id="variant.KeyParsingError" class="variant small-section-header"><a href="#variant.KeyParsingError" class="anchor field"></a><code>KeyParsingError(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></div><div id="variant.Policy" class="variant small-section-header"><a href="#variant.Policy" class="anchor field"></a><code>Policy(<a class="enum" href="../../../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a>)</code></div><div id="variant.InputIndexDoesntExist" class="variant small-section-header"><a href="#variant.InputIndexDoesntExist" class="anchor field"></a><code>InputIndexDoesntExist</code></div><div id="variant.MissingPublicKey" class="variant small-section-header"><a href="#variant.MissingPublicKey" class="anchor field"></a><code>MissingPublicKey</code></div><div id="variant.MissingDetails" class="variant small-section-header"><a href="#variant.MissingDetails" class="anchor field"></a><code>MissingDetails</code></div><div id="variant.InvalidDescriptorCharacter" class="variant small-section-header"><a href="#variant.InvalidDescriptorCharacter" class="anchor field"></a><code>InvalidDescriptorCharacter(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a>)</code></div><div id="variant.CantDeriveWithMiniscript" class="variant small-section-header"><a href="#variant.CantDeriveWithMiniscript" class="anchor field"></a><code>CantDeriveWithMiniscript</code></div><div id="variant.BIP32" class="variant small-section-header"><a href="#variant.BIP32" class="anchor field"></a><code>BIP32(Error)</code></div><div id="variant.Base58" class="variant small-section-header"><a href="#variant.Base58" class="anchor field"></a><code>Base58(Error)</code></div><div id="variant.PK" class="variant small-section-header"><a href="#variant.PK" class="anchor field"></a><code>PK(Error)</code></div><div id="variant.Miniscript" class="variant small-section-header"><a href="#variant.Miniscript" class="anchor field"></a><code>Miniscript(Error)</code></div><div id="variant.Hex" class="variant small-section-header"><a href="#variant.Hex" class="anchor field"></a><code>Hex(Error)</code></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/error.rs.html#28' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/descriptor/error.rs.html#28' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/error.rs.html#53-57' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/descriptor/error.rs.html#54-56' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Error' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a></code><a href='#impl-Error' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/error.rs.html#59' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.source' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source' class='fnname'>source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><span class='since' title='Stable since Rust version 1.30.0'>1.30.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#100-102' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
-</div><h4 id='method.backtrace' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace' class='fnname'>backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#128-130' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>backtrace</code>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
-</div><h4 id='method.description' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description' class='fnname'>description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#140-142' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
-</div></div><div class='docblock hidden'><p><code>if let Err(e) = "xc".parse::<u32>() { // Print </code>e<code> itself, no need for description(). eprintln!("Error: {}", e); }</code> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></p>
-</div><h4 id='method.cause' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#150-152' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
-</div></div></div><h3 id='impl-From%3CError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a>> for <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CError%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a>) -> Self</code><a class='srclink' href='../../../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-1' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a></code><a href='#impl-From%3CError%3E-1' class='anchor'></a><a class='srclink' href='../../../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../../../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-2' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a></code><a href='#impl-From%3CError%3E-2' class='anchor'></a><a class='srclink' href='../../../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../../../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-3' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a></code><a href='#impl-From%3CError%3E-3' class='anchor'></a><a class='srclink' href='../../../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-3' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../../../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-4' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a></code><a href='#impl-From%3CError%3E-4' class='anchor'></a><a class='srclink' href='../../../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-4' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../../../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-5' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a></code><a href='#impl-From%3CError%3E-5' class='anchor'></a><a class='srclink' href='../../../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-5' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../../../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CPolicyError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a>> for <a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a></code><a href='#impl-From%3CPolicyError%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-6' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../../../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a>) -> Self</code><a class='srclink' href='../../../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-7' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2237-2247' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2239-2246' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `error` mod in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, error"><title>magical::descriptor::error - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module error</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#enums">Enums</a></li></ul></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'error', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/descriptor/error.rs.html#25-66' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a class="mod" href=''>error</a></span></h1><div class='docblock'><p>Descriptor errors</p>
-</div><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
-<table><tr class='module-item'><td><a class="enum" href="enum.Error.html" title='magical::descriptor::error::Error enum'>Error</a></td><td class='docblock-short'><p>Errors related to the parsing and usage of descriptors</p>
-</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"enum":[["Error","Errors related to the parsing and usage of descriptors"]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `descriptor` mod in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, descriptor"><title>magical::descriptor - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module descriptor</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'><a href='../index.html'>magical</a></p><script>window.sidebarCurrent = {name: 'descriptor', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/descriptor/mod.rs.html#25-440' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>magical</a>::<wbr><a class="mod" href=''>descriptor</a></span></h1><div class='docblock'><p>Descriptors</p>
-<p>This module contains generic utilities to work with descriptors, plus some re-exported types
-from [<code>miniscript</code>].</p>
-</div><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
-<table><tr><td><code>pub use self::checksum::<a class="fn" href="../../magical/descriptor/checksum/fn.get_checksum.html" title="fn magical::descriptor::checksum::get_checksum">get_checksum</a>;</code></td></tr><tr><td><code>pub use self::policy::<a class="struct" href="../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a>;</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
-<table><tr class='module-item'><td><a class="mod" href="checksum/index.html" title='magical::descriptor::checksum mod'>checksum</a></td><td class='docblock-short'><p>Descriptor checksum</p>
-</td></tr><tr class='module-item'><td><a class="mod" href="error/index.html" title='magical::descriptor::error mod'>error</a></td><td class='docblock-short'><p>Descriptor errors</p>
-</td></tr><tr class='module-item'><td><a class="mod" href="policy/index.html" title='magical::descriptor::policy mod'>policy</a></td><td class='docblock-short'><p>Descriptor policy</p>
-</td></tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
-<table><tr class='module-item'><td><a class="struct" href="struct.Miniscript.html" title='magical::descriptor::Miniscript struct'>Miniscript</a></td><td class='docblock-short'><p>Top-level script AST type</p>
-</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
-<table><tr class='module-item'><td><a class="enum" href="enum.Descriptor.html" title='magical::descriptor::Descriptor enum'>Descriptor</a></td><td class='docblock-short'><p>Script descriptor</p>
-</td></tr><tr class='module-item'><td><a class="enum" href="enum.Legacy.html" title='magical::descriptor::Legacy enum'>Legacy</a></td><td class='docblock-short'><p>Legacy ScriptContext</p>
-</td></tr><tr class='module-item'><td><a class="enum" href="enum.Segwitv0.html" title='magical::descriptor::Segwitv0 enum'>Segwitv0</a></td><td class='docblock-short'><p>Segwitv0 ScriptContext</p>
-</td></tr><tr class='module-item'><td><a class="enum" href="enum.Terminal.html" title='magical::descriptor::Terminal enum'>Terminal</a></td><td class='docblock-short'><p>All AST elements</p>
-</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
-<table><tr class='module-item'><td><a class="trait" href="trait.ExtractPolicy.html" title='magical::descriptor::ExtractPolicy trait'>ExtractPolicy</a></td><td class='docblock-short'><p>Trait implemented on <a href="../../magical/descriptor/enum.Descriptor.html" title="`Descriptor`"><code>Descriptor</code></a>s to add a method to extract the spending <a href="../../magical/descriptor/policy/index.html" title="`policy`"><code>policy</code></a></p>
-</td></tr><tr class='module-item'><td><a class="trait" href="trait.MiniscriptKey.html" title='magical::descriptor::MiniscriptKey trait'>MiniscriptKey</a></td><td class='docblock-short'><p>Public key trait which can be converted to Hash type</p>
-</td></tr><tr class='module-item'><td><a class="trait" href="trait.ScriptContext.html" title='magical::descriptor::ScriptContext trait'>ScriptContext</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="trait" href="trait.ToPublicKey.html" title='magical::descriptor::ToPublicKey trait'>ToPublicKey</a></td><td class='docblock-short'><p>Trait describing public key types which can be converted to bitcoin pubkeys</p>
-</td></tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
-<table><tr class='module-item'><td><a class="type" href="type.ExtendedDescriptor.html" title='magical::descriptor::ExtendedDescriptor type'>ExtendedDescriptor</a></td><td class='docblock-short'><p>Alias for a <a href="../../magical/descriptor/enum.Descriptor.html" title="`Descriptor`"><code>Descriptor</code></a> that can contain extended keys using [<code>DescriptorPublicKey</code>]</p>
-</td></tr><tr class='module-item'><td><a class="type" href="type.HDKeyPaths.html" title='magical::descriptor::HDKeyPaths type'>HDKeyPaths</a></td><td class='docblock-short'><p>Alias for the type of maps that represent derivation paths in a <a href="bitcoin::util::psbt::Input"><code>psbt::Input</code></a> or
-<a href="bitcoin::util::psbt::Output"><code>psbt::Output</code></a></p>
-</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `PolicyError` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, PolicyError"><title>magical::descriptor::policy::PolicyError - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum PolicyError</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.AddOnLeaf">AddOnLeaf</a><a href="#variant.AddOnPartialComplete">AddOnPartialComplete</a><a href="#variant.IncompatibleConditions">IncompatibleConditions</a><a href="#variant.IndexOutOfRange">IndexOutOfRange</a><a href="#variant.MixedTimelockUnits">MixedTimelockUnits</a><a href="#variant.NotEnoughItemsSelected">NotEnoughItemsSelected</a><a href="#variant.TooManyItemsSelected">TooManyItemsSelected</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Error">Error</a><a href="#impl-From%3CPolicyError%3E">From<PolicyError></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a></p><script>window.sidebarCurrent = {name: 'PolicyError', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#461-469' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a>::<wbr><a class="enum" href=''>PolicyError</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum PolicyError {
- NotEnoughItemsSelected(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
- TooManyItemsSelected(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
- IndexOutOfRange(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>),
- AddOnLeaf,
- AddOnPartialComplete,
- MixedTimelockUnits,
- IncompatibleConditions,
-}</pre></div><div class='docblock'><p>Errors that can happen while extracting and manipulating policies</p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<div id="variant.NotEnoughItemsSelected" class="variant small-section-header"><a href="#variant.NotEnoughItemsSelected" class="anchor field"></a><code>NotEnoughItemsSelected(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></div><div id="variant.TooManyItemsSelected" class="variant small-section-header"><a href="#variant.TooManyItemsSelected" class="anchor field"></a><code>TooManyItemsSelected(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></div><div id="variant.IndexOutOfRange" class="variant small-section-header"><a href="#variant.IndexOutOfRange" class="anchor field"></a><code>IndexOutOfRange(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></div><div id="variant.AddOnLeaf" class="variant small-section-header"><a href="#variant.AddOnLeaf" class="anchor field"></a><code>AddOnLeaf</code></div><div id="variant.AddOnPartialComplete" class="variant small-section-header"><a href="#variant.AddOnPartialComplete" class="anchor field"></a><code>AddOnPartialComplete</code></div><div id="variant.MixedTimelockUnits" class="variant small-section-header"><a href="#variant.MixedTimelockUnits" class="anchor field"></a><code>MixedTimelockUnits</code></div><div id="variant.IncompatibleConditions" class="variant small-section-header"><a href="#variant.IncompatibleConditions" class="anchor field"></a><code>IncompatibleConditions</code></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#460' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#460' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#471-475' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#472-474' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Error' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a></code><a href='#impl-Error' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#477' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.source' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source' class='fnname'>source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><span class='since' title='Stable since Rust version 1.30.0'>1.30.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#100-102' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
-</div><h4 id='method.backtrace' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace' class='fnname'>backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#128-130' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>backtrace</code>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
-</div><h4 id='method.description' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description' class='fnname'>description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#140-142' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
-</div></div><div class='docblock hidden'><p><code>if let Err(e) = "xc".parse::<u32>() { // Print </code>e<code> itself, no need for description(). eprintln!("Error: {}", e); }</code> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></p>
-</div><h4 id='method.cause' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#150-152' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
-</div></div></div><h3 id='impl-From%3CPolicyError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a>> for <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CPolicyError%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../../../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a>) -> Self</code><a class='srclink' href='../../../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CPolicyError%3E-1' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a>> for <a class="enum" href="../../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a></code><a href='#impl-From%3CPolicyError%3E-1' class='anchor'></a><a class='srclink' href='../../../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../../../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a>) -> Self</code><a class='srclink' href='../../../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2237-2247' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2239-2246' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Satisfaction` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Satisfaction"><title>magical::descriptor::policy::Satisfaction - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Satisfaction</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Complete">Complete</a><a href="#variant.None">None</a><a href="#variant.Partial">Partial</a><a href="#variant.PartialComplete">PartialComplete</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.is_leaf">is_leaf</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-From%3Cbool%3E">From<bool></a><a href="#impl-Serialize">Serialize</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a></p><script>window.sidebarCurrent = {name: 'Satisfaction', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#237-273' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a>::<wbr><a class="enum" href=''>Satisfaction</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Satisfaction {
- Partial {
- n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
- m: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
- items: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>,
- conditions: <a class="type" href="../../../magical/descriptor/policy/type.ConditionMap.html" title="type magical::descriptor::policy::ConditionMap">ConditionMap</a>,
- },
- PartialComplete {
- n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
- m: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
- items: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>,
- conditions: <a class="type" href="../../../magical/descriptor/policy/type.FoldedConditionMap.html" title="type magical::descriptor::policy::FoldedConditionMap">FoldedConditionMap</a>,
- },
- Complete {
- condition: <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a>,
- },
- None,
-}</pre></div><div class='docblock'><p>Represent if and how much a policy item is satisfied by the wallet's descriptor</p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<div id="variant.Partial" class="variant small-section-header"><a href="#variant.Partial" class="anchor field"></a><code>Partial</code></div><div class='docblock'><p>Only a partial satisfaction of some kind of threshold policy</p>
-</div><div class='autohide sub-variant' id='variant.Partial.fields'><h3>Fields of <b>Partial</b></h3><div><span id="variant.Partial.field.n" class="variant small-section-header"><a href="#variant.Partial.field.n" class="anchor field"></a><code>n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span><div class='docblock'><p>Total number of items</p>
-</div><span id="variant.Partial.field.m" class="variant small-section-header"><a href="#variant.Partial.field.m" class="anchor field"></a><code>m: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span><div class='docblock'><p>Threshold</p>
-</div><span id="variant.Partial.field.items" class="variant small-section-header"><a href="#variant.Partial.field.items" class="anchor field"></a><code>items: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code></span><div class='docblock'><p>The items that can be satisfied by the descriptor</p>
-</div><span id="variant.Partial.field.conditions" class="variant small-section-header"><a href="#variant.Partial.field.conditions" class="anchor field"></a><code>conditions: <a class="type" href="../../../magical/descriptor/policy/type.ConditionMap.html" title="type magical::descriptor::policy::ConditionMap">ConditionMap</a></code></span><div class='docblock'><p>Extra conditions that also need to be satisfied</p>
-</div></div></div><div id="variant.PartialComplete" class="variant small-section-header"><a href="#variant.PartialComplete" class="anchor field"></a><code>PartialComplete</code></div><div class='docblock'><p>Can reach the threshold of some kind of threshold policy</p>
-</div><div class='autohide sub-variant' id='variant.PartialComplete.fields'><h3>Fields of <b>PartialComplete</b></h3><div><span id="variant.PartialComplete.field.n" class="variant small-section-header"><a href="#variant.PartialComplete.field.n" class="anchor field"></a><code>n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span><div class='docblock'><p>Total number of items</p>
-</div><span id="variant.PartialComplete.field.m" class="variant small-section-header"><a href="#variant.PartialComplete.field.m" class="anchor field"></a><code>m: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span><div class='docblock'><p>Threshold</p>
-</div><span id="variant.PartialComplete.field.items" class="variant small-section-header"><a href="#variant.PartialComplete.field.items" class="anchor field"></a><code>items: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code></span><div class='docblock'><p>The items that can be satisfied by the descriptor</p>
-</div><span id="variant.PartialComplete.field.conditions" class="variant small-section-header"><a href="#variant.PartialComplete.field.conditions" class="anchor field"></a><code>conditions: <a class="type" href="../../../magical/descriptor/policy/type.FoldedConditionMap.html" title="type magical::descriptor::policy::FoldedConditionMap">FoldedConditionMap</a></code></span><div class='docblock'><p>Extra conditions that also need to be satisfied</p>
-</div></div></div><div id="variant.Complete" class="variant small-section-header"><a href="#variant.Complete" class="anchor field"></a><code>Complete</code></div><div class='docblock'><p>Can satisfy the policy item</p>
-</div><div class='autohide sub-variant' id='variant.Complete.fields'><h3>Fields of <b>Complete</b></h3><div><span id="variant.Complete.field.condition" class="variant small-section-header"><a href="#variant.Complete.field.condition" class="anchor field"></a><code>condition: <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code></span><div class='docblock'><p>Extra conditions that also need to be satisfied</p>
-</div></div></div><div id="variant.None" class="variant small-section-header"><a href="#variant.None" class="anchor field"></a><code>None</code></div><div class='docblock'><p>Cannot satisfy or contribute to the policy item</p>
-</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="enum" href="../../../magical/descriptor/policy/enum.Satisfaction.html" title="enum magical::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#275-389' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.is_leaf' class="method"><code>pub fn <a href='#method.is_leaf' class='fnname'>is_leaf</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#276-281' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.Satisfaction.html" title="enum magical::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#235' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../magical/descriptor/policy/enum.Satisfaction.html" title="enum magical::descriptor::policy::Satisfaction">Satisfaction</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#235' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.Satisfaction.html" title="enum magical::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#235' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#235' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-From%3Cbool%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>> for <a class="enum" href="../../../magical/descriptor/policy/enum.Satisfaction.html" title="enum magical::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-From%3Cbool%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#391-401' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> Self</code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#392-400' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.Satisfaction.html" title="enum magical::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#235' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code>fn <a href='https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#235' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.Satisfaction.html" title="enum magical::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.Satisfaction.html" title="enum magical::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.Satisfaction.html" title="enum magical::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.Satisfaction.html" title="enum magical::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.Satisfaction.html" title="enum magical::descriptor::policy::Satisfaction">Satisfaction</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `SatisfiableItem` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, SatisfiableItem"><title>magical::descriptor::policy::SatisfiableItem - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum SatisfiableItem</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.AbsoluteTimelock">AbsoluteTimelock</a><a href="#variant.HASH160Preimage">HASH160Preimage</a><a href="#variant.HASH256Preimage">HASH256Preimage</a><a href="#variant.Multisig">Multisig</a><a href="#variant.RIPEMD160Preimage">RIPEMD160Preimage</a><a href="#variant.RelativeTimelock">RelativeTimelock</a><a href="#variant.SHA256Preimage">SHA256Preimage</a><a href="#variant.Signature">Signature</a><a href="#variant.SignatureKey">SignatureKey</a><a href="#variant.Thresh">Thresh</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.id">id</a><a href="#method.is_leaf">is_leaf</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-From%3CSatisfiableItem%3E">From<SatisfiableItem></a><a href="#impl-Serialize">Serialize</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a></p><script>window.sidebarCurrent = {name: 'SatisfiableItem', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#107-139' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a>::<wbr><a class="enum" href=''>SatisfiableItem</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum SatisfiableItem {
- Signature(<a class="struct" href="../../../magical/descriptor/policy/struct.PKOrF.html" title="struct magical::descriptor::policy::PKOrF">PKOrF</a>),
- SignatureKey(<a class="struct" href="../../../magical/descriptor/policy/struct.PKOrF.html" title="struct magical::descriptor::policy::PKOrF">PKOrF</a>),
- SHA256Preimage {
- hash: Hash,
- },
- HASH256Preimage {
- hash: Hash,
- },
- RIPEMD160Preimage {
- hash: Hash,
- },
- HASH160Preimage {
- hash: Hash,
- },
- AbsoluteTimelock {
- value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
- },
- RelativeTimelock {
- value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
- },
- Thresh {
- items: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a>>,
- threshold: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
- },
- Multisig {
- keys: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../magical/descriptor/policy/struct.PKOrF.html" title="struct magical::descriptor::policy::PKOrF">PKOrF</a>>,
- threshold: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
- },
-}</pre></div><div class='docblock'><p>An item that need to be satisfied</p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<div id="variant.Signature" class="variant small-section-header"><a href="#variant.Signature" class="anchor field"></a><code>Signature(<a class="struct" href="../../../magical/descriptor/policy/struct.PKOrF.html" title="struct magical::descriptor::policy::PKOrF">PKOrF</a>)</code></div><div id="variant.SignatureKey" class="variant small-section-header"><a href="#variant.SignatureKey" class="anchor field"></a><code>SignatureKey(<a class="struct" href="../../../magical/descriptor/policy/struct.PKOrF.html" title="struct magical::descriptor::policy::PKOrF">PKOrF</a>)</code></div><div id="variant.SHA256Preimage" class="variant small-section-header"><a href="#variant.SHA256Preimage" class="anchor field"></a><code>SHA256Preimage</code></div><div class='autohide sub-variant' id='variant.SHA256Preimage.fields'><h3>Fields of <b>SHA256Preimage</b></h3><div><span id="variant.SHA256Preimage.field.hash" class="variant small-section-header"><a href="#variant.SHA256Preimage.field.hash" class="anchor field"></a><code>hash: Hash</code></span></div></div><div id="variant.HASH256Preimage" class="variant small-section-header"><a href="#variant.HASH256Preimage" class="anchor field"></a><code>HASH256Preimage</code></div><div class='autohide sub-variant' id='variant.HASH256Preimage.fields'><h3>Fields of <b>HASH256Preimage</b></h3><div><span id="variant.HASH256Preimage.field.hash" class="variant small-section-header"><a href="#variant.HASH256Preimage.field.hash" class="anchor field"></a><code>hash: Hash</code></span></div></div><div id="variant.RIPEMD160Preimage" class="variant small-section-header"><a href="#variant.RIPEMD160Preimage" class="anchor field"></a><code>RIPEMD160Preimage</code></div><div class='autohide sub-variant' id='variant.RIPEMD160Preimage.fields'><h3>Fields of <b>RIPEMD160Preimage</b></h3><div><span id="variant.RIPEMD160Preimage.field.hash" class="variant small-section-header"><a href="#variant.RIPEMD160Preimage.field.hash" class="anchor field"></a><code>hash: Hash</code></span></div></div><div id="variant.HASH160Preimage" class="variant small-section-header"><a href="#variant.HASH160Preimage" class="anchor field"></a><code>HASH160Preimage</code></div><div class='autohide sub-variant' id='variant.HASH160Preimage.fields'><h3>Fields of <b>HASH160Preimage</b></h3><div><span id="variant.HASH160Preimage.field.hash" class="variant small-section-header"><a href="#variant.HASH160Preimage.field.hash" class="anchor field"></a><code>hash: Hash</code></span></div></div><div id="variant.AbsoluteTimelock" class="variant small-section-header"><a href="#variant.AbsoluteTimelock" class="anchor field"></a><code>AbsoluteTimelock</code></div><div class='autohide sub-variant' id='variant.AbsoluteTimelock.fields'><h3>Fields of <b>AbsoluteTimelock</b></h3><div><span id="variant.AbsoluteTimelock.field.value" class="variant small-section-header"><a href="#variant.AbsoluteTimelock.field.value" class="anchor field"></a><code>value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code></span></div></div><div id="variant.RelativeTimelock" class="variant small-section-header"><a href="#variant.RelativeTimelock" class="anchor field"></a><code>RelativeTimelock</code></div><div class='autohide sub-variant' id='variant.RelativeTimelock.fields'><h3>Fields of <b>RelativeTimelock</b></h3><div><span id="variant.RelativeTimelock.field.value" class="variant small-section-header"><a href="#variant.RelativeTimelock.field.value" class="anchor field"></a><code>value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code></span></div></div><div id="variant.Thresh" class="variant small-section-header"><a href="#variant.Thresh" class="anchor field"></a><code>Thresh</code></div><div class='autohide sub-variant' id='variant.Thresh.fields'><h3>Fields of <b>Thresh</b></h3><div><span id="variant.Thresh.field.items" class="variant small-section-header"><a href="#variant.Thresh.field.items" class="anchor field"></a><code>items: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a>></code></span><span id="variant.Thresh.field.threshold" class="variant small-section-header"><a href="#variant.Thresh.field.threshold" class="anchor field"></a><code>threshold: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span></div></div><div id="variant.Multisig" class="variant small-section-header"><a href="#variant.Multisig" class="anchor field"></a><code>Multisig</code></div><div class='autohide sub-variant' id='variant.Multisig.fields'><h3>Fields of <b>Multisig</b></h3><div><span id="variant.Multisig.field.keys" class="variant small-section-header"><a href="#variant.Multisig.field.keys" class="anchor field"></a><code>keys: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../magical/descriptor/policy/struct.PKOrF.html" title="struct magical::descriptor::policy::PKOrF">PKOrF</a>></code></span><span id="variant.Multisig.field.threshold" class="variant small-section-header"><a href="#variant.Multisig.field.threshold" class="anchor field"></a><code>threshold: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span></div></div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="enum" href="../../../magical/descriptor/policy/enum.SatisfiableItem.html" title="enum magical::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#141-156' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.is_leaf' class="method"><code>pub fn <a href='#method.is_leaf' class='fnname'>is_leaf</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#142-150' title='goto source code'>[src]</a></h4><h4 id='method.id' class="method"><code>pub fn <a href='#method.id' class='fnname'>id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#152-155' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.SatisfiableItem.html" title="enum magical::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#105' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../magical/descriptor/policy/enum.SatisfiableItem.html" title="enum magical::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#105' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.SatisfiableItem.html" title="enum magical::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#105' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#105' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-From%3CSatisfiableItem%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../magical/descriptor/policy/enum.SatisfiableItem.html" title="enum magical::descriptor::policy::SatisfiableItem">SatisfiableItem</a>> for <a class="struct" href="../../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a></code><a href='#impl-From%3CSatisfiableItem%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#643-647' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(other: <a class="enum" href="../../../magical/descriptor/policy/enum.SatisfiableItem.html" title="enum magical::descriptor::policy::SatisfiableItem">SatisfiableItem</a>) -> Self</code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#644-646' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.SatisfiableItem.html" title="enum magical::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#105' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code>fn <a href='https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#105' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.SatisfiableItem.html" title="enum magical::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.SatisfiableItem.html" title="enum magical::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.SatisfiableItem.html" title="enum magical::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.SatisfiableItem.html" title="enum magical::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../magical/descriptor/policy/enum.SatisfiableItem.html" title="enum magical::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `policy` mod in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, policy"><title>magical::descriptor::policy - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module policy</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'policy', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#25-795' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a class="mod" href=''>policy</a></span></h1><div class='docblock'><p>Descriptor policy</p>
-<p>This module implements the logic to extract and represent the spending policies of a descriptor
-in a more human-readable format.</p>
-<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
-<div class="example-wrap"><pre class="rust rust-example-rendered">
-<span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"wsh(and_v(v:pk(cV3oCth6zxZ1UVsHLnGothsWNsaoxRhC6aeNi5VbSdFpwUkgkEci),or_d(pk(cVMTy7uebJgvFaSBwcgvwk8qn8xSLc97dKow4MBetjrrahZoimm2),older(12960))))"</span>;
-
-<span class="kw">let</span> (<span class="ident">extended_desc</span>, <span class="ident">key_map</span>) <span class="op">=</span> <span class="ident">ExtendedDescriptor</span>::<span class="ident">parse_secret</span>(<span class="ident">desc</span>)<span class="question-mark">?</span>;
-<span class="macro">println</span><span class="macro">!</span>(<span class="string">"{:?}"</span>, <span class="ident">extended_desc</span>);
-
-<span class="kw">let</span> <span class="ident">signers</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">key_map</span>.<span class="ident">into</span>());
-<span class="kw">let</span> <span class="ident">policy</span> <span class="op">=</span> <span class="ident">extended_desc</span>.<span class="ident">extract_policy</span>(<span class="ident">signers</span>)<span class="question-mark">?</span>;
-<span class="macro">println</span><span class="macro">!</span>(<span class="string">"policy: {}"</span>, <span class="ident">serde_json</span>::<span class="ident">to_string</span>(<span class="kw-2">&</span><span class="ident">policy</span>)<span class="question-mark">?</span>);</pre></div>
-</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
-<table><tr class='module-item'><td><a class="struct" href="struct.Condition.html" title='magical::descriptor::policy::Condition struct'>Condition</a></td><td class='docblock-short'><p>An extra condition that must be satisfied but that is out of control of the user</p>
-</td></tr><tr class='module-item'><td><a class="struct" href="struct.PKOrF.html" title='magical::descriptor::policy::PKOrF struct'>PKOrF</a></td><td class='docblock-short'><p>Raw public key or extended key fingerprint</p>
-</td></tr><tr class='module-item'><td><a class="struct" href="struct.Policy.html" title='magical::descriptor::policy::Policy struct'>Policy</a></td><td class='docblock-short'><p>Descriptor spending policy</p>
-</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
-<table><tr class='module-item'><td><a class="enum" href="enum.PolicyError.html" title='magical::descriptor::policy::PolicyError enum'>PolicyError</a></td><td class='docblock-short'><p>Errors that can happen while extracting and manipulating policies</p>
-</td></tr><tr class='module-item'><td><a class="enum" href="enum.Satisfaction.html" title='magical::descriptor::policy::Satisfaction enum'>Satisfaction</a></td><td class='docblock-short'><p>Represent if and how much a policy item is satisfied by the wallet's descriptor</p>
-</td></tr><tr class='module-item'><td><a class="enum" href="enum.SatisfiableItem.html" title='magical::descriptor::policy::SatisfiableItem enum'>SatisfiableItem</a></td><td class='docblock-short'><p>An item that need to be satisfied</p>
-</td></tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
-<table><tr class='module-item'><td><a class="type" href="type.ConditionMap.html" title='magical::descriptor::policy::ConditionMap type'>ConditionMap</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="type" href="type.FoldedConditionMap.html" title='magical::descriptor::policy::FoldedConditionMap type'>FoldedConditionMap</a></td><td class='docblock-short'></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"enum":[["PolicyError","Errors that can happen while extracting and manipulating policies"],["Satisfaction","Represent if and how much a policy item is satisfied by the wallet's descriptor"],["SatisfiableItem","An item that need to be satisfied"]],"struct":[["Condition","An extra condition that must be satisfied but that is out of control of the user"],["PKOrF","Raw public key or extended key fingerprint"],["Policy","Descriptor spending policy"]],"type":[["ConditionMap",""],["FoldedConditionMap",""]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Condition` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Condition"><title>magical::descriptor::policy::Condition - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Condition</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.csv">csv</a><a href="#structfield.timelock">timelock</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.is_null">is_null</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Eq">Eq</a><a href="#impl-Hash">Hash</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CCondition%3E">PartialEq<Condition></a><a href="#impl-PartialOrd%3CCondition%3E">PartialOrd<Condition></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a></p><script>window.sidebarCurrent = {name: 'Condition', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#420-425' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a>::<wbr><a class="struct" href=''>Condition</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Condition {
- pub csv: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>,
- pub timelock: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>,
-}</pre></div><div class='docblock'><p>An extra condition that must be satisfied but that is out of control of the user</p>
-</div><h2 id='fields' class='fields small-section-header'>
- Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.csv" class="structfield small-section-header"><a href="#structfield.csv" class="anchor field"></a><code>csv: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>></code></span><span id="structfield.timelock" class="structfield small-section-header"><a href="#structfield.timelock" class="anchor field"></a><code>timelock: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>></code></span><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#427-457' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.is_null' class="method"><code>pub fn <a href='#method.is_null' class='fnname'>is_null</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#454-456' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
-</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H)</code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
-</div><h4 id='method.hash_slice' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#192-199' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
-</div></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl-Ord' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
-</div><h4 id='method.max' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#599-604' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
-</div><h4 id='method.min' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#619-624' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
-</div><h4 id='method.clamp' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#646-658' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
-</div></div><h3 id='impl-PartialEq%3CCondition%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a>> for <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl-PartialEq%3CCondition%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-PartialOrd%3CCondition%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a>> for <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl-PartialOrd%3CCondition%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
-</div><h4 id='method.lt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: &<a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
-</div><h4 id='method.le' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: &<a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
-</div><h4 id='method.gt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: &<a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
-</div><h4 id='method.ge' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: &<a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
-</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code>fn <a href='https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
-</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#419' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `PKOrF` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, PKOrF"><title>magical::descriptor::policy::PKOrF - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct PKOrF</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Serialize">Serialize</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a></p><script>window.sidebarCurrent = {name: 'PKOrF', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#73-80' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a>::<wbr><a class="struct" href=''>PKOrF</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct PKOrF { /* fields omitted */ }</pre></div><div class='docblock'><p>Raw public key or extended key fingerprint</p>
-</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.PKOrF.html" title="struct magical::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#72' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../../magical/descriptor/policy/struct.PKOrF.html" title="struct magical::descriptor::policy::PKOrF">PKOrF</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#72' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.PKOrF.html" title="struct magical::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#72' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#72' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.PKOrF.html" title="struct magical::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#72' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../../magical/descriptor/policy/struct.PKOrF.html" title="struct magical::descriptor::policy::PKOrF">PKOrF</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#72' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
-</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.PKOrF.html" title="struct magical::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#72' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code>fn <a href='https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#72' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.PKOrF.html" title="struct magical::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.PKOrF.html" title="struct magical::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.PKOrF.html" title="struct magical::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.PKOrF.html" title="struct magical::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.PKOrF.html" title="struct magical::descriptor::policy::PKOrF">PKOrF</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Policy` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Policy"><title>magical::descriptor::policy::Policy - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Policy</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.contribution">contribution</a><a href="#structfield.id">id</a><a href="#structfield.item">item</a><a href="#structfield.satisfaction">satisfaction</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.get_condition">get_condition</a><a href="#method.requires_path">requires_path</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-From%3CSatisfiableItem%3E">From<SatisfiableItem></a><a href="#impl-Serialize">Serialize</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a></p><script>window.sidebarCurrent = {name: 'Policy', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#405-416' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a>::<wbr><a class="struct" href=''>Policy</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Policy {
- pub id: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
- pub item: <a class="enum" href="../../../magical/descriptor/policy/enum.SatisfiableItem.html" title="enum magical::descriptor::policy::SatisfiableItem">SatisfiableItem</a>,
- pub satisfaction: <a class="enum" href="../../../magical/descriptor/policy/enum.Satisfaction.html" title="enum magical::descriptor::policy::Satisfaction">Satisfaction</a>,
- pub contribution: <a class="enum" href="../../../magical/descriptor/policy/enum.Satisfaction.html" title="enum magical::descriptor::policy::Satisfaction">Satisfaction</a>,
-}</pre></div><div class='docblock'><p>Descriptor spending policy</p>
-</div><h2 id='fields' class='fields small-section-header'>
- Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.id" class="structfield small-section-header"><a href="#structfield.id" class="anchor field"></a><code>id: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></span><div class='docblock'><p>Identifier for this policy node</p>
-</div><span id="structfield.item" class="structfield small-section-header"><a href="#structfield.item" class="anchor field"></a><code>item: <a class="enum" href="../../../magical/descriptor/policy/enum.SatisfiableItem.html" title="enum magical::descriptor::policy::SatisfiableItem">SatisfiableItem</a></code></span><div class='docblock'><p>Type of this policy node</p>
-</div><span id="structfield.satisfaction" class="structfield small-section-header"><a href="#structfield.satisfaction" class="anchor field"></a><code>satisfaction: <a class="enum" href="../../../magical/descriptor/policy/enum.Satisfaction.html" title="enum magical::descriptor::policy::Satisfaction">Satisfaction</a></code></span><div class='docblock'><p>How a much given PSBT already satisfies this polcy node <strong>(currently unused)</strong></p>
-</div><span id="structfield.contribution" class="structfield small-section-header"><a href="#structfield.contribution" class="anchor field"></a><code>contribution: <a class="enum" href="../../../magical/descriptor/policy/enum.Satisfaction.html" title="enum magical::descriptor::policy::Satisfaction">Satisfaction</a></code></span><div class='docblock'><p>How the wallet's descriptor can satisfy this policy node</p>
-</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#479-641' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.requires_path' class="method"><code>pub fn <a href='#method.requires_path' class='fnname'>requires_path</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#572-574' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return whether or not a specific path in the policy tree is required to unambiguously
-create a transaction</p>
-<p>What this means is that for some spending policies the user should select which paths in
-the tree it intends to satisfy while signing, because the transaction must be created differently based
-on that.</p>
-</div><h4 id='method.get_condition' class="method"><code>pub fn <a href='#method.get_condition' class='fnname'>get_condition</a>(<br> &self, <br> path: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/collections/btree/map/struct.BTreeMap.html" title="struct alloc::collections::btree::map::BTreeMap">BTreeMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a>, <a class="enum" href="../../../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a>></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#578-640' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the conditions that are set by the spending policy for a given path in the
-policy tree</p>
-</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#404' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#404' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#404' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#404' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-From%3CSatisfiableItem%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../magical/descriptor/policy/enum.SatisfiableItem.html" title="enum magical::descriptor::policy::SatisfiableItem">SatisfiableItem</a>> for <a class="struct" href="../../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a></code><a href='#impl-From%3CSatisfiableItem%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#643-647' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(other: <a class="enum" href="../../../magical/descriptor/policy/enum.SatisfiableItem.html" title="enum magical::descriptor::policy::SatisfiableItem">SatisfiableItem</a>) -> Self</code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#644-646' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#404' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code>fn <a href='https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#404' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ConditionMap` type in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, ConditionMap"><title>magical::descriptor::policy::ConditionMap - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition ConditionMap</p><div class="sidebar-elems"><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a></p><script>window.sidebarCurrent = {name: 'ConditionMap', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#216' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a>::<wbr><a class="type" href=''>ConditionMap</a></span></h1><pre class='rust typedef'>type ConditionMap = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/collections/btree/map/struct.BTreeMap.html" title="struct alloc::collections::btree::map::BTreeMap">BTreeMap</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a>>>;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `FoldedConditionMap` type in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, FoldedConditionMap"><title>magical::descriptor::policy::FoldedConditionMap - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition FoldedConditionMap</p><div class="sidebar-elems"><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a></p><script>window.sidebarCurrent = {name: 'FoldedConditionMap', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/descriptor/policy.rs.html#217' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>descriptor</a>::<wbr><a href='index.html'>policy</a>::<wbr><a class="type" href=''>FoldedConditionMap</a></span></h1><pre class='rust typedef'>type FoldedConditionMap = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/collections/btree/map/struct.BTreeMap.html" title="struct alloc::collections::btree::map::BTreeMap">BTreeMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../../../magical/descriptor/policy/struct.Condition.html" title="struct magical::descriptor::policy::Condition">Condition</a>>>;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"enum":[["Descriptor","Script descriptor"],["Legacy","Legacy ScriptContext"],["Segwitv0","Segwitv0 ScriptContext"],["Terminal","All AST elements"]],"mod":[["checksum","Descriptor checksum"],["error","Descriptor errors"],["policy","Descriptor policy"]],"struct":[["Miniscript","Top-level script AST type"]],"trait":[["ExtractPolicy","Trait implemented on [`Descriptor`]s to add a method to extract the spending [`policy`]"],["MiniscriptKey","Public key trait which can be converted to Hash type"],["ScriptContext",""],["ToPublicKey","Trait describing public key types which can be converted to bitcoin pubkeys"]],"type":[["ExtendedDescriptor","Alias for a [`Descriptor`] that can contain extended keys using [`DescriptorPublicKey`]"],["HDKeyPaths","Alias for the type of maps that represent derivation paths in a [`psbt::Input`] or [`psbt::Output`]"]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Miniscript` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Miniscript"><title>magical::descriptor::Miniscript - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Miniscript</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.ext">ext</a><a href="#structfield.node">node</a><a href="#structfield.ty">ty</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.as_inner">as_inner</a><a href="#method.encode">encode</a><a href="#method.from_ast">from_ast</a><a href="#method.into_inner">into_inner</a><a href="#method.max_satisfaction_size">max_satisfaction_size</a><a href="#method.max_satisfaction_witness_elements">max_satisfaction_witness_elements</a><a href="#method.parse">parse</a><a href="#method.satisfy">satisfy</a><a href="#method.script_size">script_size</a><a href="#method.translate_pk">translate_pk</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-ExtractPolicy">ExtractPolicy</a><a href="#impl-FromStr">FromStr</a><a href="#impl-FromTree">FromTree</a><a href="#impl-Hash">Hash</a><a href="#impl-Liftable%3CPk%3E">Liftable<Pk></a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CMiniscript%3CPk%2C%20Ctx%3E%3E">PartialEq<Miniscript<Pk, Ctx>></a><a href="#impl-PartialOrd%3CMiniscript%3CPk%2C%20Ctx%3E%3E">PartialOrd<Miniscript<Pk, Ctx>></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'Miniscript', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span></span><span class='in-band'>Struct <a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="struct" href=''>Miniscript</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Miniscript<Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span> {
- pub node: <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx>,
- pub ty: Type,
- pub ext: ExtData,
- // some fields omitted
-}</pre></div><div class='docblock'><p>Top-level script AST type</p>
-</div><h2 id='fields' class='fields small-section-header'>
- Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.node" class="structfield small-section-header"><a href="#structfield.node" class="anchor field"></a><code>node: <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx></code></span><div class='docblock'><p>A node in the Abstract Syntax Tree(</p>
-</div><span id="structfield.ty" class="structfield small-section-header"><a href="#structfield.ty" class="anchor field"></a><code>ty: Type</code></span><div class='docblock'><p>The correctness and malleability type information for the AST node</p>
-</div><span id="structfield.ext" class="structfield small-section-header"><a href="#structfield.ext" class="anchor field"></a><code>ext: ExtData</code></span><div class='docblock'><p>Additional information helpful for extra analysis.</p>
-</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl' class='anchor'></a></h3><div class='impl-items'><h4 id='method.from_ast' class="method"><code>pub fn <a href='#method.from_ast' class='fnname'>from_ast</a>(t: <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>, Error></code></h4><div class='docblock'><p>Add type information(Type and Extdata) to Miniscript based on
-<code>AstElem</code> fragment. Dependent on display and clone because of Error
-Display code of type_check.</p>
-</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-1' class='anchor'></a></h3><div class='impl-items'><h4 id='method.into_inner' class="method"><code>pub fn <a href='#method.into_inner' class='fnname'>into_inner</a>(self) -> <a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx></code></h4><div class='docblock'><p>Extracts the <code>AstElem</code> representing the root of the miniscript</p>
-</div><h4 id='method.as_inner' class="method"><code>pub fn <a href='#method.as_inner' class='fnname'>as_inner</a>(&self) -> &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx></code></h4></div><h3 id='impl-2' class='impl'><code class='in-band'>impl<Ctx> <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><PublicKey, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>, </span></code><a href='#impl-2' class='anchor'></a></h3><div class='impl-items'><h4 id='method.parse' class="method"><code>pub fn <a href='#method.parse' class='fnname'>parse</a>(script: &Script) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><PublicKey, Ctx>, Error></code></h4><div class='docblock'><p>Attempt to parse a script into a Miniscript representation</p>
-</div></div><h3 id='impl-3' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="../../magical/descriptor/trait.ToPublicKey.html" title="trait magical::descriptor::ToPublicKey">ToPublicKey</a>, </span></code><a href='#impl-3' class='anchor'></a></h3><div class='impl-items'><h4 id='method.encode' class="method"><code>pub fn <a href='#method.encode' class='fnname'>encode</a>(&self) -> Script</code></h4><div class='docblock'><p>Encode as a Bitcoin script</p>
-</div><h4 id='method.script_size' class="method"><code>pub fn <a href='#method.script_size' class='fnname'>script_size</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock'><p>Size, in bytes of the script-pubkey. If this Miniscript is used outside
-of segwit (e.g. in a bare or P2SH descriptor), this quantity should be
-multiplied by 4 to compute the weight.</p>
-<p>In general, it is not recommended to use this function directly, but
-to instead call the corresponding function on a <code>Descriptor</code>, which
-will handle the segwit/non-segwit technicalities for you.</p>
-</div><h4 id='method.max_satisfaction_witness_elements' class="method"><code>pub fn <a href='#method.max_satisfaction_witness_elements' class='fnname'>max_satisfaction_witness_elements</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock'><p>Maximum number of witness elements used to satisfy the Miniscript
-fragment, including the witness script itself. Used to estimate
-the weight of the <code>VarInt</code> that specifies this number in a serialized
-transaction.</p>
-<p>This function may panic on misformed <code>Miniscript</code> objects which do
-not correspond to semantically sane Scripts. (Such scripts should be
-rejected at parse time. Any exceptions are bugs.)</p>
-</div><h4 id='method.max_satisfaction_size' class="method"><code>pub fn <a href='#method.max_satisfaction_size' class='fnname'>max_satisfaction_size</a>(&self, one_cost: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock'><p>Maximum size, in bytes, of a satisfying witness. For Segwit outputs
-<code>one_cost</code> should be set to 2, since the number <code>1</code> requires two
-bytes to encode. For non-segwit outputs <code>one_cost</code> should be set to
-1, since <code>OP_1</code> is available in scriptSigs.</p>
-<p>In general, it is not recommended to use this function directly, but
-to instead call the corresponding function on a <code>Descriptor</code>, which
-will handle the segwit/non-segwit technicalities for you.</p>
-<p>All signatures are assumed to be 73 bytes in size, including the
-length prefix (segwit) or push opcode (pre-segwit) and sighash
-postfix.</p>
-<p>This function may panic on misformed <code>Miniscript</code> objects which do not
-correspond to semantically sane Scripts. (Such scripts should be
-rejected at parse time. Any exceptions are bugs.)</p>
-</div></div><h3 id='impl-4' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-4' class='anchor'></a></h3><div class='impl-items'><h4 id='method.translate_pk' class="method"><code>pub fn <a href='#method.translate_pk' class='fnname'>translate_pk</a><FPk, FPkh, Q, FuncError>(<br> &self, <br> translatefpk: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>FPk, <br> translatefpkh: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>FPkh<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Q, Ctx>, FuncError> <span class="where fmt-newline">where<br> FPk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Pk) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Q, FuncError>,<br> FPkh: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&<Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Q as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>, FuncError>,<br> Q: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><div class='docblock'><p>This will panic if translatefpk returns an uncompressed key when
-converting to a Segwit descriptor. To prevent this panic, ensure
-translatefpk returns an error in this case instead.</p>
-</div></div><h3 id='impl-5' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="../../magical/descriptor/trait.ToPublicKey.html" title="trait magical::descriptor::ToPublicKey">ToPublicKey</a>, </span></code><a href='#impl-5' class='anchor'></a></h3><div class='impl-items'><h4 id='method.satisfy' class="method"><code>pub fn <a href='#method.satisfy' class='fnname'>satisfy</a><S>(&self, satisfier: S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>>> <span class="where fmt-newline">where<br> S: Satisfier<Pk>, </span></code></h4><div class='docblock'><p>Attempt to produce a satisfying witness for the
-witness script represented by the parse tree</p>
-</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-Clone' class='anchor'></a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx></code></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Debug' class='anchor'></a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></code></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Display' class='anchor'></a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></code></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Eq' class='anchor'></a></h3><div class='docblock'><p><code>Eq</code> of <code>Miniscript</code> must depend only on node and not the type information.
-The type information and extra_properties can be deterministically determined
-by the ast.</p>
-</div><div class='impl-items'></div><h3 id='impl-ExtractPolicy' class='impl'><code class='in-band'>impl<Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>> <a class="trait" href="../../magical/descriptor/trait.ExtractPolicy.html" title="trait magical::descriptor::ExtractPolicy">ExtractPolicy</a> for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><DescriptorPublicKey, Ctx></code><a href='#impl-ExtractPolicy' class='anchor'></a><a class='srclink' href='../../src/magical/descriptor/policy.rs.html#688-779' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.extract_policy' class="method hidden"><code>fn <a href='../../magical/descriptor/trait.ExtractPolicy.html#tymethod.extract_policy' class='fnname'>extract_policy</a>(<br> &self, <br> signers: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a>>, <a class="enum" href="../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a>></code><a class='srclink' href='../../src/magical/descriptor/policy.rs.html#689-778' title='goto source code'>[src]</a></h4></div><h3 id='impl-FromStr' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a> for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>,<br> <Pk as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>,<br> <<Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>, </span></code><a href='#impl-FromStr' class='anchor'></a></h3><div class='impl-items'><h4 id='associatedtype.Err' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err' class="type">Err</a> = Error</code></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
-</div><h4 id='method.from_str' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str' class='fnname'>from_str</a>(s: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>, Error></code></h4><div class='docblock hidden'><p>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str">Read more</a></p>
-</div></div><h3 id='impl-FromTree' class='impl'><code class='in-band'>impl<Pk, Ctx> FromTree for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>,<br> <Pk as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>,<br> <<Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a>, </span></code><a href='#impl-FromTree' class='anchor'></a></h3><div class='impl-items'><h4 id='method.from_tree' class="method"><code>fn <a href='#method.from_tree' class='fnname'>from_tree</a>(top: &Tree) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>, Error></code></h4><div class='docblock'><p>Parse an expression tree into a Miniscript. As a general rule, this
-should not be called directly; rather go through the descriptor API.</p>
-</div></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>, </span></code><a href='#impl-Hash' class='anchor'></a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H) <span class="where fmt-newline">where<br> __H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
-</div><h4 id='method.hash_slice' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#192-199' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
-</div></div><h3 id='impl-Liftable%3CPk%3E' class='impl'><code class='in-band'>impl<Pk, Ctx> Liftable<Pk> for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Liftable%3CPk%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.lift' class="method hidden"><code>fn <a href='#method.lift' class='fnname'>lift</a>(&self) -> Policy<Pk></code></h4><div class='docblock hidden'><p>Convert the object into an abstract policy</p>
-</div></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-Ord' class='anchor'></a></h3><div class='docblock'><p><code>Ord</code> of <code>Miniscript</code> must depend only on node and not the type information.
-The type information and extra_properties can be deterministically determined
-by the ast.</p>
-</div><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
-</div><h4 id='method.max' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#599-604' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
-</div><h4 id='method.min' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#619-624' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
-</div><h4 id='method.clamp' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#646-658' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
-</div></div><h3 id='impl-PartialEq%3CMiniscript%3CPk%2C%20Ctx%3E%3E' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>> for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-PartialEq%3CMiniscript%3CPk%2C%20Ctx%3E%3E' class='anchor'></a></h3><div class='docblock'><p><code>PartialEq</code> of <code>Miniscript</code> must depend only on node and not the type information.
-The type information and extra_properties can be deterministically determined
-by the ast.</p>
-</div><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-PartialOrd%3CMiniscript%3CPk%2C%20Ctx%3E%3E' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>> for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code><a href='#impl-PartialOrd%3CMiniscript%3CPk%2C%20Ctx%3E%3E' class='anchor'></a></h3><div class='docblock'><p><code>PartialOrd</code> of <code>Miniscript</code> must depend only on node and not the type information.
-The type information and extra_properties can be deterministically determined
-by the ast.</p>
-</div><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
-</div><h4 id='method.lt' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#841-843' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
-</div><h4 id='method.le' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#860-862' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
-</div><h4 id='method.gt' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#878-880' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
-</div><h4 id='method.ge' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#897-899' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>, </span></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl<Pk, Ctx> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>,<br> Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>,<br> <Pk as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>, </span></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2237-2247' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2239-2246' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ExtractPolicy` trait in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, ExtractPolicy"><title>magical::descriptor::ExtractPolicy - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait ExtractPolicy</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.extract_policy">extract_policy</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'ExtractPolicy', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/descriptor/mod.rs.html#65-70' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="trait" href=''>ExtractPolicy</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait ExtractPolicy {
- fn <a href='#tymethod.extract_policy' class='fnname'>extract_policy</a>(<br> &self, <br> signers: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey>><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a>>, <a class="enum" href="../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a>>;
-}</pre></div><div class='docblock'><p>Trait implemented on <a href="../../magical/descriptor/enum.Descriptor.html" title="`Descriptor`"><code>Descriptor</code></a>s to add a method to extract the spending <a href="../../magical/descriptor/policy/index.html" title="`policy`"><code>policy</code></a></p>
-</div>
- <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.extract_policy' class='method'><code>fn <a href='#tymethod.extract_policy' class='fnname'>extract_policy</a>(<br> &self, <br> signers: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a>>, <a class="enum" href="../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a>></code></h3></div><span class='loading-content'>Loading content...</span>
- <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-ExtractPolicy' class='impl'><code class='in-band'>impl ExtractPolicy for <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><DescriptorPublicKey></code><a href='#impl-ExtractPolicy' class='anchor'></a><a class='srclink' href='../../src/magical/descriptor/policy.rs.html#781-795' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.extract_policy' class="method hidden"><code>fn <a href='#method.extract_policy' class='fnname'>extract_policy</a>(<br> &self, <br> signers: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a>>, <a class="enum" href="../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a>></code><a class='srclink' href='../../src/magical/descriptor/policy.rs.html#782-794' title='goto source code'>[src]</a></h4></div><h3 id='impl-ExtractPolicy-1' class='impl'><code class='in-band'>impl<Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>> ExtractPolicy for <a class="struct" href="../../magical/descriptor/struct.Miniscript.html" title="struct magical::descriptor::Miniscript">Miniscript</a><DescriptorPublicKey, Ctx></code><a href='#impl-ExtractPolicy-1' class='anchor'></a><a class='srclink' href='../../src/magical/descriptor/policy.rs.html#688-779' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.extract_policy-1' class="method hidden"><code>fn <a href='#method.extract_policy-1' class='fnname'>extract_policy</a>(<br> &self, <br> signers: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a>>, <a class="enum" href="../../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a>></code><a class='srclink' href='../../src/magical/descriptor/policy.rs.html#689-778' title='goto source code'>[src]</a></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/magical/descriptor/trait.ExtractPolicy.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `MiniscriptKey` trait in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, MiniscriptKey"><title>magical::descriptor::MiniscriptKey - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait MiniscriptKey</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-types">Associated Types</a><div class="sidebar-links"><a href="#associatedtype.Hash">Hash</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.to_pubkeyhash">to_pubkeyhash</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.is_uncompressed">is_uncompressed</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-MiniscriptKey-for-DescriptorPublicKey">DescriptorPublicKey</a><a href="#impl-MiniscriptKey-for-DummyKey">DummyKey</a><a href="#impl-MiniscriptKey-for-PublicKey">PublicKey</a><a href="#impl-MiniscriptKey-for-String">String</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'MiniscriptKey', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span></span><span class='in-band'>Trait <a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="trait" href=''>MiniscriptKey</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait MiniscriptKey: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <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/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a> {
- type <a href='#associatedtype.Hash' class="type">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <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/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>;
- fn <a href='#tymethod.to_pubkeyhash' class='fnname'>to_pubkeyhash</a>(&self) -> Self::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>;
-
- fn <a href='#method.is_uncompressed' class='fnname'>is_uncompressed</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> { ... }
-}</pre></div><div class='docblock'><p>Public key trait which can be converted to Hash type</p>
-</div>
- <h2 id='associated-types' class='small-section-header'>Associated Types<a href='#associated-types' class='anchor'></a></h2><div class='methods'><h3 id='associatedtype.Hash' class='method'><code>type <a href='#associatedtype.Hash' class="type">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <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/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a></code></h3><div class='docblock'><p>The associated Hash type with the publicKey</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.to_pubkeyhash' class='method'><code>fn <a href='#tymethod.to_pubkeyhash' class='fnname'>to_pubkeyhash</a>(&self) -> Self::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a></code></h3><div class='docblock'><p>Converts an object to PublicHash</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='provided-methods' class='small-section-header'>Provided methods<a href='#provided-methods' class='anchor'></a></h2><div class='methods'><h3 id='method.is_uncompressed' class='method'><code>fn <a href='#method.is_uncompressed' class='fnname'>is_uncompressed</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h3><div class='docblock'><p>Check if the publicKey is uncompressed. The default
-implementation returns false</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-MiniscriptKey-for-PublicKey' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> for PublicKey</code><a href='#impl-MiniscriptKey-for-PublicKey' class='anchor'></a></h3><div class='impl-items'><h4 id='method.is_uncompressed-1' class="method"><code>fn <a href='#method.is_uncompressed' class='fnname'>is_uncompressed</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock'><p><code>is_uncompressed</code> returns true only for
-bitcoin::Publickey type if the underlying key is uncompressed.</p>
-</div><h4 id='associatedtype.Hash-1' class="type"><code>type <a href='#associatedtype.Hash' class="type">Hash</a> = Hash</code></h4><h4 id='method.to_pubkeyhash' class="method hidden"><code>fn <a href='#method.to_pubkeyhash' class='fnname'>to_pubkeyhash</a>(&self) -> <PublicKey as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a></code></h4></div><h3 id='impl-MiniscriptKey-for-DummyKey' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> for DummyKey</code><a href='#impl-MiniscriptKey-for-DummyKey' class='anchor'></a></h3><div class='impl-items'><h4 id='associatedtype.Hash-2' class="type"><code>type <a href='#associatedtype.Hash' class="type">Hash</a> = DummyKeyHash</code></h4><h4 id='method.to_pubkeyhash-1' class="method hidden"><code>fn <a href='#method.to_pubkeyhash' class='fnname'>to_pubkeyhash</a>(&self) -> <DummyKey as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a></code></h4></div><h3 id='impl-MiniscriptKey-for-DescriptorPublicKey' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> for DescriptorPublicKey</code><a href='#impl-MiniscriptKey-for-DescriptorPublicKey' class='anchor'></a></h3><div class='impl-items'><h4 id='associatedtype.Hash-3' class="type"><code>type <a href='#associatedtype.Hash' class="type">Hash</a> = Hash</code></h4><h4 id='method.to_pubkeyhash-2' class="method hidden"><code>fn <a href='#method.to_pubkeyhash' class='fnname'>to_pubkeyhash</a>(&self) -> <DescriptorPublicKey as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a></code></h4></div><h3 id='impl-MiniscriptKey-for-String' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a href='#impl-MiniscriptKey-for-String' class='anchor'></a></h3><div class='impl-items'><h4 id='associatedtype.Hash-4' class="type"><code>type <a href='#associatedtype.Hash' class="type">Hash</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></h4><h4 id='method.to_pubkeyhash-3' class="method hidden"><code>fn <a href='#method.to_pubkeyhash' class='fnname'>to_pubkeyhash</a>(&self) -> <<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a> as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a></code></h4></div><span class='loading-content'>Loading content...</span>
- <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/miniscript/trait.MiniscriptKey.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ScriptContext` trait in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, ScriptContext"><title>magical::descriptor::ScriptContext - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait ScriptContext</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.check_frag_non_malleable">check_frag_non_malleable</a><a href="#tymethod.check_frag_validity">check_frag_validity</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'ScriptContext', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span></span><span class='in-band'>Trait <a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="trait" href=''>ScriptContext</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait ScriptContext: Sealed + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><Self> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><Self> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> {
- fn <a href='#tymethod.check_frag_non_malleable' class='fnname'>check_frag_non_malleable</a><Pk, Ctx>(<br> _frag: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError><br> <span class="where">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a></span>;
-<div class='item-spacer'></div> fn <a href='#tymethod.check_frag_validity' class='fnname'>check_frag_validity</a><Pk, Ctx>(<br> _frag: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError><br> <span class="where">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a></span>;
-}</pre></div>
- <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.check_frag_non_malleable' class='method'><code>fn <a href='#tymethod.check_frag_non_malleable' class='fnname'>check_frag_non_malleable</a><Pk, Ctx>(<br> _frag: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h3><div class='docblock'><p>Depending on ScriptContext, fragments can be malleable. For Example,
-under Legacy context, PkH is malleable because it is possible to
-estimate the cost of satisfaction because of compressed keys
-This is currently only used in compiler code for removing malleable
-compilations.
-This does NOT recursively check if the children of the fragment are
-valid or not. Since the compilation proceeds in a leaf to root fashion,
-a recursive check is unnecessary.</p>
-</div><h3 id='tymethod.check_frag_validity' class='method'><code>fn <a href='#tymethod.check_frag_validity' class='fnname'>check_frag_validity</a><Pk, Ctx>(<br> _frag: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h3><div class='docblock'><p>Depending on script Context, some of the Terminals might not be valid.
-For example, in Segwit Context with MiniscriptKey as bitcoin::PublicKey
-uncompressed public keys are non-standard and thus invalid.
-Post Tapscript upgrade, this would have to consider other nodes.
-This does not recursively check</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-ScriptContext' class='impl'><code class='in-band'>impl ScriptContext for <a class="enum" href="../../magical/descriptor/enum.Legacy.html" title="enum magical::descriptor::Legacy">Legacy</a></code><a href='#impl-ScriptContext' class='anchor'></a></h3><div class='impl-items'><h4 id='method.check_frag_non_malleable' class="method hidden"><code>fn <a href='#method.check_frag_non_malleable' class='fnname'>check_frag_non_malleable</a><Pk, Ctx>(<br> frag: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><h4 id='method.check_frag_validity' class="method hidden"><code>fn <a href='#method.check_frag_validity' class='fnname'>check_frag_validity</a><Pk, Ctx>(<br> _frag: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4></div><h3 id='impl-ScriptContext-1' class='impl'><code class='in-band'>impl ScriptContext for <a class="enum" href="../../magical/descriptor/enum.Segwitv0.html" title="enum magical::descriptor::Segwitv0">Segwitv0</a></code><a href='#impl-ScriptContext-1' class='anchor'></a></h3><div class='impl-items'><h4 id='method.check_frag_non_malleable-1' class="method hidden"><code>fn <a href='#method.check_frag_non_malleable-1' class='fnname'>check_frag_non_malleable</a><Pk, Ctx>(<br> _frag: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4><h4 id='method.check_frag_validity-1' class="method hidden"><code>fn <a href='#method.check_frag_validity-1' class='fnname'>check_frag_validity</a><Pk, Ctx>(<br> frag: &<a class="enum" href="../../magical/descriptor/enum.Terminal.html" title="enum magical::descriptor::Terminal">Terminal</a><Pk, Ctx><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../magical/descriptor/trait.ScriptContext.html" title="trait magical::descriptor::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>, </span></code></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/miniscript/miniscript/context/trait.ScriptContext.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ToPublicKey` trait in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, ToPublicKey"><title>magical::descriptor::ToPublicKey - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait ToPublicKey</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.hash_to_hash160">hash_to_hash160</a><a href="#tymethod.to_public_key">to_public_key</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.serialized_len">serialized_len</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-ToPublicKey-for-DescriptorPublicKey">DescriptorPublicKey</a><a href="#impl-ToPublicKey-for-DummyKey">DummyKey</a><a href="#impl-ToPublicKey-for-PublicKey">PublicKey</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'ToPublicKey', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span></span><span class='in-band'>Trait <a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="trait" href=''>ToPublicKey</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait ToPublicKey: <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a> {
- fn <a href='#tymethod.to_public_key' class='fnname'>to_public_key</a>(&self) -> PublicKey;
-<div class='item-spacer'></div> fn <a href='#tymethod.hash_to_hash160' class='fnname'>hash_to_hash160</a>(hash: &Self::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>) -> Hash;
-
- fn <a href='#method.serialized_len' class='fnname'>serialized_len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> { ... }
-}</pre></div><div class='docblock'><p>Trait describing public key types which can be converted to bitcoin pubkeys</p>
-</div>
- <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.to_public_key' class='method'><code>fn <a href='#tymethod.to_public_key' class='fnname'>to_public_key</a>(&self) -> PublicKey</code></h3><div class='docblock'><p>Converts an object to a public key</p>
-</div><h3 id='tymethod.hash_to_hash160' class='method'><code>fn <a href='#tymethod.hash_to_hash160' class='fnname'>hash_to_hash160</a>(hash: &Self::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>) -> Hash</code></h3><div class='docblock'><p>Converts a hashed version of the public key to a <code>hash160</code> hash.</p>
-<p>This method must be consistent with <code>to_public_key</code>, in the sense
-that calling <code>MiniscriptKey::to_pubkeyhash</code> followed by this function
-should give the same result as calling <code>to_public_key</code> and hashing
-the result directly.</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='provided-methods' class='small-section-header'>Provided methods<a href='#provided-methods' class='anchor'></a></h2><div class='methods'><h3 id='method.serialized_len' class='method'><code>fn <a href='#method.serialized_len' class='fnname'>serialized_len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h3><div class='docblock'><p>Computes the size of a public key when serialized in a script,
-including the length bytes</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-ToPublicKey-for-DummyKey' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/descriptor/trait.ToPublicKey.html" title="trait magical::descriptor::ToPublicKey">ToPublicKey</a> for DummyKey</code><a href='#impl-ToPublicKey-for-DummyKey' class='anchor'></a></h3><div class='impl-items'><h4 id='method.to_public_key' class="method hidden"><code>fn <a href='#method.to_public_key' class='fnname'>to_public_key</a>(&self) -> PublicKey</code></h4><h4 id='method.hash_to_hash160' class="method hidden"><code>fn <a href='#method.hash_to_hash160' class='fnname'>hash_to_hash160</a>(&DummyKeyHash) -> Hash</code></h4></div><h3 id='impl-ToPublicKey-for-DescriptorPublicKey' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/descriptor/trait.ToPublicKey.html" title="trait magical::descriptor::ToPublicKey">ToPublicKey</a> for DescriptorPublicKey</code><a href='#impl-ToPublicKey-for-DescriptorPublicKey' class='anchor'></a></h3><div class='impl-items'><h4 id='method.to_public_key-1' class="method hidden"><code>fn <a href='#method.to_public_key' class='fnname'>to_public_key</a>(&self) -> PublicKey</code></h4><h4 id='method.hash_to_hash160-1' class="method hidden"><code>fn <a href='#method.hash_to_hash160' class='fnname'>hash_to_hash160</a>(hash: &<DescriptorPublicKey as <a class="trait" href="../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>) -> Hash</code></h4></div><h3 id='impl-ToPublicKey-for-PublicKey' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/descriptor/trait.ToPublicKey.html" title="trait magical::descriptor::ToPublicKey">ToPublicKey</a> for PublicKey</code><a href='#impl-ToPublicKey-for-PublicKey' class='anchor'></a></h3><div class='impl-items'><h4 id='method.to_public_key-2' class="method hidden"><code>fn <a href='#method.to_public_key' class='fnname'>to_public_key</a>(&self) -> PublicKey</code></h4><h4 id='method.hash_to_hash160-2' class="method hidden"><code>fn <a href='#method.hash_to_hash160' class='fnname'>hash_to_hash160</a>(hash: &Hash) -> Hash</code></h4></div><span class='loading-content'>Loading content...</span>
- <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/miniscript/trait.ToPublicKey.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ExtendedDescriptor` type in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, ExtendedDescriptor"><title>magical::descriptor::ExtendedDescriptor - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition ExtendedDescriptor</p><div class="sidebar-elems"><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'ExtendedDescriptor', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/descriptor/mod.rs.html#55' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="type" href=''>ExtendedDescriptor</a></span></h1><pre class='rust typedef'>type ExtendedDescriptor = <a class="enum" href="../../magical/descriptor/enum.Descriptor.html" title="enum magical::descriptor::Descriptor">Descriptor</a><DescriptorPublicKey>;</pre><div class='docblock'><p>Alias for a <a href="../../magical/descriptor/enum.Descriptor.html" title="`Descriptor`"><code>Descriptor</code></a> that can contain extended keys using [<code>DescriptorPublicKey</code>]</p>
-</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `HDKeyPaths` type in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, HDKeyPaths"><title>magical::descriptor::HDKeyPaths - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition HDKeyPaths</p><div class="sidebar-elems"><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a></p><script>window.sidebarCurrent = {name: 'HDKeyPaths', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/descriptor/mod.rs.html#62' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='../index.html'>magical</a>::<wbr><a href='index.html'>descriptor</a>::<wbr><a class="type" href=''>HDKeyPaths</a></span></h1><pre class='rust typedef'>type HDKeyPaths = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/collections/btree/map/struct.BTreeMap.html" title="struct alloc::collections::btree::map::BTreeMap">BTreeMap</a><PublicKey, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Fingerprint, DerivationPath<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>;</pre><div class='docblock'><p>Alias for the type of maps that represent derivation paths in a <a href="bitcoin::util::psbt::Input"><code>psbt::Input</code></a> or
-<a href="bitcoin::util::psbt::Output"><code>psbt::Output</code></a></p>
-</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Error` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Error"><title>magical::Error - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../magical/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Error</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.AddressValidator">AddressValidator</a><a href="#variant.BIP32">BIP32</a><a href="#variant.ChecksumMismatch">ChecksumMismatch</a><a href="#variant.CompactFilters">CompactFilters</a><a href="#variant.Descriptor">Descriptor</a><a href="#variant.DifferentDescriptorStructure">DifferentDescriptorStructure</a><a href="#variant.DifferentTransactions">DifferentTransactions</a><a href="#variant.Electrum">Electrum</a><a href="#variant.Encode">Encode</a><a href="#variant.Esplora">Esplora</a><a href="#variant.FeeRateTooLow">FeeRateTooLow</a><a href="#variant.Generic">Generic</a><a href="#variant.Hex">Hex</a><a href="#variant.InsufficientFunds">InsufficientFunds</a><a href="#variant.InvalidAddressNetwork">InvalidAddressNetwork</a><a href="#variant.InvalidOutpoint">InvalidOutpoint</a><a href="#variant.InvalidPolicyPathError">InvalidPolicyPathError</a><a href="#variant.InvalidProgressValue">InvalidProgressValue</a><a href="#variant.InvalidU32Bytes">InvalidU32Bytes</a><a href="#variant.IrreplaceableTransaction">IrreplaceableTransaction</a><a href="#variant.JSON">JSON</a><a href="#variant.KeyMismatch">KeyMismatch</a><a href="#variant.Miniscript">Miniscript</a><a href="#variant.MissingCachedAddresses">MissingCachedAddresses</a><a href="#variant.MissingInputUTXO">MissingInputUTXO</a><a href="#variant.NoAddressees">NoAddressees</a><a href="#variant.OfflineClient">OfflineClient</a><a href="#variant.OutputBelowDustLimit">OutputBelowDustLimit</a><a href="#variant.PSBT">PSBT</a><a href="#variant.ProgressUpdateError">ProgressUpdateError</a><a href="#variant.ScriptDoesntHaveAddressForm">ScriptDoesntHaveAddressForm</a><a href="#variant.Secp256k1">Secp256k1</a><a href="#variant.SendAllMultipleOutputs">SendAllMultipleOutputs</a><a href="#variant.Signer">Signer</a><a href="#variant.Sled">Sled</a><a href="#variant.SpendingPolicyRequired">SpendingPolicyRequired</a><a href="#variant.TransactionConfirmed">TransactionConfirmed</a><a href="#variant.TransactionNotFound">TransactionNotFound</a><a href="#variant.Uncapable">Uncapable</a><a href="#variant.UnknownUTXO">UnknownUTXO</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Error">Error</a><a href="#impl-From%3CAddressValidatorError%3E">From<AddressValidatorError></a><a href="#impl-From%3CCompactFiltersError%3E">From<CompactFiltersError></a><a href="#impl-From%3CError%3E">From<Error></a><a href="#impl-From%3CEsploraError%3E">From<EsploraError></a><a href="#impl-From%3CPolicyError%3E">From<PolicyError></a><a href="#impl-From%3CSignerError%3E">From<SignerError></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='index.html'>magical</a></p><script>window.sidebarCurrent = {name: 'Error', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/magical/error.rs.html#31-86' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='index.html'>magical</a>::<wbr><a class="enum" href=''>Error</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Error {
- KeyMismatch(PublicKey, PublicKey),
- MissingInputUTXO(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>),
- InvalidU32Bytes(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>),
- Generic(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
- ScriptDoesntHaveAddressForm,
- SendAllMultipleOutputs,
- NoAddressees,
- OutputBelowDustLimit(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>),
- InsufficientFunds,
- InvalidAddressNetwork(Address),
- UnknownUTXO,
- DifferentTransactions,
- TransactionNotFound,
- TransactionConfirmed,
- IrreplaceableTransaction,
- FeeRateTooLow {
- required: <a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>,
- },
- ChecksumMismatch,
- DifferentDescriptorStructure,
- SpendingPolicyRequired,
- InvalidPolicyPathError(<a class="enum" href="../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a>),
- Signer(<a class="enum" href="../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a>),
- Uncapable(<a class="enum" href="../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a>),
- OfflineClient,
- InvalidProgressValue(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>),
- ProgressUpdateError,
- MissingCachedAddresses,
- InvalidOutpoint(OutPoint),
- Descriptor(<a class="enum" href="../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a>),
- AddressValidator(<a class="enum" href="../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>),
- Encode(Error),
- Miniscript(Error),
- BIP32(Error),
- Secp256k1(Error),
- JSON(<a class="struct" href="https://docs.rs/serde_json/1.0.57/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>),
- Hex(Error),
- PSBT(Error),
- Electrum(Error),
- Esplora(<a class="enum" href="../magical/blockchain/esplora/enum.EsploraError.html" title="enum magical::blockchain::esplora::EsploraError">EsploraError</a>),
- CompactFilters(<a class="enum" href="../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>),
- Sled(Error),
-}</pre></div><div class='docblock'><p>Errors that can be thrown by the <a href="../magical/wallet/struct.Wallet.html"><code>Wallet</code></a></p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<div id="variant.KeyMismatch" class="variant small-section-header"><a href="#variant.KeyMismatch" class="anchor field"></a><code>KeyMismatch(PublicKey, PublicKey)</code></div><div id="variant.MissingInputUTXO" class="variant small-section-header"><a href="#variant.MissingInputUTXO" class="anchor field"></a><code>MissingInputUTXO(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></div><div id="variant.InvalidU32Bytes" class="variant small-section-header"><a href="#variant.InvalidU32Bytes" class="anchor field"></a><code>InvalidU32Bytes(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>)</code></div><div id="variant.Generic" class="variant small-section-header"><a href="#variant.Generic" class="anchor field"></a><code>Generic(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></div><div id="variant.ScriptDoesntHaveAddressForm" class="variant small-section-header"><a href="#variant.ScriptDoesntHaveAddressForm" class="anchor field"></a><code>ScriptDoesntHaveAddressForm</code></div><div id="variant.SendAllMultipleOutputs" class="variant small-section-header"><a href="#variant.SendAllMultipleOutputs" class="anchor field"></a><code>SendAllMultipleOutputs</code></div><div id="variant.NoAddressees" class="variant small-section-header"><a href="#variant.NoAddressees" class="anchor field"></a><code>NoAddressees</code></div><div id="variant.OutputBelowDustLimit" class="variant small-section-header"><a href="#variant.OutputBelowDustLimit" class="anchor field"></a><code>OutputBelowDustLimit(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></div><div id="variant.InsufficientFunds" class="variant small-section-header"><a href="#variant.InsufficientFunds" class="anchor field"></a><code>InsufficientFunds</code></div><div id="variant.InvalidAddressNetwork" class="variant small-section-header"><a href="#variant.InvalidAddressNetwork" class="anchor field"></a><code>InvalidAddressNetwork(Address)</code></div><div id="variant.UnknownUTXO" class="variant small-section-header"><a href="#variant.UnknownUTXO" class="anchor field"></a><code>UnknownUTXO</code></div><div id="variant.DifferentTransactions" class="variant small-section-header"><a href="#variant.DifferentTransactions" class="anchor field"></a><code>DifferentTransactions</code></div><div id="variant.TransactionNotFound" class="variant small-section-header"><a href="#variant.TransactionNotFound" class="anchor field"></a><code>TransactionNotFound</code></div><div id="variant.TransactionConfirmed" class="variant small-section-header"><a href="#variant.TransactionConfirmed" class="anchor field"></a><code>TransactionConfirmed</code></div><div id="variant.IrreplaceableTransaction" class="variant small-section-header"><a href="#variant.IrreplaceableTransaction" class="anchor field"></a><code>IrreplaceableTransaction</code></div><div id="variant.FeeRateTooLow" class="variant small-section-header"><a href="#variant.FeeRateTooLow" class="anchor field"></a><code>FeeRateTooLow</code></div><div class='autohide sub-variant' id='variant.FeeRateTooLow.fields'><h3>Fields of <b>FeeRateTooLow</b></h3><div><span id="variant.FeeRateTooLow.field.required" class="variant small-section-header"><a href="#variant.FeeRateTooLow.field.required" class="anchor field"></a><code>required: <a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a></code></span></div></div><div id="variant.ChecksumMismatch" class="variant small-section-header"><a href="#variant.ChecksumMismatch" class="anchor field"></a><code>ChecksumMismatch</code></div><div id="variant.DifferentDescriptorStructure" class="variant small-section-header"><a href="#variant.DifferentDescriptorStructure" class="anchor field"></a><code>DifferentDescriptorStructure</code></div><div id="variant.SpendingPolicyRequired" class="variant small-section-header"><a href="#variant.SpendingPolicyRequired" class="anchor field"></a><code>SpendingPolicyRequired</code></div><div id="variant.InvalidPolicyPathError" class="variant small-section-header"><a href="#variant.InvalidPolicyPathError" class="anchor field"></a><code>InvalidPolicyPathError(<a class="enum" href="../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a>)</code></div><div id="variant.Signer" class="variant small-section-header"><a href="#variant.Signer" class="anchor field"></a><code>Signer(<a class="enum" href="../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a>)</code></div><div id="variant.Uncapable" class="variant small-section-header"><a href="#variant.Uncapable" class="anchor field"></a><code>Uncapable(<a class="enum" href="../magical/blockchain/enum.Capability.html" title="enum magical::blockchain::Capability">Capability</a>)</code></div><div id="variant.OfflineClient" class="variant small-section-header"><a href="#variant.OfflineClient" class="anchor field"></a><code>OfflineClient</code></div><div id="variant.InvalidProgressValue" class="variant small-section-header"><a href="#variant.InvalidProgressValue" class="anchor field"></a><code>InvalidProgressValue(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>)</code></div><div id="variant.ProgressUpdateError" class="variant small-section-header"><a href="#variant.ProgressUpdateError" class="anchor field"></a><code>ProgressUpdateError</code></div><div id="variant.MissingCachedAddresses" class="variant small-section-header"><a href="#variant.MissingCachedAddresses" class="anchor field"></a><code>MissingCachedAddresses</code></div><div id="variant.InvalidOutpoint" class="variant small-section-header"><a href="#variant.InvalidOutpoint" class="anchor field"></a><code>InvalidOutpoint(OutPoint)</code></div><div id="variant.Descriptor" class="variant small-section-header"><a href="#variant.Descriptor" class="anchor field"></a><code>Descriptor(<a class="enum" href="../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a>)</code></div><div id="variant.AddressValidator" class="variant small-section-header"><a href="#variant.AddressValidator" class="anchor field"></a><code>AddressValidator(<a class="enum" href="../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>)</code></div><div id="variant.Encode" class="variant small-section-header"><a href="#variant.Encode" class="anchor field"></a><code>Encode(Error)</code></div><div id="variant.Miniscript" class="variant small-section-header"><a href="#variant.Miniscript" class="anchor field"></a><code>Miniscript(Error)</code></div><div id="variant.BIP32" class="variant small-section-header"><a href="#variant.BIP32" class="anchor field"></a><code>BIP32(Error)</code></div><div id="variant.Secp256k1" class="variant small-section-header"><a href="#variant.Secp256k1" class="anchor field"></a><code>Secp256k1(Error)</code></div><div id="variant.JSON" class="variant small-section-header"><a href="#variant.JSON" class="anchor field"></a><code>JSON(<a class="struct" href="https://docs.rs/serde_json/1.0.57/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>)</code></div><div id="variant.Hex" class="variant small-section-header"><a href="#variant.Hex" class="anchor field"></a><code>Hex(Error)</code></div><div id="variant.PSBT" class="variant small-section-header"><a href="#variant.PSBT" class="anchor field"></a><code>PSBT(Error)</code></div><div id="variant.Electrum" class="variant small-section-header"><a href="#variant.Electrum" class="anchor field"></a><code>Electrum(Error)</code></div><div id="variant.Esplora" class="variant small-section-header"><a href="#variant.Esplora" class="anchor field"></a><code>Esplora(<a class="enum" href="../magical/blockchain/esplora/enum.EsploraError.html" title="enum magical::blockchain::esplora::EsploraError">EsploraError</a>)</code></div><div id="variant.CompactFilters" class="variant small-section-header"><a href="#variant.CompactFilters" class="anchor field"></a><code>CompactFilters(<a class="enum" href="../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>)</code></div><div id="variant.Sled" class="variant small-section-header"><a href="#variant.Sled" class="anchor field"></a><code>Sled(Error)</code></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#30' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../src/magical/error.rs.html#30' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#88-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../src/magical/error.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Error' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-Error' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#94' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.source' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source' class='fnname'>source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><span class='since' title='Stable since Rust version 1.30.0'>1.30.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#100-102' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
-</div><h4 id='method.backtrace' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace' class='fnname'>backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#128-130' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>backtrace</code>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
-</div><h4 id='method.description' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description' class='fnname'>description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#140-142' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
-</div></div><div class='docblock hidden'><p><code>if let Err(e) = "xc".parse::<u32>() { // Print </code>e<code> itself, no need for description(). eprintln!("Error: {}", e); }</code> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></p>
-</div><h4 id='method.cause' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#150-152' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
-</div></div></div><h3 id='impl-From%3CAddressValidatorError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CAddressValidatorError%3E' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>) -> Self</code><a class='srclink' href='../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CCompactFiltersError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CCompactFiltersError%3E' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#133-140' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-14' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(other: <a class="enum" href="../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>) -> Self</code><a class='srclink' href='../src/magical/error.rs.html#134-139' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a>> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CError%3E' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../magical/descriptor/error/enum.Error.html" title="enum magical::descriptor::error::Error">Error</a>) -> Self</code><a class='srclink' href='../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-1' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CError%3E-1' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-4' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-10' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a>> for <a class="enum" href="../magical/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum magical::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a></code><a href='#impl-From%3CError%3E-10' class='anchor'></a><a class='srclink' href='../src/magical/blockchain/compact_filters/mod.rs.html#558-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-15' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a>) -> Self</code><a class='srclink' href='../src/magical/blockchain/compact_filters/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-2' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CError%3E-2' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-5' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-3' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CError%3E-3' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-6' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-4' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CError%3E-4' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-7' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-5' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://docs.rs/serde_json/1.0.57/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CError%3E-5' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-8' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="struct" href="https://docs.rs/serde_json/1.0.57/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>) -> Self</code><a class='srclink' href='../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-6' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CError%3E-6' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-9' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-7' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CError%3E-7' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-10' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-8' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CError%3E-8' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-11' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CError%3E-9' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CError%3E-9' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-13' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: Error) -> Self</code><a class='srclink' href='../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CEsploraError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../magical/blockchain/esplora/enum.EsploraError.html" title="enum magical::blockchain::esplora::EsploraError">EsploraError</a>> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CEsploraError%3E' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-12' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../magical/blockchain/esplora/enum.EsploraError.html" title="enum magical::blockchain::esplora::EsploraError">EsploraError</a>) -> Self</code><a class='srclink' href='../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CPolicyError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a>> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CPolicyError%3E' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../magical/descriptor/policy/enum.PolicyError.html" title="enum magical::descriptor::policy::PolicyError">PolicyError</a>) -> Self</code><a class='srclink' href='../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CSignerError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a>> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CSignerError%3E' class='anchor'></a><a class='srclink' href='../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-3' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a>) -> Self</code><a class='srclink' href='../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-16' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2237-2247' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2239-2246' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "magical";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ScriptType` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, ScriptType"><title>magical::ScriptType - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../magical/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Enum ScriptType</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.External">External</a><a href="#variant.Internal">Internal</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.as_byte">as_byte</a><a href="#method.is_internal">is_internal</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-AsRef%3C%5Bu8%5D%3E">AsRef<[u8]></a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Eq">Eq</a><a href="#impl-Hash">Hash</a><a href="#impl-PartialEq%3CScriptType%3E">PartialEq<ScriptType></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Base32Len">Base32Len</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-CheckBase32%3CVec%3Cu5%3E%3E">CheckBase32<Vec<u5>></a><a href="#impl-DeserializeOwned">DeserializeOwned</a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToBase32">ToBase32</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='index.html'>magical</a></p><script>window.sidebarCurrent = {name: 'ScriptType', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/magical/types.rs.html#34-37' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='index.html'>magical</a>::<wbr><a class="enum" href=''>ScriptType</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum ScriptType {
- External,
- Internal,
-}</pre></div><div class='docblock'><p>Types of script</p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<div id="variant.External" class="variant small-section-header"><a href="#variant.External" class="anchor field"></a><code>External</code></div><div id="variant.Internal" class="variant small-section-header"><a href="#variant.Internal" class="anchor field"></a><code>Internal</code></div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#39-50' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.as_byte' class="method"><code>pub fn <a href='#method.as_byte' class='fnname'>as_byte</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code><a class='srclink' href='../src/magical/types.rs.html#40-45' title='goto source code'>[src]</a></h4><h4 id='method.is_internal' class="method"><code>pub fn <a href='#method.is_internal' class='fnname'>is_internal</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/magical/types.rs.html#47-49' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-AsRef%3C%5Bu8%5D%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>> for <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a href='#impl-AsRef%3C%5Bu8%5D%3E' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#52-59' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.as_ref' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html#tymethod.as_ref' class='fnname'>as_ref</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a></code><a class='srclink' href='../src/magical/types.rs.html#53-58' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a class='srclink' href='../src/magical/types.rs.html#33' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../src/magical/types.rs.html#33' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Deserialize%3C%27de%3E' class='impl'><code class='in-band'>impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a href='#impl-Deserialize%3C%27de%3E' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deserialize' class="method hidden"><code>fn <a href='https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html#tymethod.deserialize' class='fnname'>deserialize</a><__D>(__deserializer: __D) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, __D::<a class="type" href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> __D: <a class="trait" href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class='srclink' href='../src/magical/types.rs.html#33' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
-</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H)</code><a class='srclink' href='../src/magical/types.rs.html#33' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
-</div><h4 id='method.hash_slice' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#192-199' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
-</div></div><h3 id='impl-PartialEq%3CScriptType%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>> for <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a href='#impl-PartialEq%3CScriptType%3E' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/magical/types.rs.html#33' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code>fn <a href='https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../src/magical/types.rs.html#33' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
-</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#33' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Base32Len' class='impl'><code class='in-band'>impl<T> Base32Len for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>, </span></code><a href='#impl-Base32Len' class='anchor'></a></h3><div class='impl-items'><h4 id='method.base32_len' class="method hidden"><code>fn <a href='#method.base32_len' class='fnname'>base32_len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Calculate the base32 serialized length</p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-CheckBase32%3CVec%3Cu5%3E%3E' class='impl'><code class='in-band'>impl<'f, T> CheckBase32<<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><u5>> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>, </span></code><a href='#impl-CheckBase32%3CVec%3Cu5%3E%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='associatedtype.Err' class="type"><code>type <a href='#associatedtype.Err' class="type">Err</a> = Error</code></h4><div class='docblock'><p>Error type if conversion fails</p>
-</div><h4 id='method.check_base32' class="method hidden"><code>fn <a href='#method.check_base32' class='fnname'>check_base32</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><u5>, <T as CheckBase32<<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><u5>>>::Err></code></h4><div class='docblock hidden'><p>Check if all values are in range and return array-like struct of <code>u5</code> values</p>
-</div></div><h3 id='impl-DeserializeOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://docs.rs/serde/1.0.115/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> for T <span class="where fmt-newline">where<br> T: for<'de> <a class="trait" href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de>, </span></code><a href='#impl-DeserializeOwned' class='anchor'></a><a class='srclink' href='https://docs.rs/serde/1.0.115/src/serde/de/mod.rs.html#604' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToBase32' class='impl'><code class='in-band'>impl<T> ToBase32 for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>>, </span></code><a href='#impl-ToBase32' class='anchor'></a></h3><div class='impl-items'><h4 id='method.write_base32' class="method hidden"><code>fn <a href='#method.write_base32' class='fnname'>write_base32</a><W>(&self, writer: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>W) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <W as WriteBase32>::Err> <span class="where fmt-newline">where<br> W: WriteBase32, </span></code></h4><div class='docblock hidden'><p>Encode as base32 and write it to the supplied writer Implementations shouldn't allocate. <a href="#tymethod.write_base32">Read more</a></p>
-</div><h4 id='method.to_base32' class="method hidden"><code>fn <a href='#method.to_base32' class='fnname'>to_base32</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><u5></code></h4><div class='docblock hidden'><p>Convert <code>Self</code> to base32 vector</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "magical";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=../../magical/enum.Error.html">
-</head>
-<body>
- <p>Redirecting to <a href="../../magical/enum.Error.html">../../magical/enum.Error.html</a>...</p>
- <script>location.replace("../../magical/enum.Error.html" + location.search + location.hash);</script>
-</body>
-</html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `magical` crate."><meta name="keywords" content="rust, rustlang, rust-lang, magical"><title>magical - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../magical/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Crate magical</p><div class="sidebar-elems"><a id='all-types' href='all.html'><p>See all magical's items</p></a><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'magical', ty: 'mod', relpath: '../'};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/magical/lib.rs.html#27-88' title='goto source code'>[src]</a></span><span class='in-band'>Crate <a class="mod" href=''>magical</a></span></h1><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
-<table><tr><td><code>pub extern crate bitcoin;</code></td></tr><tr><td><code>pub extern crate miniscript;</code></td></tr><tr><td><code>pub extern crate electrum_client;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="https://docs.rs/reqwest/0.10.7/reqwest/index.html" title="mod reqwest">reqwest</a>;</code></td></tr><tr><td><code>pub extern crate sled;</code></td></tr><tr><td><code>pub use descriptor::<a class="type" href="../magical/descriptor/type.HDKeyPaths.html" title="type magical::descriptor::HDKeyPaths">HDKeyPaths</a>;</code></td></tr><tr><td><code>pub use wallet::<a class="mod" href="../magical/wallet/address_validator/index.html" title="mod magical::wallet::address_validator">address_validator</a>;</code></td></tr><tr><td><code>pub use wallet::<a class="mod" href="../magical/wallet/signer/index.html" title="mod magical::wallet::signer">signer</a>;</code></td></tr><tr><td><code>pub use wallet::tx_builder::<a class="struct" href="../magical/wallet/tx_builder/struct.TxBuilder.html" title="struct magical::wallet::tx_builder::TxBuilder">TxBuilder</a>;</code></td></tr><tr><td><code>pub use wallet::<a class="type" href="../magical/wallet/type.OfflineWallet.html" title="type magical::wallet::OfflineWallet">OfflineWallet</a>;</code></td></tr><tr><td><code>pub use wallet::<a class="struct" href="../magical/wallet/struct.Wallet.html" title="struct magical::wallet::Wallet">Wallet</a>;</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
-<table><tr class='module-item'><td><a class="mod" href="blockchain/index.html" title='magical::blockchain mod'>blockchain</a></td><td class='docblock-short'><p>Blockchain backends</p>
-</td></tr><tr class='module-item'><td><a class="mod" href="database/index.html" title='magical::database mod'>database</a></td><td class='docblock-short'><p>Database types</p>
-</td></tr><tr class='module-item'><td><a class="mod" href="descriptor/index.html" title='magical::descriptor mod'>descriptor</a></td><td class='docblock-short'><p>Descriptors</p>
-</td></tr><tr class='module-item'><td><a class="mod" href="wallet/index.html" title='magical::wallet mod'>wallet</a></td><td class='docblock-short'><p>Wallet</p>
-</td></tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
-<table><tr class='module-item'><td><a class="struct" href="struct.FeeRate.html" title='magical::FeeRate struct'>FeeRate</a></td><td class='docblock-short'><p>Fee rate</p>
-</td></tr><tr class='module-item'><td><a class="struct" href="struct.TransactionDetails.html" title='magical::TransactionDetails struct'>TransactionDetails</a></td><td class='docblock-short'><p>A wallet transaction</p>
-</td></tr><tr class='module-item'><td><a class="struct" href="struct.UTXO.html" title='magical::UTXO struct'>UTXO</a></td><td class='docblock-short'><p>A wallet unspent output</p>
-</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
-<table><tr class='module-item'><td><a class="enum" href="enum.Error.html" title='magical::Error enum'>Error</a></td><td class='docblock-short'><p>Errors that can be thrown by the <a href="../magical/wallet/struct.Wallet.html"><code>Wallet</code></a></p>
-</td></tr><tr class='module-item'><td><a class="enum" href="enum.ScriptType.html" title='magical::ScriptType enum'>ScriptType</a></td><td class='docblock-short'><p>Types of script</p>
-</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "magical";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"enum":[["Error","Errors that can be thrown by the `Wallet`"],["ScriptType","Types of script"]],"mod":[["blockchain","Blockchain backends"],["database","Database types"],["descriptor","Descriptors"],["wallet","Wallet"]],"struct":[["FeeRate","Fee rate"],["TransactionDetails","A wallet transaction"],["UTXO","A wallet unspent output"]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `FeeRate` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, FeeRate"><title>magical::FeeRate - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../magical/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct FeeRate</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.as_sat_vb">as_sat_vb</a><a href="#method.default_min_relay_fee">default_min_relay_fee</a><a href="#method.from_btc_per_kvb">from_btc_per_kvb</a><a href="#method.from_sat_per_vb">from_sat_per_vb</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-PartialEq%3CFeeRate%3E">PartialEq<FeeRate></a><a href="#impl-PartialOrd%3CFeeRate%3E">PartialOrd<FeeRate></a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='index.html'>magical</a></p><script>window.sidebarCurrent = {name: 'FeeRate', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/magical/types.rs.html#64' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>magical</a>::<wbr><a class="struct" href=''>FeeRate</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct FeeRate(_);</pre></div><div class='docblock'><p>Fee rate</p>
-</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#66-86' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from_btc_per_kvb' class="method"><code>pub fn <a href='#method.from_btc_per_kvb' class='fnname'>from_btc_per_kvb</a>(btc_per_kvb: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>) -> Self</code><a class='srclink' href='../src/magical/types.rs.html#68-70' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new instance of <a href="../magical/struct.FeeRate.html" title="`FeeRate`"><code>FeeRate</code></a> given a float fee rate in btc/kvbytes</p>
-</div><h4 id='method.from_sat_per_vb' class="method"><code>pub fn <a href='#method.from_sat_per_vb' class='fnname'>from_sat_per_vb</a>(sat_per_vb: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>) -> Self</code><a class='srclink' href='../src/magical/types.rs.html#73-75' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new instance of <a href="../magical/struct.FeeRate.html" title="`FeeRate`"><code>FeeRate</code></a> given a float fee rate in satoshi/vbyte</p>
-</div><h4 id='method.default_min_relay_fee' class="method"><code>pub fn <a href='#method.default_min_relay_fee' class='fnname'>default_min_relay_fee</a>() -> Self</code><a class='srclink' href='../src/magical/types.rs.html#78-80' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new <a href="../magical/struct.FeeRate.html" title="`FeeRate`"><code>FeeRate</code></a> with the default min relay fee value</p>
-</div><h4 id='method.as_sat_vb' class="method"><code>pub fn <a href='#method.as_sat_vb' class='fnname'>as_sat_vb</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a></code><a class='srclink' href='../src/magical/types.rs.html#83-85' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the value as satoshi/vbyte</p>
-</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#62' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a></code><a class='srclink' href='../src/magical/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#62' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#62' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../src/magical/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#88-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> Self</code><a class='srclink' href='../src/magical/types.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
-</div></div><h3 id='impl-PartialEq%3CFeeRate%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>> for <a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a></code><a href='#impl-PartialEq%3CFeeRate%3E' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#62' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/magical/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/magical/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-PartialOrd%3CFeeRate%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>> for <a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a></code><a href='#impl-PartialOrd%3CFeeRate%3E' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#62' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../src/magical/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
-</div><h4 id='method.lt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: &<a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/magical/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
-</div><h4 id='method.le' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: &<a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/magical/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
-</div><h4 id='method.gt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: &<a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/magical/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
-</div><h4 id='method.ge' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: &<a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/magical/types.rs.html#62' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
-</div></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#62' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "magical";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `TransactionDetails` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, TransactionDetails"><title>magical::TransactionDetails - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../magical/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct TransactionDetails</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.fees">fees</a><a href="#structfield.height">height</a><a href="#structfield.received">received</a><a href="#structfield.sent">sent</a><a href="#structfield.timestamp">timestamp</a><a href="#structfield.transaction">transaction</a><a href="#structfield.txid">txid</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Eq">Eq</a><a href="#impl-PartialEq%3CTransactionDetails%3E">PartialEq<TransactionDetails></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-DeserializeOwned">DeserializeOwned</a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='index.html'>magical</a></p><script>window.sidebarCurrent = {name: 'TransactionDetails', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/magical/types.rs.html#104-112' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>magical</a>::<wbr><a class="struct" href=''>TransactionDetails</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct TransactionDetails {
- pub transaction: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction>,
- pub txid: Txid,
- pub timestamp: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
- pub received: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
- pub sent: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
- pub fees: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
- pub height: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>>,
-}</pre></div><div class='docblock'><p>A wallet transaction</p>
-</div><h2 id='fields' class='fields small-section-header'>
- Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.transaction" class="structfield small-section-header"><a href="#structfield.transaction" class="anchor field"></a><code>transaction: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transaction></code></span><span id="structfield.txid" class="structfield small-section-header"><a href="#structfield.txid" class="anchor field"></a><code>txid: Txid</code></span><span id="structfield.timestamp" class="structfield small-section-header"><a href="#structfield.timestamp" class="anchor field"></a><code>timestamp: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></code></span><span id="structfield.received" class="structfield small-section-header"><a href="#structfield.received" class="anchor field"></a><code>received: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></code></span><span id="structfield.sent" class="structfield small-section-header"><a href="#structfield.sent" class="anchor field"></a><code>sent: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></code></span><span id="structfield.fees" class="structfield small-section-header"><a href="#structfield.fees" class="anchor field"></a><code>fees: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></code></span><span id="structfield.height" class="structfield small-section-header"><a href="#structfield.height" class="anchor field"></a><code>height: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>></code></span><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a></code><a class='srclink' href='../src/magical/types.rs.html#103' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../src/magical/types.rs.html#103' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a></code><a class='srclink' href='../src/magical/types.rs.html#103' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
-</div></div><h3 id='impl-Deserialize%3C%27de%3E' class='impl'><code class='in-band'>impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a></code><a href='#impl-Deserialize%3C%27de%3E' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deserialize' class="method hidden"><code>fn <a href='https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html#tymethod.deserialize' class='fnname'>deserialize</a><__D>(__deserializer: __D) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, __D::<a class="type" href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> __D: <a class="trait" href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class='srclink' href='../src/magical/types.rs.html#103' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
-</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-PartialEq%3CTransactionDetails%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>> for <a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a></code><a href='#impl-PartialEq%3CTransactionDetails%3E' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/magical/types.rs.html#103' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/magical/types.rs.html#103' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code>fn <a href='https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../src/magical/types.rs.html#103' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
-</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#103' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-DeserializeOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://docs.rs/serde/1.0.115/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> for T <span class="where fmt-newline">where<br> T: for<'de> <a class="trait" href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de>, </span></code><a href='#impl-DeserializeOwned' class='anchor'></a><a class='srclink' href='https://docs.rs/serde/1.0.115/src/serde/de/mod.rs.html#604' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "magical";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `UTXO` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, UTXO"><title>magical::UTXO - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../magical/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct UTXO</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.is_internal">is_internal</a><a href="#structfield.outpoint">outpoint</a><a href="#structfield.txout">txout</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Eq">Eq</a><a href="#impl-PartialEq%3CUTXO%3E">PartialEq<UTXO></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-DeserializeOwned">DeserializeOwned</a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='index.html'>magical</a></p><script>window.sidebarCurrent = {name: 'UTXO', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/magical/types.rs.html#96-100' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>magical</a>::<wbr><a class="struct" href=''>UTXO</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct UTXO {
- pub outpoint: OutPoint,
- pub txout: TxOut,
- pub is_internal: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
-}</pre></div><div class='docblock'><p>A wallet unspent output</p>
-</div><h2 id='fields' class='fields small-section-header'>
- Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.outpoint" class="structfield small-section-header"><a href="#structfield.outpoint" class="anchor field"></a><code>outpoint: OutPoint</code></span><span id="structfield.txout" class="structfield small-section-header"><a href="#structfield.txout" class="anchor field"></a><code>txout: TxOut</code></span><span id="structfield.is_internal" class="structfield small-section-header"><a href="#structfield.is_internal" class="anchor field"></a><code>is_internal: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#95' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a></code><a class='srclink' href='../src/magical/types.rs.html#95' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#95' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../src/magical/types.rs.html#95' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Deserialize%3C%27de%3E' class='impl'><code class='in-band'>impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a></code><a href='#impl-Deserialize%3C%27de%3E' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#95' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deserialize' class="method hidden"><code>fn <a href='https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html#tymethod.deserialize' class='fnname'>deserialize</a><__D>(__deserializer: __D) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, __D::<a class="type" href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> __D: <a class="trait" href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class='srclink' href='../src/magical/types.rs.html#95' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
-</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#95' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-PartialEq%3CUTXO%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>> for <a class="struct" href="../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a></code><a href='#impl-PartialEq%3CUTXO%3E' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#95' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/magical/types.rs.html#95' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="struct" href="../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/magical/types.rs.html#95' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#95' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code>fn <a href='https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../src/magical/types.rs.html#95' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
-</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#95' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../src/magical/types.rs.html#95' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-DeserializeOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://docs.rs/serde/1.0.115/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> for T <span class="where fmt-newline">where<br> T: for<'de> <a class="trait" href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de>, </span></code><a href='#impl-DeserializeOwned' class='anchor'></a><a class='srclink' href='https://docs.rs/serde/1.0.115/src/serde/de/mod.rs.html#604' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "magical";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=../../magical/enum.ScriptType.html">
-</head>
-<body>
- <p>Redirecting to <a href="../../magical/enum.ScriptType.html">../../magical/enum.ScriptType.html</a>...</p>
- <script>location.replace("../../magical/enum.ScriptType.html" + location.search + location.hash);</script>
-</body>
-</html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=../../magical/struct.FeeRate.html">
-</head>
-<body>
- <p>Redirecting to <a href="../../magical/struct.FeeRate.html">../../magical/struct.FeeRate.html</a>...</p>
- <script>location.replace("../../magical/struct.FeeRate.html" + location.search + location.hash);</script>
-</body>
-</html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=../../magical/struct.TransactionDetails.html">
-</head>
-<body>
- <p>Redirecting to <a href="../../magical/struct.TransactionDetails.html">../../magical/struct.TransactionDetails.html</a>...</p>
- <script>location.replace("../../magical/struct.TransactionDetails.html" + location.search + location.hash);</script>
-</body>
-</html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=../../magical/struct.UTXO.html">
-</head>
-<body>
- <p>Redirecting to <a href="../../magical/struct.UTXO.html">../../magical/struct.UTXO.html</a>...</p>
- <script>location.replace("../../magical/struct.UTXO.html" + location.search + location.hash);</script>
-</body>
-</html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `AddressValidatorError` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, AddressValidatorError"><title>magical::wallet::address_validator::AddressValidatorError - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum AddressValidatorError</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.ConnectionError">ConnectionError</a><a href="#variant.InvalidScript">InvalidScript</a><a href="#variant.Message">Message</a><a href="#variant.TimeoutError">TimeoutError</a><a href="#variant.UserRejected">UserRejected</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-Error">Error</a><a href="#impl-From%3CAddressValidatorError%3E">From<AddressValidatorError></a><a href="#impl-PartialEq%3CAddressValidatorError%3E">PartialEq<AddressValidatorError></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>address_validator</a></p><script>window.sidebarCurrent = {name: 'AddressValidatorError', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/address_validator.rs.html#86-92' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>address_validator</a>::<wbr><a class="enum" href=''>AddressValidatorError</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum AddressValidatorError {
- UserRejected,
- ConnectionError,
- TimeoutError,
- InvalidScript,
- Message(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
-}</pre></div><div class='docblock'><p>Errors that can be returned to fail the validation of an address</p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<div id="variant.UserRejected" class="variant small-section-header"><a href="#variant.UserRejected" class="anchor field"></a><code>UserRejected</code></div><div id="variant.ConnectionError" class="variant small-section-header"><a href="#variant.ConnectionError" class="anchor field"></a><code>ConnectionError</code></div><div id="variant.TimeoutError" class="variant small-section-header"><a href="#variant.TimeoutError" class="anchor field"></a><code>TimeoutError</code></div><div id="variant.InvalidScript" class="variant small-section-header"><a href="#variant.InvalidScript" class="anchor field"></a><code>InvalidScript</code></div><div id="variant.Message" class="variant small-section-header"><a href="#variant.Message" class="anchor field"></a><code>Message(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a class='srclink' href='../../../src/magical/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/address_validator.rs.html#94-98' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/wallet/address_validator.rs.html#95-97' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Error' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-Error' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/address_validator.rs.html#100' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.source' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source' class='fnname'>source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><span class='since' title='Stable since Rust version 1.30.0'>1.30.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#100-102' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
-</div><h4 id='method.backtrace' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace' class='fnname'>backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#128-130' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>backtrace</code>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
-</div><h4 id='method.description' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description' class='fnname'>description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#140-142' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
-</div></div><div class='docblock hidden'><p><code>if let Err(e) = "xc".parse::<u32>() { // Print </code>e<code> itself, no need for description(). eprintln!("Error: {}", e); }</code> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></p>
-</div><h4 id='method.cause' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#150-152' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
-</div></div></div><h3 id='impl-From%3CAddressValidatorError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>> for <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CAddressValidatorError%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>) -> Self</code><a class='srclink' href='../../../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-PartialEq%3CAddressValidatorError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>> for <a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-PartialEq%3CAddressValidatorError%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/address_validator.rs.html#85' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2237-2247' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2239-2246' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `address_validator` mod in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, address_validator"><title>magical::wallet::address_validator - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module address_validator</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'address_validator', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/address_validator.rs.html#25-162' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a class="mod" href=''>address_validator</a></span></h1><div class='docblock'><p>Address validation callbacks</p>
-<p>The typical usage of those callbacks is for displaying the newly-generated address on a
-hardware wallet, so that the user can cross-check its correctness.</p>
-<p>More generally speaking though, these callbacks can also be used to "do something" every time
-an address is generated, without necessarily checking or validating it.</p>
-<p>An address validator can be attached to a <a href="../../../magical/wallet/struct.Wallet.html"><code>Wallet</code></a> by using the
-<a href="../../../magical/wallet/struct.Wallet.html#method.add_address_validator"><code>Wallet::add_address_validator</code></a> method, and
-whenever a new address is generated (either explicitly by the user with
-<a href="../../../magical/wallet/struct.Wallet.html#method.get_new_address"><code>Wallet::get_new_address</code></a> or internally to create a change
-address) all the attached validators will be polled, in sequence. All of them must complete
-successfully to continue.</p>
-<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
-<div class="example-wrap"><pre class="rust rust-example-rendered">
-<span class="kw">struct</span> <span class="ident">PrintAddressAndContinue</span>;
-
-<span class="kw">impl</span> <span class="ident">AddressValidator</span> <span class="kw">for</span> <span class="ident">PrintAddressAndContinue</span> {
- <span class="kw">fn</span> <span class="ident">validate</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
- <span class="ident">hd_keypaths</span>: <span class="kw-2">&</span><span class="ident">HDKeyPaths</span>,
- <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">AddressValidatorError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">address</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_script</span>(<span class="ident">script</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>)
- .<span class="ident">as_ref</span>()
- .<span class="ident">map</span>(<span class="ident">Address</span>::<span class="ident">to_string</span>)
- .<span class="ident">unwrap_or</span>(<span class="ident">script</span>.<span class="ident">to_string</span>());
- <span class="macro">println</span><span class="macro">!</span>(<span class="string">"New address of type {:?}: {}"</span>, <span class="ident">script_type</span>, <span class="ident">address</span>);
- <span class="macro">println</span><span class="macro">!</span>(<span class="string">"HD keypaths: {:#?}"</span>, <span class="ident">hd_keypaths</span>);
-
- <span class="prelude-val">Ok</span>(())
- }
-}
-
-<span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="string">"wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)"</span>;
-<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(<span class="ident">descriptor</span>, <span class="prelude-val">None</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>, <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>())<span class="question-mark">?</span>;
-<span class="ident">wallet</span>.<span class="ident">add_address_validator</span>(<span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">PrintAddressAndContinue</span>)));
-
-<span class="kw">let</span> <span class="ident">address</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>()<span class="question-mark">?</span>;
-<span class="macro">println</span><span class="macro">!</span>(<span class="string">"Address: {}"</span>, <span class="ident">address</span>);</pre></div>
-</div><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
-<table><tr class='module-item'><td><a class="enum" href="enum.AddressValidatorError.html" title='magical::wallet::address_validator::AddressValidatorError enum'>AddressValidatorError</a></td><td class='docblock-short'><p>Errors that can be returned to fail the validation of an address</p>
-</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
-<table><tr class='module-item'><td><a class="trait" href="trait.AddressValidator.html" title='magical::wallet::address_validator::AddressValidator trait'>AddressValidator</a></td><td class='docblock-short'><p>Trait to build address validators</p>
-</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"enum":[["AddressValidatorError","Errors that can be returned to fail the validation of an address"]],"trait":[["AddressValidator","Trait to build address validators"]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `AddressValidator` trait in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, AddressValidator"><title>magical::wallet::address_validator::AddressValidator - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait AddressValidator</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.validate">validate</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>address_validator</a></p><script>window.sidebarCurrent = {name: 'AddressValidator', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/address_validator.rs.html#109-117' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>address_validator</a>::<wbr><a class="trait" href=''>AddressValidator</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait AddressValidator {
- fn <a href='#tymethod.validate' class='fnname'>validate</a>(<br> &self, <br> script_type: <a class="enum" href="../../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> hd_keypaths: &<a class="type" href="../../../magical/descriptor/type.HDKeyPaths.html" title="type magical::descriptor::HDKeyPaths">HDKeyPaths</a>, <br> script: &Script<br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>>;
-}</pre></div><div class='docblock'><p>Trait to build address validators</p>
-<p>All the address validators attached to a wallet with <a href="../../../magical/wallet/struct.Wallet.html#method.add_address_validator"><code>Wallet::add_address_validator</code></a> will be polled
-every time an address (external or internal) is generated by the wallet. Errors returned in the
-validator will be propagated up to the original caller that triggered the address generation.</p>
-<p>For a usage example see <a href="../../../magical/wallet/address_validator/index.html">this module</a>'s documentation.</p>
-</div>
- <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.validate' class='method'><code>fn <a href='#tymethod.validate' class='fnname'>validate</a>(<br> &self, <br> script_type: <a class="enum" href="../../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> hd_keypaths: &<a class="type" href="../../../magical/descriptor/type.HDKeyPaths.html" title="type magical::descriptor::HDKeyPaths">HDKeyPaths</a>, <br> script: &Script<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/wallet/address_validator/enum.AddressValidatorError.html" title="enum magical::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>></code></h3><div class='docblock'><p>Validate or inspect an address</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../../implementors/magical/wallet/address_validator/trait.AddressValidator.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `coin_selection` mod in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, coin_selection"><title>magical::wallet::coin_selection - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module coin_selection</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'coin_selection', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/coin_selection.rs.html#25-349' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a class="mod" href=''>coin_selection</a></span></h1><div class='docblock'><p>Coin selection</p>
-<p>This module provides the trait <a href="../../../magical/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="`CoinSelectionAlgorithm`"><code>CoinSelectionAlgorithm</code></a> that can be implemented to
-define custom coin selection algorithms.</p>
-<p>The coin selection algorithm is not globally part of a <a href="../../../magical/wallet/struct.Wallet.html"><code>Wallet</code></a>, instead it
-is selected whenever a <a href="../../../magical/wallet/struct.Wallet.html#method.create_tx"><code>Wallet::create_tx</code></a> call is made, through
-the use of the <a href="../../../magical/wallet/tx_builder/struct.TxBuilder.html"><code>TxBuilder</code></a> structure, specifically with
-<a href="../../../magical/wallet/tx_builder/struct.TxBuilder.html#method.coin_selection"><code>TxBuilder::coin_selection</code></a> method.</p>
-<p>The <a href="../../../magical/wallet/coin_selection/type.DefaultCoinSelectionAlgorithm.html" title="`DefaultCoinSelectionAlgorithm`"><code>DefaultCoinSelectionAlgorithm</code></a> selects the default coin selection algorithm that
-<a href="../../../magical/wallet/tx_builder/struct.TxBuilder.html"><code>TxBuilder</code></a> uses, if it's not explicitly overridden.</p>
-<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
-<div class="example-wrap"><pre class="rust rust-example-rendered">
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">struct</span> <span class="ident">AlwaysSpendEverything</span>;
-
-<span class="kw">impl</span> <span class="ident">CoinSelectionAlgorithm</span> <span class="kw">for</span> <span class="ident">AlwaysSpendEverything</span> {
- <span class="kw">fn</span> <span class="ident">coin_select</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>,
- <span class="ident">_use_all_utxos</span>: <span class="ident">bool</span>,
- <span class="ident">fee_rate</span>: <span class="ident">FeeRate</span>,
- <span class="ident">amount_needed</span>: <span class="ident">u64</span>,
- <span class="ident">input_witness_weight</span>: <span class="ident">usize</span>,
- <span class="ident">fee_amount</span>: <span class="ident">f32</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CoinSelectionResult</span>, <span class="ident">magical</span>::<span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">selected_amount</span> <span class="op">=</span> <span class="ident">utxos</span>.<span class="ident">iter</span>().<span class="ident">fold</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">acc</span>, <span class="ident">utxo</span><span class="op">|</span> <span class="ident">acc</span> <span class="op">+</span> <span class="ident">utxo</span>.<span class="ident">txout</span>.<span class="ident">value</span>);
- <span class="kw">let</span> <span class="ident">all_utxos_selected</span> <span class="op">=</span> <span class="ident">utxos</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">utxo</span><span class="op">|</span> {
- (
- <span class="ident">TxIn</span> {
- <span class="ident">previous_output</span>: <span class="ident">utxo</span>.<span class="ident">outpoint</span>,
- ..<span class="ident">Default</span>::<span class="ident">default</span>()
- },
- <span class="ident">utxo</span>.<span class="ident">txout</span>.<span class="ident">script_pubkey</span>,
- )
- })
- .<span class="ident">collect</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span><span class="op">></span>();
- <span class="kw">let</span> <span class="ident">additional_weight</span> <span class="op">=</span> <span class="ident">all_utxos_selected</span>.<span class="ident">iter</span>().<span class="ident">fold</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">acc</span>, (<span class="ident">txin</span>, <span class="kw">_</span>)<span class="op">|</span> {
- <span class="ident">acc</span> <span class="op">+</span> <span class="ident">serialize</span>(<span class="ident">txin</span>).<span class="ident">len</span>() <span class="op">*</span> <span class="number">4</span> <span class="op">+</span> <span class="ident">input_witness_weight</span>
- });
- <span class="kw">let</span> <span class="ident">additional_fees</span> <span class="op">=</span> <span class="ident">additional_weight</span> <span class="kw">as</span> <span class="ident">f32</span> <span class="op">*</span> <span class="ident">fee_rate</span>.<span class="ident">as_sat_vb</span>() <span class="op">/</span> <span class="number">4.0</span>;
-
- <span class="kw">if</span> (<span class="ident">fee_amount</span> <span class="op">+</span> <span class="ident">additional_fees</span>).<span class="ident">ceil</span>() <span class="kw">as</span> <span class="ident">u64</span> <span class="op">+</span> <span class="ident">amount_needed</span> <span class="op">></span> <span class="ident">selected_amount</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">magical</span>::<span class="ident">Error</span>::<span class="ident">InsufficientFunds</span>);
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">CoinSelectionResult</span> {
- <span class="ident">txin</span>: <span class="ident">all_utxos_selected</span>,
- <span class="ident">selected_amount</span>,
- <span class="ident">fee_amount</span>: <span class="ident">fee_amount</span> <span class="op">+</span> <span class="ident">additional_fees</span>,
- })
- }
-}
-
-<span class="comment">// create wallet, sync, ...</span>
-
-<span class="kw">let</span> <span class="ident">to_address</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="string">"2N4eQYCbKUHCCTUjBJeHcJp9ok6J2GZsTDt"</span>).<span class="ident">unwrap</span>();
-<span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">to_address</span>.<span class="ident">script_pubkey</span>(), <span class="number">50_000</span>)])
- .<span class="ident">coin_selection</span>(<span class="ident">AlwaysSpendEverything</span>),
-)<span class="question-mark">?</span>;
-
-<span class="comment">// inspect, sign, broadcast, ...</span>
-</pre></div>
-</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
-<table><tr class='module-item'><td><a class="struct" href="struct.CoinSelectionResult.html" title='magical::wallet::coin_selection::CoinSelectionResult struct'>CoinSelectionResult</a></td><td class='docblock-short'><p>Result of a successful coin selection</p>
-</td></tr><tr class='module-item'><td><a class="struct" href="struct.DumbCoinSelection.html" title='magical::wallet::coin_selection::DumbCoinSelection struct'>DumbCoinSelection</a></td><td class='docblock-short'><p>Simple and dumb coin selection</p>
-</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
-<table><tr class='module-item'><td><a class="trait" href="trait.CoinSelectionAlgorithm.html" title='magical::wallet::coin_selection::CoinSelectionAlgorithm trait'>CoinSelectionAlgorithm</a></td><td class='docblock-short'><p>Trait for generalized coin selection algorithms</p>
-</td></tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
-<table><tr class='module-item'><td><a class="type" href="type.DefaultCoinSelectionAlgorithm.html" title='magical::wallet::coin_selection::DefaultCoinSelectionAlgorithm type'>DefaultCoinSelectionAlgorithm</a></td><td class='docblock-short'><p>Default coin selection algorithm used by <a href="../../../magical/wallet/tx_builder/struct.TxBuilder.html"><code>TxBuilder</code></a> if not
-overridden</p>
-</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"struct":[["CoinSelectionResult","Result of a successful coin selection"],["DumbCoinSelection","Simple and dumb coin selection"]],"trait":[["CoinSelectionAlgorithm","Trait for generalized coin selection algorithms"]],"type":[["DefaultCoinSelectionAlgorithm","Default coin selection algorithm used by `TxBuilder` if not overridden"]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `CoinSelectionResult` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, CoinSelectionResult"><title>magical::wallet::coin_selection::CoinSelectionResult - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct CoinSelectionResult</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.fee_amount">fee_amount</a><a href="#structfield.selected_amount">selected_amount</a><a href="#structfield.txin">txin</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>coin_selection</a></p><script>window.sidebarCurrent = {name: 'CoinSelectionResult', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/coin_selection.rs.html#117-124' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>coin_selection</a>::<wbr><a class="struct" href=''>CoinSelectionResult</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct CoinSelectionResult {
- pub txin: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>TxIn, Script<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>,
- pub selected_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
- pub fee_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>,
-}</pre></div><div class='docblock'><p>Result of a successful coin selection</p>
-</div><h2 id='fields' class='fields small-section-header'>
- Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.txin" class="structfield small-section-header"><a href="#structfield.txin" class="anchor field"></a><code>txin: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>TxIn, Script<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></code></span><div class='docblock'><p>List of inputs to use, with the respective previous script_pubkey</p>
-</div><span id="structfield.selected_amount" class="structfield small-section-header"><a href="#structfield.selected_amount" class="anchor field"></a><code>selected_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></code></span><div class='docblock'><p>Sum of the selected inputs' value</p>
-</div><span id="structfield.fee_amount" class="structfield small-section-header"><a href="#structfield.fee_amount" class="anchor field"></a><code>fee_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a></code></span><div class='docblock'><p>Total fee amount in satoshi</p>
-</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../magical/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct magical::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/coin_selection.rs.html#116' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/wallet/coin_selection.rs.html#116' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../magical/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct magical::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../magical/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct magical::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../magical/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct magical::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../magical/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct magical::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../magical/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct magical::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `DumbCoinSelection` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, DumbCoinSelection"><title>magical::wallet::coin_selection::DumbCoinSelection - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct DumbCoinSelection</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-CoinSelectionAlgorithm">CoinSelectionAlgorithm</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>coin_selection</a></p><script>window.sidebarCurrent = {name: 'DumbCoinSelection', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/coin_selection.rs.html#157' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>coin_selection</a>::<wbr><a class="struct" href=''>DumbCoinSelection</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct DumbCoinSelection;</pre></div><div class='docblock'><p>Simple and dumb coin selection</p>
-<p>This coin selection algorithm sorts the available UTXOs by value and then picks them starting
-from the largest ones until the required amount is reached.</p>
-</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-CoinSelectionAlgorithm' class='impl'><code class='in-band'>impl <a class="trait" href="../../../magical/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait magical::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a> for <a class="struct" href="../../../magical/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct magical::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-CoinSelectionAlgorithm' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/coin_selection.rs.html#159-216' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.coin_select' class="method hidden"><code>fn <a href='../../../magical/wallet/coin_selection/trait.CoinSelectionAlgorithm.html#tymethod.coin_select' class='fnname'>coin_select</a>(<br> &self, <br> utxos: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <br> use_all_utxos: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <br> fee_rate: <a class="struct" href="../../../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>, <br> outgoing_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>, <br> input_witness_weight: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br> fee_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../magical/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct magical::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/wallet/coin_selection.rs.html#160-215' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Perform the coin selection <a href="../../../magical/wallet/coin_selection/trait.CoinSelectionAlgorithm.html#tymethod.coin_select">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../magical/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct magical::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/coin_selection.rs.html#156' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/wallet/coin_selection.rs.html#156' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../../magical/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct magical::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/coin_selection.rs.html#156' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../../magical/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct magical::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a class='srclink' href='../../../src/magical/wallet/coin_selection.rs.html#156' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../magical/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct magical::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../magical/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct magical::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../magical/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct magical::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../magical/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct magical::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../magical/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct magical::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `CoinSelectionAlgorithm` trait in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, CoinSelectionAlgorithm"><title>magical::wallet::coin_selection::CoinSelectionAlgorithm - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait CoinSelectionAlgorithm</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.coin_select">coin_select</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>coin_selection</a></p><script>window.sidebarCurrent = {name: 'CoinSelectionAlgorithm', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/coin_selection.rs.html#132-150' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>coin_selection</a>::<wbr><a class="trait" href=''>CoinSelectionAlgorithm</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait CoinSelectionAlgorithm: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> {
- fn <a href='#tymethod.coin_select' class='fnname'>coin_select</a>(<br> &self, <br> utxos: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <br> use_all_utxos: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <br> fee_rate: <a class="struct" href="../../../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>, <br> amount_needed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>, <br> input_witness_weight: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br> fee_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../magical/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct magical::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>>;
-}</pre></div><div class='docblock'><p>Trait for generalized coin selection algorithms</p>
-<p>This trait can be implemented to make the <a href="../../../magical/wallet/struct.Wallet.html"><code>Wallet</code></a> use a customized coin
-selection algorithm when it creates transactions.</p>
-<p>For an example see <a href="../../../magical/wallet/coin_selection/index.html">this module</a>'s documentation.</p>
-</div>
- <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.coin_select' class='method'><code>fn <a href='#tymethod.coin_select' class='fnname'>coin_select</a>(<br> &self, <br> utxos: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <br> use_all_utxos: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <br> fee_rate: <a class="struct" href="../../../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>, <br> amount_needed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>, <br> input_witness_weight: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br> fee_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../magical/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct magical::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code></h3><div class='docblock'><p>Perform the coin selection</p>
-<ul>
-<li><code>utxos</code>: the list of spendable UTXOs</li>
-<li><code>use_all_utxos</code>: if true all utxos should be spent unconditionally</li>
-<li><code>fee_rate</code>: fee rate to use</li>
-<li><code>amount_needed</code>: the amount in satoshi to select</li>
-<li><code>input_witness_weight</code>: the weight of an input's witness to keep into account for the fees</li>
-<li><code>fee_amount</code>: the amount of fees in satoshi already accumulated from adding outputs</li>
-</ul>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-CoinSelectionAlgorithm' class='impl'><code class='in-band'>impl CoinSelectionAlgorithm for <a class="struct" href="../../../magical/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct magical::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a></code><a href='#impl-CoinSelectionAlgorithm' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/coin_selection.rs.html#159-216' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.coin_select' class="method hidden"><code>fn <a href='#method.coin_select' class='fnname'>coin_select</a>(<br> &self, <br> utxos: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <br> use_all_utxos: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <br> fee_rate: <a class="struct" href="../../../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>, <br> outgoing_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>, <br> input_witness_weight: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br> fee_amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../magical/wallet/coin_selection/struct.CoinSelectionResult.html" title="struct magical::wallet::coin_selection::CoinSelectionResult">CoinSelectionResult</a>, <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../../src/magical/wallet/coin_selection.rs.html#160-215' title='goto source code'>[src]</a></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../../implementors/magical/wallet/coin_selection/trait.CoinSelectionAlgorithm.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `DefaultCoinSelectionAlgorithm` type in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, DefaultCoinSelectionAlgorithm"><title>magical::wallet::coin_selection::DefaultCoinSelectionAlgorithm - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition DefaultCoinSelectionAlgorithm</p><div class="sidebar-elems"><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>coin_selection</a></p><script>window.sidebarCurrent = {name: 'DefaultCoinSelectionAlgorithm', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/coin_selection.rs.html#113' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>coin_selection</a>::<wbr><a class="type" href=''>DefaultCoinSelectionAlgorithm</a></span></h1><pre class='rust typedef'>type DefaultCoinSelectionAlgorithm = <a class="struct" href="../../../magical/wallet/coin_selection/struct.DumbCoinSelection.html" title="struct magical::wallet::coin_selection::DumbCoinSelection">DumbCoinSelection</a>;</pre><div class='docblock'><p>Default coin selection algorithm used by <a href="../../../magical/wallet/tx_builder/struct.TxBuilder.html"><code>TxBuilder</code></a> if not
-overridden</p>
-</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `export` mod in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, export"><title>magical::wallet::export - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module export</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'export', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/export.rs.html#25-340' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a class="mod" href=''>export</a></span></h1><div class='docblock'><p>Wallet export</p>
-<p>This modules implements the wallet export format used by <a href="https://github.com/Fonta1n3/FullyNoded/blob/10b7808c8b929b171cca537fb50522d015168ac9/Docs/Wallets/Wallet-Export-Spec.md">FullyNoded</a>.</p>
-<h2 id="examples" class="section-header"><a href="#examples">Examples</a></h2><h3 id="import-from-json" class="section-header"><a href="#import-from-json">Import from JSON</a></h3>
-<div class="example-wrap"><pre class="rust rust-example-rendered">
-<span class="kw">let</span> <span class="ident">import</span> <span class="op">=</span> <span class="string">r#"{
- "descriptor": "wpkh([c258d2e4\/84h\/1h\/0h]tpubDD3ynpHgJQW8VvWRzQ5WFDCrs4jqVFGHB3vLC3r49XHJSqP8bHKdK4AriuUKLccK68zfzowx7YhmDN8SiSkgCDENUFx9qVw65YyqM78vyVe\/0\/*)",
- "blockheight":1782088,
- "label":"testnet"
-}"#</span>;
-
-<span class="kw">let</span> <span class="ident">import</span> <span class="op">=</span> <span class="ident">WalletExport</span>::<span class="ident">from_str</span>(<span class="ident">import</span>)<span class="question-mark">?</span>;
-<span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(<span class="kw-2">&</span><span class="ident">import</span>.<span class="ident">descriptor</span>(), <span class="ident">import</span>.<span class="ident">change_descriptor</span>().<span class="ident">as_deref</span>(), <span class="ident">Network</span>::<span class="ident">Testnet</span>, <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>())<span class="question-mark">?</span>;</pre></div>
-<h3 id="export-a-wallet" class="section-header"><a href="#export-a-wallet">Export a <code>Wallet</code></a></h3>
-<div class="example-wrap"><pre class="rust rust-example-rendered">
-<span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(
- <span class="string">"wpkh([c258d2e4/84h/1h/0h]tpubDD3ynpHgJQW8VvWRzQ5WFDCrs4jqVFGHB3vLC3r49XHJSqP8bHKdK4AriuUKLccK68zfzowx7YhmDN8SiSkgCDENUFx9qVw65YyqM78vyVe/0/*)"</span>,
- <span class="prelude-val">Some</span>(<span class="string">"wpkh([c258d2e4/84h/1h/0h]tpubDD3ynpHgJQW8VvWRzQ5WFDCrs4jqVFGHB3vLC3r49XHJSqP8bHKdK4AriuUKLccK68zfzowx7YhmDN8SiSkgCDENUFx9qVw65YyqM78vyVe/1/*)"</span>),
- <span class="ident">Network</span>::<span class="ident">Testnet</span>,
- <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>()
-)<span class="question-mark">?</span>;
-<span class="kw">let</span> <span class="ident">export</span> <span class="op">=</span> <span class="ident">WalletExport</span>::<span class="ident">export_wallet</span>(<span class="kw-2">&</span><span class="ident">wallet</span>, <span class="string">"exported wallet"</span>, <span class="bool-val">true</span>)
- .<span class="ident">map_err</span>(<span class="ident">ToString</span>::<span class="ident">to_string</span>)
- .<span class="ident">map_err</span>(<span class="ident">magical</span>::<span class="ident">Error</span>::<span class="ident">Generic</span>)<span class="question-mark">?</span>;
-
-<span class="macro">println</span><span class="macro">!</span>(<span class="string">"Exported: {}"</span>, <span class="ident">export</span>.<span class="ident">to_string</span>());</pre></div>
-</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
-<table><tr class='module-item'><td><a class="struct" href="struct.WalletExport.html" title='magical::wallet::export::WalletExport struct'>WalletExport</a></td><td class='docblock-short'><p>Structure that contains the export of a wallet</p>
-</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"struct":[["WalletExport","Structure that contains the export of a wallet"]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `WalletExport` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, WalletExport"><title>magical::wallet::export::WalletExport - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct WalletExport</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.blockheight">blockheight</a><a href="#structfield.label">label</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.change_descriptor">change_descriptor</a><a href="#method.descriptor">descriptor</a><a href="#method.export_wallet">export_wallet</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-FromStr">FromStr</a><a href="#impl-Serialize">Serialize</a><a href="#impl-ToString">ToString</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-DeserializeOwned">DeserializeOwned</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>export</a></p><script>window.sidebarCurrent = {name: 'WalletExport', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/export.rs.html#84-90' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>export</a>::<wbr><a class="struct" href=''>WalletExport</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct WalletExport {
- pub blockheight: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
- pub label: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
- // some fields omitted
-}</pre></div><div class='docblock'><p>Structure that contains the export of a wallet</p>
-<p>For a usage example see <a href="../../../magical/wallet/export/index.html">this module</a>'s documentation.</p>
-</div><h2 id='fields' class='fields small-section-header'>
- Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.blockheight" class="structfield small-section-header"><a href="#structfield.blockheight" class="anchor field"></a><code>blockheight: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code></span><div class='docblock'><p>Earliest block to rescan when looking for the wallet's transactions</p>
-</div><span id="structfield.label" class="structfield small-section-header"><a href="#structfield.label" class="anchor field"></a><code>label: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></span><div class='docblock'><p>Arbitrary label for the wallet</p>
-</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../magical/wallet/export/struct.WalletExport.html" title="struct magical::wallet::export::WalletExport">WalletExport</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/export.rs.html#106-197' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.export_wallet' class="method"><code>pub fn <a href='#method.export_wallet' class='fnname'>export_wallet</a><B: <a class="trait" href="../../../magical/blockchain/trait.Blockchain.html" title="trait magical::blockchain::Blockchain">Blockchain</a>, D: <a class="trait" href="../../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>>(<br> wallet: &<a class="struct" href="../../../magical/wallet/struct.Wallet.html" title="struct magical::wallet::Wallet">Wallet</a><B, D>, <br> label: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> include_blockheight: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>></code><a class='srclink' href='../../../src/magical/wallet/export.rs.html#118-158' title='goto source code'>[src]</a></h4><div class='docblock'><p>Export a wallet</p>
-<p>This function returns an error if it determines that the <code>wallet</code>'s descriptor(s) are not
-supported by Bitcoin Core or don't follow the standard derivation paths defined by BIP44
-and others.</p>
-<p>If <code>include_blockheight</code> is <code>true</code>, this function will look into the <code>wallet</code>'s database
-for the oldest transaction it knows and use that as the earliest block to rescan.</p>
-<p>If the database is empty or <code>include_blockheight</code> is false, the <code>blockheight</code> field
-returned will be <code>0</code>.</p>
-</div><h4 id='method.descriptor' class="method"><code>pub fn <a href='#method.descriptor' class='fnname'>descriptor</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='../../../src/magical/wallet/export.rs.html#183-185' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the external descriptor</p>
-</div><h4 id='method.change_descriptor' class="method"><code>pub fn <a href='#method.change_descriptor' class='fnname'>change_descriptor</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code><a class='srclink' href='../../../src/magical/wallet/export.rs.html#188-196' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the internal descriptor, if present</p>
-</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../magical/wallet/export/struct.WalletExport.html" title="struct magical::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/export.rs.html#83' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/wallet/export.rs.html#83' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Deserialize%3C%27de%3E' class='impl'><code class='in-band'>impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="../../../magical/wallet/export/struct.WalletExport.html" title="struct magical::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-Deserialize%3C%27de%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/export.rs.html#83' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deserialize' class="method hidden"><code>fn <a href='https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html#tymethod.deserialize' class='fnname'>deserialize</a><__D>(__deserializer: __D) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, __D::<a class="type" href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> __D: <a class="trait" href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class='srclink' href='../../../src/magical/wallet/export.rs.html#83' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
-</div></div><h3 id='impl-FromStr' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a> for <a class="struct" href="../../../magical/wallet/export/struct.WalletExport.html" title="struct magical::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-FromStr' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/export.rs.html#98-104' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Err' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err' class="type">Err</a> = <a class="struct" href="https://docs.rs/serde_json/1.0.57/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a></code></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
-</div><h4 id='method.from_str' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str' class='fnname'>from_str</a>(s: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>></code><a class='srclink' href='../../../src/magical/wallet/export.rs.html#101-103' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str">Read more</a></p>
-</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../../../magical/wallet/export/struct.WalletExport.html" title="struct magical::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/export.rs.html#83' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code>fn <a href='https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../../../src/magical/wallet/export.rs.html#83' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.115/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
-</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for <a class="struct" href="../../../magical/wallet/export/struct.WalletExport.html" title="struct magical::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/export.rs.html#92-96' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='../../../src/magical/wallet/export.rs.html#93-95' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../magical/wallet/export/struct.WalletExport.html" title="struct magical::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../magical/wallet/export/struct.WalletExport.html" title="struct magical::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../magical/wallet/export/struct.WalletExport.html" title="struct magical::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../magical/wallet/export/struct.WalletExport.html" title="struct magical::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../magical/wallet/export/struct.WalletExport.html" title="struct magical::wallet::export::WalletExport">WalletExport</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-DeserializeOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://docs.rs/serde/1.0.115/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> for T <span class="where fmt-newline">where<br> T: for<'de> <a class="trait" href="https://docs.rs/serde/1.0.115/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de>, </span></code><a href='#impl-DeserializeOwned' class='anchor'></a><a class='srclink' href='https://docs.rs/serde/1.0.115/src/serde/de/mod.rs.html#604' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToString-1' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString-1' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2237-2247' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string-1' class="method hidden"><code>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2239-2246' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `wallet` mod in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, wallet"><title>magical::wallet - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module wallet</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'><a href='../index.html'>magical</a></p><script>window.sidebarCurrent = {name: 'wallet', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/wallet/mod.rs.html#25-2435' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>magical</a>::<wbr><a class="mod" href=''>wallet</a></span></h1><div class='docblock'><p>Wallet</p>
-<p>This module defines the <a href="../../magical/wallet/struct.Wallet.html" title="`Wallet`"><code>Wallet</code></a> structure.</p>
-</div><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
-<table><tr class='module-item'><td><a class="mod" href="address_validator/index.html" title='magical::wallet::address_validator mod'>address_validator</a></td><td class='docblock-short'><p>Address validation callbacks</p>
-</td></tr><tr class='module-item'><td><a class="mod" href="coin_selection/index.html" title='magical::wallet::coin_selection mod'>coin_selection</a></td><td class='docblock-short'><p>Coin selection</p>
-</td></tr><tr class='module-item'><td><a class="mod" href="export/index.html" title='magical::wallet::export mod'>export</a></td><td class='docblock-short'><p>Wallet export</p>
-</td></tr><tr class='module-item'><td><a class="mod" href="signer/index.html" title='magical::wallet::signer mod'>signer</a></td><td class='docblock-short'><p>Generalized signers</p>
-</td></tr><tr class='module-item'><td><a class="mod" href="time/index.html" title='magical::wallet::time mod'>time</a></td><td class='docblock-short'><p>Cross-platform time</p>
-</td></tr><tr class='module-item'><td><a class="mod" href="tx_builder/index.html" title='magical::wallet::tx_builder mod'>tx_builder</a></td><td class='docblock-short'><p>Transaction builder</p>
-</td></tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
-<table><tr class='module-item'><td><a class="struct" href="struct.Wallet.html" title='magical::wallet::Wallet struct'>Wallet</a></td><td class='docblock-short'><p>A Bitcoin wallet</p>
-</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
-<table><tr class='module-item'><td><a class="trait" href="trait.IsDust.html" title='magical::wallet::IsDust trait'>IsDust</a></td><td class='docblock-short'><p>Trait to check if a value is below the dust limit</p>
-</td></tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
-<table><tr class='module-item'><td><a class="type" href="type.OfflineWallet.html" title='magical::wallet::OfflineWallet type'>OfflineWallet</a></td><td class='docblock-short'><p>Type alias for a <a href="../../magical/wallet/struct.Wallet.html" title="`Wallet`"><code>Wallet</code></a> that uses <a href="../../magical/blockchain/struct.OfflineBlockchain.html" title="`OfflineBlockchain`"><code>OfflineBlockchain</code></a></p>
-</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"mod":[["address_validator","Address validation callbacks"],["coin_selection","Coin selection"],["export","Wallet export"],["signer","Generalized signers"],["time","Cross-platform time"],["tx_builder","Transaction builder"]],"struct":[["Wallet","A Bitcoin wallet"]],"trait":[["IsDust","Trait to check if a value is below the dust limit"]],"type":[["OfflineWallet","Type alias for a [`Wallet`] that uses [`OfflineBlockchain`]"]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `SignerError` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, SignerError"><title>magical::wallet::signer::SignerError - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum SignerError</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.InputIndexOutOfRange">InputIndexOutOfRange</a><a href="#variant.InvalidNonWitnessUtxo">InvalidNonWitnessUtxo</a><a href="#variant.MissingHDKeypath">MissingHDKeypath</a><a href="#variant.MissingKey">MissingKey</a><a href="#variant.MissingNonWitnessUtxo">MissingNonWitnessUtxo</a><a href="#variant.MissingSighash">MissingSighash</a><a href="#variant.MissingWitnessScript">MissingWitnessScript</a><a href="#variant.MissingWitnessUtxo">MissingWitnessUtxo</a><a href="#variant.UserCanceled">UserCanceled</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-Error">Error</a><a href="#impl-From%3CSignerError%3E">From<SignerError></a><a href="#impl-PartialEq%3CSignerError%3E">PartialEq<SignerError></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a></p><script>window.sidebarCurrent = {name: 'SignerError', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#132-151' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a>::<wbr><a class="enum" href=''>SignerError</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum SignerError {
- MissingKey,
- UserCanceled,
- MissingSighash,
- InputIndexOutOfRange,
- MissingNonWitnessUtxo,
- InvalidNonWitnessUtxo,
- MissingWitnessUtxo,
- MissingWitnessScript,
- MissingHDKeypath,
-}</pre></div><div class='docblock'><p>Signing error</p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<div id="variant.MissingKey" class="variant small-section-header"><a href="#variant.MissingKey" class="anchor field"></a><code>MissingKey</code></div><div class='docblock'><p>The private key is missing for the required public key</p>
-</div><div id="variant.UserCanceled" class="variant small-section-header"><a href="#variant.UserCanceled" class="anchor field"></a><code>UserCanceled</code></div><div class='docblock'><p>The user canceled the operation</p>
-</div><div id="variant.MissingSighash" class="variant small-section-header"><a href="#variant.MissingSighash" class="anchor field"></a><code>MissingSighash</code></div><div class='docblock'><p>The sighash is missing in the PSBT input</p>
-</div><div id="variant.InputIndexOutOfRange" class="variant small-section-header"><a href="#variant.InputIndexOutOfRange" class="anchor field"></a><code>InputIndexOutOfRange</code></div><div class='docblock'><p>Input index is out of range</p>
-</div><div id="variant.MissingNonWitnessUtxo" class="variant small-section-header"><a href="#variant.MissingNonWitnessUtxo" class="anchor field"></a><code>MissingNonWitnessUtxo</code></div><div class='docblock'><p>The <code>non_witness_utxo</code> field of the transaction is required to sign this input</p>
-</div><div id="variant.InvalidNonWitnessUtxo" class="variant small-section-header"><a href="#variant.InvalidNonWitnessUtxo" class="anchor field"></a><code>InvalidNonWitnessUtxo</code></div><div class='docblock'><p>The <code>non_witness_utxo</code> specified is invalid</p>
-</div><div id="variant.MissingWitnessUtxo" class="variant small-section-header"><a href="#variant.MissingWitnessUtxo" class="anchor field"></a><code>MissingWitnessUtxo</code></div><div class='docblock'><p>The <code>witness_utxo</code> field of the transaction is required to sign this input</p>
-</div><div id="variant.MissingWitnessScript" class="variant small-section-header"><a href="#variant.MissingWitnessScript" class="anchor field"></a><code>MissingWitnessScript</code></div><div class='docblock'><p>The <code>witness_script</code> field of the transaction is requied to sign this input</p>
-</div><div id="variant.MissingHDKeypath" class="variant small-section-header"><a href="#variant.MissingHDKeypath" class="anchor field"></a><code>MissingHDKeypath</code></div><div class='docblock'><p>The fingerprint and derivation path are missing from the psbt input</p>
-</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#153-157' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#154-156' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Error' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a></code><a href='#impl-Error' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#159' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.source' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source' class='fnname'>source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><span class='since' title='Stable since Rust version 1.30.0'>1.30.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#100-102' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
-</div><h4 id='method.backtrace' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace' class='fnname'>backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#128-130' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>backtrace</code>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
-</div><h4 id='method.description' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description' class='fnname'>description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#140-142' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
-</div></div><div class='docblock hidden'><p><code>if let Err(e) = "xc".parse::<u32>() { // Print </code>e<code> itself, no need for description(). eprintln!("Error: {}", e); }</code> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></p>
-</div><h4 id='method.cause' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/error.rs.html#150-152' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'><span class='emoji'>👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
-</div></div></div><h3 id='impl-From%3CSignerError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a>> for <a class="enum" href="../../../magical/enum.Error.html" title="enum magical::Error">Error</a></code><a href='#impl-From%3CSignerError%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/error.rs.html#98-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a>) -> Self</code><a class='srclink' href='../../../src/magical/error.rs.html#99-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-PartialEq%3CSignerError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a>> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a></code><a href='#impl-PartialEq%3CSignerError%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#131' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> 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></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2237-2247' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2239-2246' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `SignerId` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, SignerId"><title>magical::wallet::signer::SignerId - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum SignerId</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Fingerprint">Fingerprint</a><a href="#variant.PkHash">PkHash</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Eq">Eq</a><a href="#impl-From%3CFingerprint%3E">From<Fingerprint></a><a href="#impl-From%3CHash%3E">From<Hash></a><a href="#impl-Hash">Hash</a><a href="#impl-PartialEq%3CSignerId%3CPk%3E%3E">PartialEq<SignerId<Pk>></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a></p><script>window.sidebarCurrent = {name: 'SignerId', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#113-116' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a>::<wbr><a class="enum" href=''>SignerId</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum SignerId<Pk: <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>> {
- PkHash(<Pk as <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>),
- Fingerprint(Fingerprint),
-}</pre></div><div class='docblock'><p>Identifier of a signer in the <code>SignersContainers</code>. Used as a key to find the right signer among
-multiple of them</p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<div id="variant.PkHash" class="variant small-section-header"><a href="#variant.PkHash" class="anchor field"></a><code>PkHash(<Pk as <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>)</code></div><div id="variant.Fingerprint" class="variant small-section-header"><a href="#variant.Fingerprint" class="anchor field"></a><code>Fingerprint(Fingerprint)</code></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-From%3CFingerprint%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Fingerprint> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><DescriptorPublicKey></code><a href='#impl-From%3CFingerprint%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#124-128' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(fing: Fingerprint) -> <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><DescriptorPublicKey></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#125-127' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CHash%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Hash> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><DescriptorPublicKey></code><a href='#impl-From%3CHash%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#118-122' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(hash: Hash) -> <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><DescriptorPublicKey></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#119-121' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H)</code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
-</div><h4 id='method.hash_slice' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#192-199' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
-</div></div><h3 id='impl-PartialEq%3CSignerId%3CPk%3E%3E' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> + <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk>> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk></code><a href='#impl-PartialEq%3CSignerId%3CPk%3E%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#112' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk> <span class="where fmt-newline">where<br> <Pk as <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>, </span></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk> <span class="where fmt-newline">where<br> <Pk as <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>, </span></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk> <span class="where fmt-newline">where<br> <Pk as <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk> <span class="where fmt-newline">where<br> <Pk as <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk> <span class="where fmt-newline">where<br> <Pk as <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>, </span></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `signer` mod in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, signer"><title>magical::wallet::signer - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module signer</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'signer', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#25-513' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a class="mod" href=''>signer</a></span></h1><div class='docblock'><p>Generalized signers</p>
-<p>This module provides the ability to add customized signers to a <a href="../../../magical/wallet/struct.Wallet.html"><code>Wallet</code></a>
-through the <a href="../../../magical/wallet/struct.Wallet.html#method.add_signer"><code>Wallet::add_signer</code></a> function.</p>
-
-<div class="example-wrap"><pre class="rust rust-example-rendered">
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">struct</span> <span class="ident">CustomSigner</span> {
- <span class="ident">device</span>: <span class="ident">CustomHSM</span>,
-}
-
-<span class="kw">impl</span> <span class="ident">CustomSigner</span> {
- <span class="kw">fn</span> <span class="ident">connect</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">CustomSigner</span> { <span class="ident">device</span>: <span class="ident">CustomHSM</span>::<span class="ident">connect</span>() }
- }
-}
-
-<span class="kw">impl</span> <span class="ident">Signer</span> <span class="kw">for</span> <span class="ident">CustomSigner</span> {
- <span class="kw">fn</span> <span class="ident">sign</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">psbt</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span>,
- <span class="ident">input_index</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">SignerError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">input_index</span> <span class="op">=</span> <span class="ident">input_index</span>.<span class="ident">ok_or</span>(<span class="ident">SignerError</span>::<span class="ident">InputIndexOutOfRange</span>)<span class="question-mark">?</span>;
- <span class="self">self</span>.<span class="ident">device</span>.<span class="ident">sign_input</span>(<span class="ident">psbt</span>, <span class="ident">input_index</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">fn</span> <span class="ident">sign_whole_tx</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="bool-val">false</span>
- }
-}
-
-<span class="kw">let</span> <span class="ident">custom_signer</span> <span class="op">=</span> <span class="ident">CustomSigner</span>::<span class="ident">connect</span>();
-
-<span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="string">"wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)"</span>;
-<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(<span class="ident">descriptor</span>, <span class="prelude-val">None</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>, <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>())<span class="question-mark">?</span>;
-<span class="ident">wallet</span>.<span class="ident">add_signer</span>(
- <span class="ident">ScriptType</span>::<span class="ident">External</span>,
- <span class="ident">Fingerprint</span>::<span class="ident">from_str</span>(<span class="string">"e30f11b8"</span>).<span class="ident">unwrap</span>().<span class="ident">into</span>(),
- <span class="ident">SignerOrdering</span>(<span class="number">200</span>),
- <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">custom_signer</span>))
-);
-</pre></div>
-</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
-<table><tr class='module-item'><td><a class="struct" href="struct.SignerOrdering.html" title='magical::wallet::signer::SignerOrdering struct'>SignerOrdering</a></td><td class='docblock-short'><p>Defines the order in which signers are called</p>
-</td></tr><tr class='module-item'><td><a class="struct" href="struct.SignersContainer.html" title='magical::wallet::signer::SignersContainer struct'>SignersContainer</a></td><td class='docblock-short'><p>Container for multiple signers</p>
-</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
-<table><tr class='module-item'><td><a class="enum" href="enum.SignerError.html" title='magical::wallet::signer::SignerError enum'>SignerError</a></td><td class='docblock-short'><p>Signing error</p>
-</td></tr><tr class='module-item'><td><a class="enum" href="enum.SignerId.html" title='magical::wallet::signer::SignerId enum'>SignerId</a></td><td class='docblock-short'><p>Identifier of a signer in the <code>SignersContainers</code>. Used as a key to find the right signer among
-multiple of them</p>
-</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
-<table><tr class='module-item'><td><a class="trait" href="trait.Signer.html" title='magical::wallet::signer::Signer trait'>Signer</a></td><td class='docblock-short'><p>Trait for signers</p>
-</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"enum":[["SignerError","Signing error"],["SignerId","Identifier of a signer in the `SignersContainers`. Used as a key to find the right signer among multiple of them"]],"struct":[["SignerOrdering","Defines the order in which signers are called"],["SignersContainer","Container for multiple signers"]],"trait":[["Signer","Trait for signers"]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `SignerOrdering` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, SignerOrdering"><title>magical::wallet::signer::SignerOrdering - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct SignerOrdering</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Eq">Eq</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CSignerOrdering%3E">PartialEq<SignerOrdering></a><a href="#impl-PartialOrd%3CSignerOrdering%3E">PartialOrd<SignerOrdering></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a></p><script>window.sidebarCurrent = {name: 'SignerOrdering', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#285' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a>::<wbr><a class="struct" href=''>SignerOrdering</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct SignerOrdering(pub <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>);</pre></div><div class='docblock'><p>Defines the order in which signers are called</p>
-<p>The default value is <code>100</code>. Signers with an ordering above that will be called later,
-and they will thus see the partial signatures added to the transaction once they get to sign
-themselves.</p>
-</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#287-291' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> Self</code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#288-290' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
-</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-Ord' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
-</div><h4 id='method.max' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#599-604' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
-</div><h4 id='method.min' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#619-624' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
-</div><h4 id='method.clamp' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#646-658' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
-</div></div><h3 id='impl-PartialEq%3CSignerOrdering%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a>> for <a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-PartialEq%3CSignerOrdering%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-PartialOrd%3CSignerOrdering%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a>> for <a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-PartialOrd%3CSignerOrdering%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
-</div><h4 id='method.lt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: &<a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
-</div><h4 id='method.le' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: &<a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
-</div><h4 id='method.gt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: &<a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
-</div><h4 id='method.ge' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: &<a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
-</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#284' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `SignersContainer` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, SignersContainer"><title>magical::wallet::signer::SignersContainer - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct SignersContainer</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.add_external">add_external</a><a href="#method.as_key_map">as_key_map</a><a href="#method.find">find</a><a href="#method.ids">ids</a><a href="#method.new">new</a><a href="#method.remove">remove</a><a href="#method.signers">signers</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-From%3CHashMap%3CDescriptorPublicKey%2C%20DescriptorSecretKey%2C%20RandomState%3E%3E">From<HashMap<DescriptorPublicKey, DescriptorSecretKey, RandomState>></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a></p><script>window.sidebarCurrent = {name: 'SignersContainer', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#310-312' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a>::<wbr><a class="struct" href=''>SignersContainer</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct SignersContainer<Pk: <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>(_);</pre></div><div class='docblock'><p>Container for multiple signers</p>
-</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#314-322' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.as_key_map' class="method"><code>pub fn <a href='#method.as_key_map' class='fnname'>as_key_map</a>(&self) -> KeyMap</code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#315-321' title='goto source code'>[src]</a></h4></div><h3 id='impl-1' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="struct" href="../../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#351-400' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code>pub fn <a href='#method.new' class='fnname'>new</a>() -> Self</code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#353-355' title='goto source code'>[src]</a></h4><div class='docblock'><p>Default constructor</p>
-</div><h4 id='method.add_external' class="method"><code>pub fn <a href='#method.add_external' class='fnname'>add_external</a>(<br> &mut self, <br> id: <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk>, <br> ordering: <a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a>, <br> signer: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../../magical/wallet/signer/trait.Signer.html" title="trait magical::wallet::signer::Signer">Signer</a>>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../../magical/wallet/signer/trait.Signer.html" title="trait magical::wallet::signer::Signer">Signer</a>>>></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#359-366' title='goto source code'>[src]</a></h4><div class='docblock'><p>Adds an external signer to the container for the specified id. Optionally returns the
-signer that was previosuly in the container, if any</p>
-</div><h4 id='method.remove' class="method"><code>pub fn <a href='#method.remove' class='fnname'>remove</a>(<br> &mut self, <br> id: <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk>, <br> ordering: <a class="struct" href="../../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../../magical/wallet/signer/trait.Signer.html" title="trait magical::wallet::signer::Signer">Signer</a>>>></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#369-375' title='goto source code'>[src]</a></h4><div class='docblock'><p>Removes a signer from the container and returns it</p>
-</div><h4 id='method.ids' class="method"><code>pub fn <a href='#method.ids' class='fnname'>ids</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><&<a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk>></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#378-383' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the list of identifiers of all the signers in the container</p>
-</div><h4 id='method.signers' class="method"><code>pub fn <a href='#method.signers' class='fnname'>signers</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../../magical/wallet/signer/trait.Signer.html" title="trait magical::wallet::signer::Signer">Signer</a>>>></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#386-388' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the list of signers in the container, sorted by lowest to highest <code>ordering</code></p>
-</div><h4 id='method.find' class="method"><code>pub fn <a href='#method.find' class='fnname'>find</a>(&self, id: <a class="enum" href="../../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><Pk>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../../magical/wallet/signer/trait.Signer.html" title="trait magical::wallet::signer::Signer">Signer</a>>>></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#391-399' title='goto source code'>[src]</a></h4><div class='docblock'><p>Finds the signer with lowest ordering for a given id in the container.</p>
-</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#309' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#309' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#309' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#309' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl<Pk: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#309' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#309' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
-</div></div><h3 id='impl-From%3CHashMap%3CDescriptorPublicKey%2C%20DescriptorSecretKey%2C%20RandomState%3E%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><DescriptorPublicKey, DescriptorSecretKey, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.RandomState.html" title="struct std::collections::hash::map::RandomState">RandomState</a>>> for <a class="struct" href="../../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey></code><a href='#impl-From%3CHashMap%3CDescriptorPublicKey%2C%20DescriptorSecretKey%2C%20RandomState%3E%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#324-349' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(keymap: KeyMap) -> <a class="struct" href="../../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><DescriptorPublicKey></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#325-348' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<Pk> !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl<Pk> !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<Pk> !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl<Pk> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><Pk> <span class="where fmt-newline">where<br> <Pk as <a class="trait" href="../../../magical/descriptor/trait.MiniscriptKey.html" title="trait magical::descriptor::MiniscriptKey">MiniscriptKey</a>>::<a class="type" href="../../../magical/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" title="type magical::descriptor::MiniscriptKey::Hash">Hash</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl<Pk> !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../magical/wallet/signer/struct.SignersContainer.html" title="struct magical::wallet::signer::SignersContainer">SignersContainer</a><Pk></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Signer` trait in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Signer"><title>magical::wallet::signer::Signer - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait Signer</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.sign">sign</a><a href="#tymethod.sign_whole_tx">sign_whole_tx</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.descriptor_secret_key">descriptor_secret_key</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-Signer-for-DescriptorXKey%3CExtendedPrivKey%3E">DescriptorXKey<ExtendedPrivKey></a><a href="#impl-Signer-for-PrivateKey">PrivateKey</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a></p><script>window.sidebarCurrent = {name: 'Signer', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#165-189' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>signer</a>::<wbr><a class="trait" href=''>Signer</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait Signer: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> {
- fn <a href='#tymethod.sign' class='fnname'>sign</a>(<br> &self, <br> psbt: &mut PartiallySignedTransaction, <br> input_index: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>><br> ) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a>>;
-<div class='item-spacer'></div> fn <a href='#tymethod.sign_whole_tx' class='fnname'>sign_whole_tx</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>;
-
- fn <a href='#method.descriptor_secret_key' class='fnname'>descriptor_secret_key</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><DescriptorSecretKey> { ... }
-}</pre></div><div class='docblock'><p>Trait for signers</p>
-<p>This trait can be implemented to provide customized signers to the wallet. For an example see
-<a href="../../../magical/wallet/signer/index.html"><code>this module</code></a>'s documentation.</p>
-</div>
- <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.sign' class='method'><code>fn <a href='#tymethod.sign' class='fnname'>sign</a>(<br> &self, <br> psbt: &mut PartiallySignedTransaction, <br> input_index: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a>></code></h3><div class='docblock'><p>Sign a PSBT</p>
-<p>The <code>input_index</code> argument is only provided if the wallet doesn't declare to sign the whole
-transaction in one go (see <a href="../../../magical/wallet/signer/trait.Signer.html#tymethod.sign_whole_tx" title="`Signer::sign_whole_tx`"><code>Signer::sign_whole_tx</code></a>). Otherwise its value is <code>None</code> and
-can be ignored.</p>
-</div><h3 id='tymethod.sign_whole_tx' class='method'><code>fn <a href='#tymethod.sign_whole_tx' class='fnname'>sign_whole_tx</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h3><div class='docblock'><p>Return whether or not the signer signs the whole transaction in one go instead of every
-input individually</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='provided-methods' class='small-section-header'>Provided methods<a href='#provided-methods' class='anchor'></a></h2><div class='methods'><h3 id='method.descriptor_secret_key' class='method'><code>fn <a href='#method.descriptor_secret_key' class='fnname'>descriptor_secret_key</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><DescriptorSecretKey></code></h3><div class='docblock'><p>Return the secret key for the signer</p>
-<p>This is used internally to reconstruct the original descriptor that may contain secrets.
-External signers that are meant to keep key isolated should just return <code>None</code> here (which
-is the default for this method, if not overridden).</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-Signer-for-DescriptorXKey%3CExtendedPrivKey%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../../../magical/wallet/signer/trait.Signer.html" title="trait magical::wallet::signer::Signer">Signer</a> for DescriptorXKey<ExtendedPrivKey></code><a href='#impl-Signer-for-DescriptorXKey%3CExtendedPrivKey%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#191-225' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.sign' class="method hidden"><code>fn <a href='#method.sign' class='fnname'>sign</a>(<br> &self, <br> psbt: &mut PartiallySignedTransaction, <br> input_index: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a>></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#192-216' title='goto source code'>[src]</a></h4><h4 id='method.sign_whole_tx' class="method hidden"><code>fn <a href='#method.sign_whole_tx' class='fnname'>sign_whole_tx</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#218-220' title='goto source code'>[src]</a></h4><h4 id='method.descriptor_secret_key-1' class="method hidden"><code>fn <a href='#method.descriptor_secret_key' class='fnname'>descriptor_secret_key</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><DescriptorSecretKey></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#222-224' title='goto source code'>[src]</a></h4></div><h3 id='impl-Signer-for-PrivateKey' class='impl'><code class='in-band'>impl <a class="trait" href="../../../magical/wallet/signer/trait.Signer.html" title="trait magical::wallet::signer::Signer">Signer</a> for PrivateKey</code><a href='#impl-Signer-for-PrivateKey' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#227-277' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.sign-1' class="method hidden"><code>fn <a href='#method.sign' class='fnname'>sign</a>(<br> &self, <br> psbt: &mut PartiallySignedTransaction, <br> input_index: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../../magical/wallet/signer/enum.SignerError.html" title="enum magical::wallet::signer::SignerError">SignerError</a>></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#228-268' title='goto source code'>[src]</a></h4><h4 id='method.sign_whole_tx-1' class="method hidden"><code>fn <a href='#method.sign_whole_tx' class='fnname'>sign_whole_tx</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#270-272' title='goto source code'>[src]</a></h4><h4 id='method.descriptor_secret_key-2' class="method hidden"><code>fn <a href='#method.descriptor_secret_key' class='fnname'>descriptor_secret_key</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><DescriptorSecretKey></code><a class='srclink' href='../../../src/magical/wallet/signer.rs.html#274-276' title='goto source code'>[src]</a></h4></div><span class='loading-content'>Loading content...</span>
- <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../../implementors/magical/wallet/signer/trait.Signer.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Wallet` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, Wallet"><title>magical::wallet::Wallet - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Wallet</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.add_address_validator">add_address_validator</a><a href="#method.add_signer">add_signer</a><a href="#method.broadcast">broadcast</a><a href="#method.bump_fee">bump_fee</a><a href="#method.client">client</a><a href="#method.create_tx">create_tx</a><a href="#method.finalize_psbt">finalize_psbt</a><a href="#method.get_balance">get_balance</a><a href="#method.get_new_address">get_new_address</a><a href="#method.is_mine">is_mine</a><a href="#method.list_transactions">list_transactions</a><a href="#method.list_unspent">list_unspent</a><a href="#method.new">new</a><a href="#method.new_offline">new_offline</a><a href="#method.policies">policies</a><a href="#method.public_descriptor">public_descriptor</a><a href="#method.sign">sign</a><a href="#method.sync">sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'Wallet', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/wallet/mod.rs.html#85-100' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>magical</a>::<wbr><a href='index.html'>wallet</a>::<wbr><a class="struct" href=''>Wallet</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Wallet<B: <a class="trait" href="../../magical/blockchain/trait.Blockchain.html" title="trait magical::blockchain::Blockchain">Blockchain</a>, D: <a class="trait" href="../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>> { /* fields omitted */ }</pre></div><div class='docblock'><p>A Bitcoin wallet</p>
-<p>A wallet takes descriptors, a <a href="../../magical/database/index.html"><code>database</code></a> and a
-<a href="../../magical/blockchain/index.html"><code>blockchain</code></a> and implements the basic functions that a Bitcoin wallets
-needs to operate, like <a href="../../magical/wallet/struct.Wallet.html#method.get_new_address">generating addresses</a>, <a href="../../magical/wallet/struct.Wallet.html#method.get_balance">returning the balance</a>,
-<a href="../../magical/wallet/struct.Wallet.html#method.create_tx">creating transactions</a>, etc.</p>
-<p>A wallet can be either "online" if the <a href="../../magical/blockchain/index.html"><code>blockchain</code></a> type provided
-implements <a href="../../magical/blockchain/trait.OnlineBlockchain.html" title="`OnlineBlockchain`"><code>OnlineBlockchain</code></a>, or "offline" if it doesn't. Offline wallets only expose
-methods that don't need any interaction with the blockchain to work.</p>
-</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<B, D> <a class="struct" href="../../magical/wallet/struct.Wallet.html" title="struct magical::wallet::Wallet">Wallet</a><B, D> <span class="where fmt-newline">where<br> B: <a class="trait" href="../../magical/blockchain/trait.Blockchain.html" title="trait magical::blockchain::Blockchain">Blockchain</a>,<br> D: <a class="trait" href="../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>, </span></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/magical/wallet/mod.rs.html#103-1075' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new_offline' class="method"><code>pub fn <a href='#method.new_offline' class='fnname'>new_offline</a>(<br> descriptor: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> change_descriptor: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>, <br> network: Network, <br> database: D<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#109-153' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new "offline" wallet</p>
-</div><h4 id='method.get_new_address' class="method"><code>pub fn <a href='#method.get_new_address' class='fnname'>get_new_address</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Address, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#156-163' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return a newly generated address using the external descriptor</p>
-</div><h4 id='method.is_mine' class="method"><code>pub fn <a href='#method.is_mine' class='fnname'>is_mine</a>(&self, script: &Script) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#166-168' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return whether or not a <code>script</code> is part of this wallet (either internal or external)</p>
-</div><h4 id='method.list_unspent' class="method"><code>pub fn <a href='#method.list_unspent' class='fnname'>list_unspent</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../magical/struct.UTXO.html" title="struct magical::UTXO">UTXO</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#174-176' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the list of unspent outputs of this wallet</p>
-<p>Note that this methods only operate on the internal database, which first needs to be
-<a href="../../magical/wallet/struct.Wallet.html#method.sync" title="`Wallet::sync`"><code>Wallet::sync</code></a> manually.</p>
-</div><h4 id='method.list_transactions' class="method"><code>pub fn <a href='#method.list_transactions' class='fnname'>list_transactions</a>(<br> &self, <br> include_raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#185-187' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the list of transactions made and received by the wallet</p>
-<p>Optionally fill the <a href="../../magical/struct.TransactionDetails.html#structfield.transaction" title="`TransactionDetails::transaction`"><code>TransactionDetails::transaction</code></a> field with the raw transaction if
-<code>include_raw</code> is <code>true</code>.</p>
-<p>Note that this methods only operate on the internal database, which first needs to be
-<a href="../../magical/wallet/struct.Wallet.html#method.sync" title="`Wallet::sync`"><code>Wallet::sync</code></a> manually.</p>
-</div><h4 id='method.get_balance' class="method"><code>pub fn <a href='#method.get_balance' class='fnname'>get_balance</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#193-198' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the balance, meaning the sum of this wallet's unspent outputs' values</p>
-<p>Note that this methods only operate on the internal database, which first needs to be
-<a href="../../magical/wallet/struct.Wallet.html#method.sync" title="`Wallet::sync`"><code>Wallet::sync</code></a> manually.</p>
-</div><h4 id='method.add_signer' class="method"><code>pub fn <a href='#method.add_signer' class='fnname'>add_signer</a>(<br> &mut self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>, <br> id: <a class="enum" href="../../magical/wallet/signer/enum.SignerId.html" title="enum magical::wallet::signer::SignerId">SignerId</a><DescriptorPublicKey>, <br> ordering: <a class="struct" href="../../magical/wallet/signer/struct.SignerOrdering.html" title="struct magical::wallet::signer::SignerOrdering">SignerOrdering</a>, <br> signer: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../magical/wallet/signer/trait.Signer.html" title="trait magical::wallet::signer::Signer">Signer</a>>><br>)</code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#203-216' title='goto source code'>[src]</a></h4><div class='docblock'><p>Add an external signer</p>
-<p>See <a href="../../magical/wallet/signer/index.html">the <code>signer</code> module</a> for an example.</p>
-</div><h4 id='method.add_address_validator' class="method"><code>pub fn <a href='#method.add_address_validator' class='fnname'>add_address_validator</a>(<br> &mut self, <br> validator: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../magical/wallet/address_validator/trait.AddressValidator.html" title="trait magical::wallet::address_validator::AddressValidator">AddressValidator</a>>><br>)</code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock'><p>Add an address validator</p>
-<p>See <a href="../../magical/wallet/address_validator/index.html">the <code>address_validator</code> module</a> for an example.</p>
-</div><h4 id='method.create_tx' class="method"><code>pub fn <a href='#method.create_tx' class='fnname'>create_tx</a><Cs: <a class="trait" href="../../magical/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait magical::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a>>(<br> &self, <br> builder: <a class="struct" href="../../magical/wallet/tx_builder/struct.TxBuilder.html" title="struct magical::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>PSBT, <a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#243-441' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new transaction following the options specified in the <code>builder</code></p>
-<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
-<div class="example-wrap"><pre class="rust rust-example-rendered">
-<span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">to_address</span>.<span class="ident">script_pubkey</span>(), <span class="number">50_000</span>)])
-)<span class="question-mark">?</span>;
-<span class="comment">// sign and broadcast ...</span></pre></div>
-</div><h4 id='method.bump_fee' class="method"><code>pub fn <a href='#method.bump_fee' class='fnname'>bump_fee</a><Cs: <a class="trait" href="../../magical/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait magical::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a>>(<br> &self, <br> txid: &Txid, <br> builder: <a class="struct" href="../../magical/wallet/tx_builder/struct.TxBuilder.html" title="struct magical::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>PSBT, <a class="struct" href="../../magical/struct.TransactionDetails.html" title="struct magical::TransactionDetails">TransactionDetails</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#471-684' title='goto source code'>[src]</a></h4><div class='docblock'><p>Bump the fee of a transaction following the options specified in the <code>builder</code></p>
-<p>Return an error if the transaction is already confirmed or doesn't explicitly signal RBF.</p>
-<p><strong>NOTE</strong>: if the original transaction was made with <a href="../../magical/wallet/tx_builder/struct.TxBuilder.html#method.send_all" title="`TxBuilder::send_all`"><code>TxBuilder::send_all</code></a>, the same
-option must be enabled when bumping its fees to correctly reduce the only output's value to
-increase the fees.</p>
-<h2 id="example-1" class="section-header"><a href="#example-1">Example</a></h2>
-<div class="example-wrap"><pre class="rust rust-example-rendered">
-<span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">Txid</span>::<span class="ident">from_str</span>(<span class="string">"faff0a466b70f5d5f92bd757a92c1371d4838bdd5bc53a06764e2488e51ce8f8"</span>).<span class="ident">unwrap</span>();
-<span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">bump_fee</span>(
- <span class="kw-2">&</span><span class="ident">txid</span>,
- <span class="ident">TxBuilder</span>::<span class="ident">new</span>().<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">5.0</span>)),
-)<span class="question-mark">?</span>;
-<span class="comment">// sign and broadcast ...</span></pre></div>
-</div><h4 id='method.sign' class="method"><code>pub fn <a href='#method.sign' class='fnname'>sign</a>(<br> &self, <br> psbt: PSBT, <br> assume_height: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>PSBT, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#701-722' title='goto source code'>[src]</a></h4><div class='docblock'><p>Sign a transaction with all the wallet's signers, in the order specified by every signer's
-<a href="../../magical/wallet/signer/struct.SignerOrdering.html" title="`SignerOrdering`"><code>SignerOrdering</code></a></p>
-<h2 id="example-2" class="section-header"><a href="#example-2">Example</a></h2>
-<div class="example-wrap"><pre class="rust rust-example-rendered">
-<span class="kw">let</span> (<span class="ident">signed_psbt</span>, <span class="ident">finalized</span>) <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">sign</span>(<span class="ident">psbt</span>, <span class="prelude-val">None</span>)<span class="question-mark">?</span>;</pre></div>
-</div><h4 id='method.policies' class="method"><code>pub fn <a href='#method.policies' class='fnname'>policies</a>(&self, script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../magical/descriptor/policy/struct.Policy.html" title="struct magical::descriptor::policy::Policy">Policy</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#725-735' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the spending policies for the wallet's descriptor</p>
-</div><h4 id='method.public_descriptor' class="method"><code>pub fn <a href='#method.public_descriptor' class='fnname'>public_descriptor</a>(<br> &self, <br> script_type: <a class="enum" href="../../magical/enum.ScriptType.html" title="enum magical::ScriptType">ScriptType</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="type" href="../../magical/descriptor/type.ExtendedDescriptor.html" title="type magical::descriptor::ExtendedDescriptor">ExtendedDescriptor</a>>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#741-750' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the "public" version of the wallet's descriptor, meaning a new descriptor that has
-the same structure but with every secret key removed</p>
-<p>This can be used to build a watch-only version of a wallet</p>
-</div><h4 id='method.finalize_psbt' class="method"><code>pub fn <a href='#method.finalize_psbt' class='fnname'>finalize_psbt</a>(<br> &self, <br> psbt: PSBT, <br> assume_height: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>PSBT, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#753-827' title='goto source code'>[src]</a></h4><div class='docblock'><p>Try to finalize a PSBT</p>
-</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl<B, D> <a class="struct" href="../../magical/wallet/struct.Wallet.html" title="struct magical::wallet::Wallet">Wallet</a><B, D> <span class="where fmt-newline">where<br> B: <a class="trait" href="../../magical/blockchain/trait.OnlineBlockchain.html" title="trait magical::blockchain::OnlineBlockchain">OnlineBlockchain</a>,<br> D: <a class="trait" href="../../magical/database/trait.BatchDatabase.html" title="trait magical::database::BatchDatabase">BatchDatabase</a>, </span></code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../../src/magical/wallet/mod.rs.html#1077-1173' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code>pub fn <a href='#method.new' class='fnname'>new</a>(<br> descriptor: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> change_descriptor: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>, <br> network: Network, <br> database: D, <br> client: B<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#1084-1097' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new "online" wallet</p>
-</div><h4 id='method.sync' class="method"><code>pub fn <a href='#method.sync' class='fnname'>sync</a><P: 'static + <a class="trait" href="../../magical/blockchain/trait.Progress.html" title="trait magical::blockchain::Progress">Progress</a>>(<br> &self, <br> progress_update: P, <br> max_address_param: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#1101-1159' title='goto source code'>[src]</a></h4><div class='docblock'><p>Sync the internal database with the blockchain</p>
-</div><h4 id='method.client' class="method"><code>pub fn <a href='#method.client' class='fnname'>client</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>B</code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#1162-1164' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return a reference to the internal blockchain client</p>
-</div><h4 id='method.broadcast' class="method"><code>pub fn <a href='#method.broadcast' class='fnname'>broadcast</a>(&self, tx: Transaction) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Txid, <a class="enum" href="../../magical/enum.Error.html" title="enum magical::Error">Error</a>></code><a class='srclink' href='../../src/magical/wallet/mod.rs.html#1168-1172' title='goto source code'>[src]</a></h4><div class='docblock'><p>Broadcast a transaction to the network</p>
-</div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<B, D> !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../magical/wallet/struct.Wallet.html" title="struct magical::wallet::Wallet">Wallet</a><B, D></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl<B, D> !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../magical/wallet/struct.Wallet.html" title="struct magical::wallet::Wallet">Wallet</a><B, D></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<B, D> !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../magical/wallet/struct.Wallet.html" title="struct magical::wallet::Wallet">Wallet</a><B, D></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl<B, D> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../magical/wallet/struct.Wallet.html" title="struct magical::wallet::Wallet">Wallet</a><B, D> <span class="where fmt-newline">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br> D: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl<B, D> !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../magical/wallet/struct.Wallet.html" title="struct magical::wallet::Wallet">Wallet</a><B, D></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `get_timestamp` fn in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, get_timestamp"><title>magical::wallet::time::get_timestamp - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>time</a></p><script>window.sidebarCurrent = {name: 'get_timestamp', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/time.rs.html#42-47' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>time</a>::<wbr><a class="fn" href=''>get_timestamp</a></span></h1><pre class='rust fn'>pub fn get_timestamp() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></pre><div class='docblock'><p>Return the current timestamp in seconds</p>
-</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `time` mod in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, time"><title>magical::wallet::time - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module time</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'time', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/time.rs.html#25-86' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a class="mod" href=''>time</a></span></h1><div class='docblock'><p>Cross-platform time</p>
-<p>This module provides a function to get the current timestamp that works on all the platforms
-supported by the library.</p>
-<p>It can be useful to compare it with the timestamps found in
-<a href="../../../magical/struct.TransactionDetails.html"><code>TransactionDetails</code></a>.</p>
-</div><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
-<table><tr class='module-item'><td><a class="fn" href="fn.get_timestamp.html" title='magical::wallet::time::get_timestamp fn'>get_timestamp</a></td><td class='docblock-short'><p>Return the current timestamp in seconds</p>
-</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"fn":[["get_timestamp","Return the current timestamp in seconds"]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `IsDust` trait in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, IsDust"><title>magical::wallet::IsDust - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait IsDust</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.is_dust">is_dust</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-IsDust-for-u64">u64</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'IsDust', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/wallet/utils.rs.html#34-37' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>magical</a>::<wbr><a href='index.html'>wallet</a>::<wbr><a class="trait" href=''>IsDust</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait IsDust {
- fn <a href='#tymethod.is_dust' class='fnname'>is_dust</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>;
-}</pre></div><div class='docblock'><p>Trait to check if a value is below the dust limit</p>
-</div>
- <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.is_dust' class='method'><code>fn <a href='#tymethod.is_dust' class='fnname'>is_dust</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h3><div class='docblock'><p>Check whether or not a value is below dust limit</p>
-</div></div><span class='loading-content'>Loading content...</span>
- <h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-IsDust-for-u64' class='impl'><code class='in-band'>impl <a class="trait" href="../../magical/wallet/trait.IsDust.html" title="trait magical::wallet::IsDust">IsDust</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></code><a href='#impl-IsDust-for-u64' class='anchor'></a><a class='srclink' href='../../src/magical/wallet/utils.rs.html#39-43' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.is_dust' class="method hidden"><code>fn <a href='#method.is_dust' class='fnname'>is_dust</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/magical/wallet/utils.rs.html#40-42' title='goto source code'>[src]</a></h4></div><span class='loading-content'>Loading content...</span>
- <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/magical/wallet/trait.IsDust.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ChangeSpendPolicy` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, ChangeSpendPolicy"><title>magical::wallet::tx_builder::ChangeSpendPolicy - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum ChangeSpendPolicy</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.ChangeAllowed">ChangeAllowed</a><a href="#variant.ChangeForbidden">ChangeForbidden</a><a href="#variant.OnlyChange">OnlyChange</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Eq">Eq</a><a href="#impl-Hash">Hash</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CChangeSpendPolicy%3E">PartialEq<ChangeSpendPolicy></a><a href="#impl-PartialOrd%3CChangeSpendPolicy%3E">PartialOrd<ChangeSpendPolicy></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>tx_builder</a></p><script>window.sidebarCurrent = {name: 'ChangeSpendPolicy', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#329-336' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>tx_builder</a>::<wbr><a class="enum" href=''>ChangeSpendPolicy</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum ChangeSpendPolicy {
- ChangeAllowed,
- OnlyChange,
- ChangeForbidden,
-}</pre></div><div class='docblock'><p>Policy regarding the use of change outputs when creating a transaction</p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<div id="variant.ChangeAllowed" class="variant small-section-header"><a href="#variant.ChangeAllowed" class="anchor field"></a><code>ChangeAllowed</code></div><div class='docblock'><p>Use both change and non-change outputs (default)</p>
-</div><div id="variant.OnlyChange" class="variant small-section-header"><a href="#variant.OnlyChange" class="anchor field"></a><code>OnlyChange</code></div><div class='docblock'><p>Only use change outputs (see <a href="../../../magical/wallet/tx_builder/struct.TxBuilder.html#method.only_spend_change" title="`TxBuilder::only_spend_change`"><code>TxBuilder::only_spend_change</code></a>)</p>
-</div><div id="variant.ChangeForbidden" class="variant small-section-header"><a href="#variant.ChangeForbidden" class="anchor field"></a><code>ChangeForbidden</code></div><div class='docblock'><p>Only use non-change outputs (see <a href="../../../magical/wallet/tx_builder/struct.TxBuilder.html#method.do_not_spend_change" title="`TxBuilder::do_not_spend_change`"><code>TxBuilder::do_not_spend_change</code></a>)</p>
-</div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#338-342' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#339-341' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
-</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H)</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
-</div><h4 id='method.hash_slice' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#192-199' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
-</div></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Ord' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
-</div><h4 id='method.max' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#599-604' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
-</div><h4 id='method.min' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#619-624' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
-</div><h4 id='method.clamp' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#646-658' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
-</div></div><h3 id='impl-PartialEq%3CChangeSpendPolicy%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a>> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-PartialEq%3CChangeSpendPolicy%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-PartialOrd%3CChangeSpendPolicy%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a>> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-PartialOrd%3CChangeSpendPolicy%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
-</div><h4 id='method.lt' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#841-843' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
-</div><h4 id='method.le' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#860-862' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
-</div><h4 id='method.gt' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#878-880' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
-</div><h4 id='method.ge' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#897-899' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
-</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#328' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `TxOrdering` enum in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, TxOrdering"><title>magical::wallet::tx_builder::TxOrdering - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum TxOrdering</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.BIP69Lexicographic">BIP69Lexicographic</a><a href="#variant.Shuffle">Shuffle</a><a href="#variant.Untouched">Untouched</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.sort_tx">sort_tx</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Eq">Eq</a><a href="#impl-Hash">Hash</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CTxOrdering%3E">PartialEq<TxOrdering></a><a href="#impl-PartialOrd%3CTxOrdering%3E">PartialOrd<TxOrdering></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>tx_builder</a></p><script>window.sidebarCurrent = {name: 'TxOrdering', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#273-280' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>tx_builder</a>::<wbr><a class="enum" href=''>TxOrdering</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum TxOrdering {
- Shuffle,
- Untouched,
- BIP69Lexicographic,
-}</pre></div><div class='docblock'><p>Ordering of the transaction's inputs and outputs</p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<div id="variant.Shuffle" class="variant small-section-header"><a href="#variant.Shuffle" class="anchor field"></a><code>Shuffle</code></div><div class='docblock'><p>Randomized (default)</p>
-</div><div id="variant.Untouched" class="variant small-section-header"><a href="#variant.Untouched" class="anchor field"></a><code>Untouched</code></div><div class='docblock'><p>Unchanged</p>
-</div><div id="variant.BIP69Lexicographic" class="variant small-section-header"><a href="#variant.BIP69Lexicographic" class="anchor field"></a><code>BIP69Lexicographic</code></div><div class='docblock'><p>BIP69 / Lexicographic</p>
-</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#288-313' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.sort_tx' class="method"><code>pub fn <a href='#method.sort_tx' class='fnname'>sort_tx</a>(&self, tx: &mut Transaction)</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#289-312' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#282-286' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#283-285' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
-</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H)</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
-</div><h4 id='method.hash_slice' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#192-199' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
-</div></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Ord' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: &<a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an [<code>Ordering</code>] between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
-</div><h4 id='method.max' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#599-604' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
-</div><h4 id='method.min' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code><span class='since' title='Stable since Rust version 1.21.0'>1.21.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#619-624' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
-</div><h4 id='method.clamp' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -> Self</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#646-658' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
-</div></div><h3 id='impl-PartialEq%3CTxOrdering%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a>> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-PartialEq%3CTxOrdering%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-PartialOrd%3CTxOrdering%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a>> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-PartialOrd%3CTxOrdering%3E' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
-</div><h4 id='method.lt' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#841-843' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
-</div><h4 id='method.le' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#860-862' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
-</div><h4 id='method.gt' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#878-880' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
-</div><h4 id='method.ge' class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#897-899' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
-</div></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#272' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#18-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
-</div><h4 id='method.to_owned' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
-</div><h4 id='method.clone_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
-</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `tx_builder` mod in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, tx_builder"><title>magical::wallet::tx_builder - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module tx_builder</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'tx_builder', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#25-488' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a class="mod" href=''>tx_builder</a></span></h1><div class='docblock'><p>Transaction builder</p>
-<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
-<div class="example-wrap"><pre class="rust rust-example-rendered">
-<span class="comment">// Create a transaction with one output to `to_address` of 50_000 satoshi, with a custom fee rate</span>
-<span class="comment">// of 5.0 satoshi/vbyte, only spending non-change outputs and with RBF signaling</span>
-<span class="comment">// enabled</span>
-<span class="kw">let</span> <span class="ident">builder</span> <span class="op">=</span> <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">to_address</span>.<span class="ident">script_pubkey</span>(), <span class="number">50_000</span>)])
- .<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">5.0</span>))
- .<span class="ident">do_not_spend_change</span>()
- .<span class="ident">enable_rbf</span>();</pre></div>
-</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
-<table><tr class='module-item'><td><a class="struct" href="struct.TxBuilder.html" title='magical::wallet::tx_builder::TxBuilder struct'>TxBuilder</a></td><td class='docblock-short'><p>A transaction builder</p>
-</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
-<table><tr class='module-item'><td><a class="enum" href="enum.ChangeSpendPolicy.html" title='magical::wallet::tx_builder::ChangeSpendPolicy enum'>ChangeSpendPolicy</a></td><td class='docblock-short'><p>Policy regarding the use of change outputs when creating a transaction</p>
-</td></tr><tr class='module-item'><td><a class="enum" href="enum.TxOrdering.html" title='magical::wallet::tx_builder::TxOrdering enum'>TxOrdering</a></td><td class='docblock-short'><p>Ordering of the transaction's inputs and outputs</p>
-</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-initSidebarItems({"enum":[["ChangeSpendPolicy","Policy regarding the use of change outputs when creating a transaction"],["TxOrdering","Ordering of the transaction's inputs and outputs"]],"struct":[["TxBuilder","A transaction builder"]]});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `TxBuilder` struct in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, TxBuilder"><title>magical::wallet::tx_builder::TxBuilder - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct TxBuilder</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.add_recipient">add_recipient</a><a href="#method.add_unspendable">add_unspendable</a><a href="#method.add_utxo">add_utxo</a><a href="#method.change_policy">change_policy</a><a href="#method.coin_selection">coin_selection</a><a href="#method.do_not_spend_change">do_not_spend_change</a><a href="#method.enable_rbf">enable_rbf</a><a href="#method.enable_rbf_with_sequence">enable_rbf_with_sequence</a><a href="#method.fee_rate">fee_rate</a><a href="#method.force_non_witness_utxo">force_non_witness_utxo</a><a href="#method.new">new</a><a href="#method.nlocktime">nlocktime</a><a href="#method.only_spend_change">only_spend_change</a><a href="#method.ordering">ordering</a><a href="#method.policy_path">policy_path</a><a href="#method.send_all">send_all</a><a href="#method.set_recipients">set_recipients</a><a href="#method.sighash">sighash</a><a href="#method.unspendable">unspendable</a><a href="#method.utxos">utxos</a><a href="#method.version">version</a><a href="#method.with_recipients">with_recipients</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>tx_builder</a></p><script>window.sidebarCurrent = {name: 'TxBuilder', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#57-72' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>magical</a>::<wbr><a href='../index.html'>wallet</a>::<wbr><a href='index.html'>tx_builder</a>::<wbr><a class="struct" href=''>TxBuilder</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct TxBuilder<Cs: <a class="trait" href="../../../magical/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait magical::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a>> { /* fields omitted */ }</pre></div><div class='docblock'><p>A transaction builder</p>
-<p>This structure contains the configuration that the wallet must follow to build a transaction.</p>
-<p>For an example see <a href="../../../magical/wallet/tx_builder/index.html">this module</a>'s documentation;</p>
-</div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../magical/wallet/tx_builder/struct.TxBuilder.html" title="struct magical::wallet::tx_builder::TxBuilder">TxBuilder</a><<a class="type" href="../../../magical/wallet/coin_selection/type.DefaultCoinSelectionAlgorithm.html" title="type magical::wallet::coin_selection::DefaultCoinSelectionAlgorithm">DefaultCoinSelectionAlgorithm</a>></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#74-84' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code>pub fn <a href='#method.new' class='fnname'>new</a>() -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#76-78' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create an empty builder</p>
-</div><h4 id='method.with_recipients' class="method"><code>pub fn <a href='#method.with_recipients' class='fnname'>with_recipients</a>(recipients: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Script, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#81-83' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a builder starting from a list of recipients</p>
-</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl<Cs: <a class="trait" href="../../../magical/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait magical::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a>> <a class="struct" href="../../../magical/wallet/tx_builder/struct.TxBuilder.html" title="struct magical::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs></code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#86-269' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.set_recipients' class="method"><code>pub fn <a href='#method.set_recipients' class='fnname'>set_recipients</a>(self, recipients: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Script, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#88-91' title='goto source code'>[src]</a></h4><div class='docblock'><p>Replace the recipients already added with a new list</p>
-</div><h4 id='method.add_recipient' class="method"><code>pub fn <a href='#method.add_recipient' class='fnname'>add_recipient</a>(self, script_pubkey: Script, amount: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#94-97' title='goto source code'>[src]</a></h4><div class='docblock'><p>Add a recipient to the internal list</p>
-</div><h4 id='method.send_all' class="method"><code>pub fn <a href='#method.send_all' class='fnname'>send_all</a>(self) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#104-107' title='goto source code'>[src]</a></h4><div class='docblock'><p>Send all the selected utxos to a single output</p>
-<p>Adding more than one recipients with this option enabled will result in an error.</p>
-<p>The value associated with the only recipient is irrelevant and will be replaced by the wallet.</p>
-</div><h4 id='method.fee_rate' class="method"><code>pub fn <a href='#method.fee_rate' class='fnname'>fee_rate</a>(self, fee_rate: <a class="struct" href="../../../magical/struct.FeeRate.html" title="struct magical::FeeRate">FeeRate</a>) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#110-113' title='goto source code'>[src]</a></h4><div class='docblock'><p>Set a custom fee rate</p>
-</div><h4 id='method.policy_path' class="method"><code>pub fn <a href='#method.policy_path' class='fnname'>policy_path</a>(self, policy_path: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/collections/btree/map/struct.BTreeMap.html" title="struct alloc::collections::btree::map::BTreeMap">BTreeMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>>) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#121-124' title='goto source code'>[src]</a></h4><div class='docblock'><p>Set the policy path to use while creating the transaction</p>
-<p>This method accepts a map where the key is the policy node id (see
-<a href="../../../magical/descriptor/policy/struct.Policy.html#structfield.id"><code>Policy::id</code></a>) and the value is the list of the indexes of
-the items that are intended to be satisfied from the policy node (see
-<a href="../../../magical/descriptor/policy/enum.SatisfiableItem.html#variant.Thresh.field.items"><code>SatisfiableItem::Thresh::items</code></a>).</p>
-</div><h4 id='method.utxos' class="method"><code>pub fn <a href='#method.utxos' class='fnname'>utxos</a>(self, utxos: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><OutPoint>) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#130-133' title='goto source code'>[src]</a></h4><div class='docblock'><p>Replace the internal list of utxos that <strong>must</strong> be spent with a new list</p>
-<p>These have priority over the "unspendable" utxos, meaning that if a utxo is present both in
-the "utxos" and the "unspendable" list, it will be spent.</p>
-</div><h4 id='method.add_utxo' class="method"><code>pub fn <a href='#method.add_utxo' class='fnname'>add_utxo</a>(self, utxo: OutPoint) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#139-142' title='goto source code'>[src]</a></h4><div class='docblock'><p>Add a utxo to the internal list of utxos that <strong>must</strong> be spent</p>
-<p>These have priority over the "unspendable" utxos, meaning that if a utxo is present both in
-the "utxos" and the "unspendable" list, it will be spent.</p>
-</div><h4 id='method.unspendable' class="method"><code>pub fn <a href='#method.unspendable' class='fnname'>unspendable</a>(self, unspendable: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><OutPoint>) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#149-152' title='goto source code'>[src]</a></h4><div class='docblock'><p>Replace the internal list of unspendable utxos with a new list</p>
-<p>It's important to note that the "must-be-spent" utxos added with <a href="../../../magical/wallet/tx_builder/struct.TxBuilder.html#method.utxos" title="`TxBuilder::utxos`"><code>TxBuilder::utxos</code></a> and
-<a href="../../../magical/wallet/tx_builder/struct.TxBuilder.html#method.add_utxo" title="`TxBuilder::add_utxo`"><code>TxBuilder::add_utxo</code></a> have priority over these. See the docs of the two linked methods
-for more details.</p>
-</div><h4 id='method.add_unspendable' class="method"><code>pub fn <a href='#method.add_unspendable' class='fnname'>add_unspendable</a>(self, unspendable: OutPoint) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#159-162' title='goto source code'>[src]</a></h4><div class='docblock'><p>Add a utxo to the internal list of unspendable utxos</p>
-<p>It's important to note that the "must-be-spent" utxos added with <a href="../../../magical/wallet/tx_builder/struct.TxBuilder.html#method.utxos" title="`TxBuilder::utxos`"><code>TxBuilder::utxos</code></a> and
-<a href="../../../magical/wallet/tx_builder/struct.TxBuilder.html#method.add_utxo" title="`TxBuilder::add_utxo`"><code>TxBuilder::add_utxo</code></a> have priority over this. See the docs of the two linked methods
-for more details.</p>
-</div><h4 id='method.sighash' class="method"><code>pub fn <a href='#method.sighash' class='fnname'>sighash</a>(self, sighash: SigHashType) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#167-170' title='goto source code'>[src]</a></h4><div class='docblock'><p>Sign with a specific sig hash</p>
-<p><strong>Use this option very carefully</strong></p>
-</div><h4 id='method.ordering' class="method"><code>pub fn <a href='#method.ordering' class='fnname'>ordering</a>(self, ordering: <a class="enum" href="../../../magical/wallet/tx_builder/enum.TxOrdering.html" title="enum magical::wallet::tx_builder::TxOrdering">TxOrdering</a>) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#173-176' title='goto source code'>[src]</a></h4><div class='docblock'><p>Choose the ordering for inputs and outputs of the transaction</p>
-</div><h4 id='method.nlocktime' class="method"><code>pub fn <a href='#method.nlocktime' class='fnname'>nlocktime</a>(self, locktime: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#181-184' title='goto source code'>[src]</a></h4><div class='docblock'><p>Use a specific nLockTime while creating the transaction</p>
-<p>This can cause conflicts if the wallet's descriptors contain an "after" (OP_CLTV) operator.</p>
-</div><h4 id='method.enable_rbf' class="method"><code>pub fn <a href='#method.enable_rbf' class='fnname'>enable_rbf</a>(self) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#189-191' title='goto source code'>[src]</a></h4><div class='docblock'><p>Enable signaling RBF</p>
-<p>This will use the default nSequence value of <code>0xFFFFFFFD</code>.</p>
-</div><h4 id='method.enable_rbf_with_sequence' class="method"><code>pub fn <a href='#method.enable_rbf_with_sequence' class='fnname'>enable_rbf_with_sequence</a>(self, nsequence: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#200-203' title='goto source code'>[src]</a></h4><div class='docblock'><p>Enable signaling RBF with a specific nSequence value</p>
-<p>This can cause conflicts if the wallet's descriptors contain an "older" (OP_CSV) operator
-and the given <code>nsequence</code> is lower than the CSV value.</p>
-<p>If the <code>nsequence</code> is higher than <code>0xFFFFFFFD</code> an error will be thrown, since it would not
-be a valid nSequence to signal RBF.</p>
-</div><h4 id='method.version' class="method"><code>pub fn <a href='#method.version' class='fnname'>version</a>(self, version: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#209-212' title='goto source code'>[src]</a></h4><div class='docblock'><p>Build a transaction with a specific version</p>
-<p>The <code>version</code> should always be greater than <code>0</code> and greater than <code>1</code> if the wallet's
-descriptors contain an "older" (OP_CSV) operator.</p>
-</div><h4 id='method.do_not_spend_change' class="method"><code>pub fn <a href='#method.do_not_spend_change' class='fnname'>do_not_spend_change</a>(self) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#218-221' title='goto source code'>[src]</a></h4><div class='docblock'><p>Do not spend change outputs</p>
-<p>This effectively adds all the change outputs to the "unspendable" list. See
-<a href="../../../magical/wallet/tx_builder/struct.TxBuilder.html#method.unspendable" title="`TxBuilder::unspendable`"><code>TxBuilder::unspendable</code></a>.</p>
-</div><h4 id='method.only_spend_change' class="method"><code>pub fn <a href='#method.only_spend_change' class='fnname'>only_spend_change</a>(self) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#227-230' title='goto source code'>[src]</a></h4><div class='docblock'><p>Only spend change outputs</p>
-<p>This effectively adds all the non-change outputs to the "unspendable" list. See
-<a href="../../../magical/wallet/tx_builder/struct.TxBuilder.html#method.unspendable" title="`TxBuilder::unspendable`"><code>TxBuilder::unspendable</code></a>.</p>
-</div><h4 id='method.change_policy' class="method"><code>pub fn <a href='#method.change_policy' class='fnname'>change_policy</a>(self, change_policy: <a class="enum" href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="enum magical::wallet::tx_builder::ChangeSpendPolicy">ChangeSpendPolicy</a>) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#234-237' title='goto source code'>[src]</a></h4><div class='docblock'><p>Set a specific <a href="../../../magical/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="`ChangeSpendPolicy`"><code>ChangeSpendPolicy</code></a>. See <a href="../../../magical/wallet/tx_builder/struct.TxBuilder.html#method.do_not_spend_change" title="`TxBuilder::do_not_spend_change`"><code>TxBuilder::do_not_spend_change</code></a> and
-<a href="../../../magical/wallet/tx_builder/struct.TxBuilder.html#method.only_spend_change" title="`TxBuilder::only_spend_change`"><code>TxBuilder::only_spend_change</code></a> for some shortcuts.</p>
-</div><h4 id='method.force_non_witness_utxo' class="method"><code>pub fn <a href='#method.force_non_witness_utxo' class='fnname'>force_non_witness_utxo</a>(self) -> Self</code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#243-246' title='goto source code'>[src]</a></h4><div class='docblock'><p>Fill-in the <a href="bitcoin::util::psbt::Input::non_witness_utxo"><code>psbt::Input::non_witness_utxo</code></a> field even if the wallet only has SegWit
-descriptors.</p>
-<p>This is useful for signers which always require it, like Trezor hardware wallets.</p>
-</div><h4 id='method.coin_selection' class="method"><code>pub fn <a href='#method.coin_selection' class='fnname'>coin_selection</a><P: <a class="trait" href="../../../magical/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait magical::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a>>(<br> self, <br> coin_selection: P<br>) -> <a class="struct" href="../../../magical/wallet/tx_builder/struct.TxBuilder.html" title="struct magical::wallet::tx_builder::TxBuilder">TxBuilder</a><P></code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#251-268' title='goto source code'>[src]</a></h4><div class='docblock'><p>Choose the coin selection algorithm</p>
-<p>Overrides the <a href="../../../magical/wallet/coin_selection/type.DefaultCoinSelectionAlgorithm.html"><code>DefaultCoinSelectionAlgorithm</code></a>.</p>
-</div></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<Cs: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <a class="trait" href="../../../magical/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait magical::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../magical/wallet/tx_builder/struct.TxBuilder.html" title="struct magical::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#56' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#56' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl<Cs: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="../../../magical/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait magical::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../../magical/wallet/tx_builder/struct.TxBuilder.html" title="struct magical::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#56' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../../magical/wallet/tx_builder/struct.TxBuilder.html" title="struct magical::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs></code><a class='srclink' href='../../../src/magical/wallet/tx_builder.rs.html#56' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
-</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<Cs> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../magical/wallet/tx_builder/struct.TxBuilder.html" title="struct magical::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs> <span class="where fmt-newline">where<br> Cs: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>, </span></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl<Cs> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../magical/wallet/tx_builder/struct.TxBuilder.html" title="struct magical::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs> <span class="where fmt-newline">where<br> Cs: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>, </span></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<Cs> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../magical/wallet/tx_builder/struct.TxBuilder.html" title="struct magical::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs> <span class="where fmt-newline">where<br> Cs: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl<Cs> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../magical/wallet/tx_builder/struct.TxBuilder.html" title="struct magical::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs> <span class="where fmt-newline">where<br> Cs: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl<Cs> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../magical/wallet/tx_builder/struct.TxBuilder.html" title="struct magical::wallet::tx_builder::TxBuilder">TxBuilder</a><Cs> <span class="where fmt-newline">where<br> Cs: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>, </span></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
-</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
-</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
-</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#555-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#603-612' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#609-611' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
-</div><h4 id='method.try_into' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-VZip%3CV%3E' class='impl'><code class='in-band'>impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></code><a href='#impl-VZip%3CV%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.vzip' class="method hidden"><code>fn <a href='#method.vzip' class='fnname'>vzip</a>(self) -> V</code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `OfflineWallet` type in crate `magical`."><meta name="keywords" content="rust, rustlang, rust-lang, OfflineWallet"><title>magical::wallet::OfflineWallet - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition OfflineWallet</p><div class="sidebar-elems"><p class='location'><a href='../index.html'>magical</a>::<wbr><a href='index.html'>wallet</a></p><script>window.sidebarCurrent = {name: 'OfflineWallet', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/magical/wallet/mod.rs.html#73' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='../index.html'>magical</a>::<wbr><a href='index.html'>wallet</a>::<wbr><a class="type" href=''>OfflineWallet</a></span></h1><pre class='rust typedef'>type OfflineWallet<D> = <a class="struct" href="../../magical/wallet/struct.Wallet.html" title="struct magical::wallet::Wallet">Wallet</a><<a class="struct" href="../../magical/blockchain/struct.OfflineBlockchain.html" title="struct magical::blockchain::OfflineBlockchain">OfflineBlockchain</a>, D>;</pre><div class='docblock'><p>Type alias for a <a href="../../magical/wallet/struct.Wallet.html" title="`Wallet`"><code>Wallet</code></a> that uses <a href="../../magical/blockchain/struct.OfflineBlockchain.html" title="`OfflineBlockchain`"><code>OfflineBlockchain</code></a></p>
-</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=../../../magical/wallet/trait.IsDust.html">
-</head>
-<body>
- <p>Redirecting to <a href="../../../magical/wallet/trait.IsDust.html">../../../magical/wallet/trait.IsDust.html</a>...</p>
- <script>location.replace("../../../magical/wallet/trait.IsDust.html" + location.search + location.hash);</script>
-</body>
-</html>
\ No newline at end of file
+++ /dev/null
-if(!String.prototype.startsWith){String.prototype.startsWith=function(searchString,position){position=position||0;return this.indexOf(searchString,position)===position}}if(!String.prototype.endsWith){String.prototype.endsWith=function(suffix,length){var l=length||this.length;return this.indexOf(suffix,l-suffix.length)!==-1}}if(!DOMTokenList.prototype.add){DOMTokenList.prototype.add=function(className){if(className&&!hasClass(this,className)){if(this.className&&this.className.length>0){this.className+=" "+className}else{this.className=className}}}}if(!DOMTokenList.prototype.remove){DOMTokenList.prototype.remove=function(className){if(className&&this.className){this.className=(" "+this.className+" ").replace(" "+className+" "," ").trim()}}}function getSearchInput(){return document.getElementsByClassName("search-input")[0]}function getSearchElement(){return document.getElementById("search")}function focusSearchBar(){getSearchInput().focus()}function defocusSearchBar(){getSearchInput().blur()}(function(){"use strict";var itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword","existential","attr","derive","traitalias"];var disableShortcuts=getCurrentValue("rustdoc-disable-shortcuts")==="true";var search_input=getSearchInput();var searchTimeout=null;var currentTab=0;var mouseMovedAfterSearch=true;var titleBeforeSearch=document.title;function clearInputTimeout(){if(searchTimeout!==null){clearTimeout(searchTimeout);searchTimeout=null}}function getPageId(){if(window.location.hash){var tmp=window.location.hash.replace(/^#/,"");if(tmp.length>0){return tmp}}return null}function showSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){addClass(elems,"show-it")}var sidebar=document.getElementsByClassName("sidebar")[0];if(sidebar){addClass(sidebar,"mobile");var filler=document.getElementById("sidebar-filler");if(!filler){var div=document.createElement("div");div.id="sidebar-filler";sidebar.appendChild(div)}}var themePickers=document.getElementsByClassName("theme-picker");if(themePickers&&themePickers.length>0){themePickers[0].style.display="none"}}function hideSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){removeClass(elems,"show-it")}var sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"mobile");var filler=document.getElementById("sidebar-filler");if(filler){filler.remove()}document.getElementsByTagName("body")[0].style.marginTop="";var themePickers=document.getElementsByClassName("theme-picker");if(themePickers&&themePickers.length>0){themePickers[0].style.display=null}}function showSearchResults(search){if(search===null||typeof search==='undefined'){search=getSearchElement()}addClass(main,"hidden");removeClass(search,"hidden");mouseMovedAfterSearch=false}function hideSearchResults(search){if(search===null||typeof search==='undefined'){search=getSearchElement()}addClass(search,"hidden");removeClass(main,"hidden")}var TY_PRIMITIVE=itemTypes.indexOf("primitive");var TY_KEYWORD=itemTypes.indexOf("keyword");function getQueryStringParams(){var params={};window.location.search.substring(1).split("&").map(function(s){var pair=s.split("=");params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function isHidden(elem){return elem.offsetHeight===0}var main=document.getElementById("main");var savedHash="";function handleHashes(ev){var elem;var search=getSearchElement();if(ev!==null&&search&&!hasClass(search,"hidden")&&ev.newURL){hideSearchResults(search);var hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(hash,"","?search=#"+hash)}elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}if(savedHash!==window.location.hash){savedHash=window.location.hash;if(savedHash.length===0){return}elem=document.getElementById(savedHash.slice(1));if(!elem||!isHidden(elem)){return}var parent=elem.parentNode;if(parent&&hasClass(parent,"impl-items")){onEachLazy(parent.getElementsByClassName("collapsed"),function(e){if(e.parentNode===parent){e.click();return true}});if(isHidden(elem)){if(hasClass(parent.lastElementChild,"collapse-toggle")){parent.lastElementChild.click()}}}}}function highlightSourceLines(match,ev){if(typeof match==="undefined"){hideSidebar();match=window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/)}if(!match){return}var from=parseInt(match[1],10);var to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to<from){var tmp=to;to=from;from=tmp}var elem=document.getElementById(from);if(!elem){return}if(!ev){var x=document.getElementById(from);if(x){x.scrollIntoView()}}onEachLazy(document.getElementsByClassName("line-numbers"),function(e){onEachLazy(e.getElementsByTagName("span"),function(i_e){removeClass(i_e,"line-highlighted")})});for(var i=from;i<=to;++i){elem=document.getElementById(i);if(!elem){break}addClass(elem,"line-highlighted")}}function onHashChange(ev){hideSidebar();var match=window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/);if(match){return highlightSourceLines(match,ev)}handleHashes(ev)}function expandSection(id){var elem=document.getElementById(id);if(elem&&isHidden(elem)){var h3=elem.parentNode.previousElementSibling;if(h3&&h3.tagName!=="H3"){h3=h3.previousElementSibling}if(h3){var collapses=h3.getElementsByClassName("collapse-toggle");if(collapses.length>0){collapseDocs(collapses[0],"show")}}}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!="undefined"){return ev.key}var c=ev.charCode||ev.keyCode;if(c==27){return"Escape"}return String.fromCharCode(c)}function getHelpElement(){return document.getElementById("help")}function displayHelp(display,ev,help){help=help?help:getHelpElement();if(display===true){if(hasClass(help,"hidden")){ev.preventDefault();removeClass(help,"hidden");addClass(document.body,"blur")}}else if(hasClass(help,"hidden")===false){ev.preventDefault();addClass(help,"hidden");removeClass(document.body,"blur")}}function handleEscape(ev){var help=getHelpElement();var search=getSearchElement();if(hasClass(help,"hidden")===false){displayHelp(false,ev,help)}else if(hasClass(search,"hidden")===false){clearInputTimeout();ev.preventDefault();hideSearchResults(search);document.title=titleBeforeSearch}defocusSearchBar()}function handleShortcut(ev){if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts===true){return}if(document.activeElement.tagName==="INPUT"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":displayHelp(false,ev);ev.preventDefault();focusSearchBar();break;case"+":case"-":ev.preventDefault();toggleAllDocs();break;case"?":if(ev.shiftKey){displayHelp(true,ev)}break}}}function findParentElement(elem,tagName){do{if(elem&&elem.tagName===tagName){return elem}elem=elem.parentNode}while(elem);return null}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);function resetMouseMoved(ev){mouseMovedAfterSearch=true}document.addEventListener("mousemove",resetMouseMoved);var handleSourceHighlight=(function(){var prev_line_id=0;var set_fragment=function(name){var x=window.scrollX,y=window.scrollY;if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSourceLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return function(ev){var cur_line_id=parseInt(ev.target.id,10);ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){var tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());document.addEventListener("click",function(ev){if(hasClass(ev.target,"collapse-toggle")){collapseDocs(ev.target,"toggle")}else if(hasClass(ev.target.parentNode,"collapse-toggle")){collapseDocs(ev.target.parentNode,"toggle")}else if(ev.target.tagName==="SPAN"&&hasClass(ev.target.parentNode,"line-numbers")){handleSourceHighlight(ev)}else if(hasClass(getHelpElement(),"hidden")===false){var help=getHelpElement();var is_inside_help_popup=ev.target!==help&&help.contains(ev.target);if(is_inside_help_popup===false){addClass(help,"hidden");removeClass(document.body,"blur")}}else{var a=findParentElement(ev.target,"A");if(a&&a.hash){expandSection(a.hash.replace(/^#/,""))}}});(function(){var x=document.getElementsByClassName("version-selector");if(x.length>0){x[0].onchange=function(){var i,match,url=document.location.href,stripped="",len=rootPath.match(/\.\.\//g).length+1;for(i=0;i<len;++i){match=url.match(/\/[^\/]*$/);if(i<len-1){stripped=match[0]+stripped}url=url.substring(0,url.length-match[0].length)}var selectedVersion=document.getElementsByClassName("version-selector")[0].value;url+="/"+selectedVersion+stripped;document.location.href=url}}}());var levenshtein_row2=[];function levenshtein(s1,s2){if(s1===s2){return 0}var s1_len=s1.length,s2_len=s2.length;if(s1_len&&s2_len){var i1=0,i2=0,a,b,c,c2,row=levenshtein_row2;while(i1<s1_len){row[i1]=++i1}while(i2<s2_len){c2=s2.charCodeAt(i2);a=i2;++i2;b=i2;for(i1=0;i1<s1_len;++i1){c=a+(s1.charCodeAt(i1)!==c2?1:0);a=row[i1];b=b<a?(b<c?b+1:c):(a<c?a+1:c);row[i1]=b}}return b}return s1_len+s2_len}window.initSearch=function(rawSearchIndex){var MAX_LEV_DISTANCE=3;var MAX_RESULTS=200;var GENERICS_DATA=1;var NAME=0;var INPUTS_DATA=0;var OUTPUT_DATA=1;var NO_TYPE_FILTER=-1;var currentResults,index,searchIndex;var ALIASES={};var params=getQueryStringParams();if(search_input.value===""){search_input.value=params.search||""}function execQuery(query,searchWords,filterCrates){function itemTypeFromName(typename){var length=itemTypes.length;for(var i=0;i<length;++i){if(itemTypes[i]===typename){return i}}return NO_TYPE_FILTER}var valLower=query.query.toLowerCase(),val=valLower,typeFilter=itemTypeFromName(query.type),results={},results_in_args={},results_returned={},split=valLower.split("::");var length=split.length;for(var z=0;z<length;++z){if(split[z]===""){split.splice(z,1);z-=1}}function transformResults(results,isType){var out=[];var length=results.length;for(var i=0;i<length;++i){if(results[i].id>-1){var obj=searchIndex[results[i].id];obj.lev=results[i].lev;if(isType!==true||obj.type){var res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}}return out}function sortResults(results,isType){var ar=[];for(var entry in results){if(hasOwnProperty(results,entry)){ar.push(results[entry])}}results=ar;var i;var nresults=results.length;for(i=0;i<nresults;++i){results[i].word=searchWords[results[i].id];results[i].item=searchIndex[results[i].id]||{}}if(results.length===0){return[]}results.sort(function(aaa,bbb){var a,b;a=(aaa.word!==val);b=(bbb.word!==val);if(a!==b){return a-b}a=(aaa.lev);b=(bbb.lev);if(a!==b){return a-b}a=(aaa.item.crate!==window.currentCrate);b=(bbb.item.crate!==window.currentCrate);if(a!==b){return a-b}a=aaa.word.length;b=bbb.word.length;if(a!==b){return a-b}a=aaa.word;b=bbb.word;if(a!==b){return(a>b?+1:-1)}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}if((aaa.item.ty===TY_PRIMITIVE&&bbb.item.ty!==TY_KEYWORD)||(aaa.item.ty===TY_KEYWORD&&bbb.item.ty!==TY_PRIMITIVE)){return-1}if((bbb.item.ty===TY_PRIMITIVE&&aaa.item.ty!==TY_PRIMITIVE)||(bbb.item.ty===TY_KEYWORD&&aaa.item.ty!==TY_KEYWORD)){return 1}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});var length=results.length;for(i=0;i<length;++i){var result=results[i];if(result.dontValidate){continue}var name=result.item.name.toLowerCase(),path=result.item.path.toLowerCase(),parent=result.item.parent;if(isType!==true&&validateResult(name,path,split,parent)===false){result.id=-1}}return transformResults(results)}function extractGenerics(val){val=val.toLowerCase();if(val.indexOf("<")!==-1){var values=val.substring(val.indexOf("<")+1,val.lastIndexOf(">"));return{name:val.substring(0,val.indexOf("<")),generics:values.split(/\s*,\s*/),}}return{name:val,generics:[],}}function getObjectFromId(id){if(typeof id==="number"){return searchIndex[id]}return{'name':id}}function checkGenerics(obj,val){var lev_distance=MAX_LEV_DISTANCE+1;if(val.generics.length>0){if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>=val.generics.length){var elems=obj[GENERICS_DATA].slice(0);var total=0;var done=0;var vlength=val.generics.length;for(var y=0;y<vlength;++y){var lev={pos:-1,lev:MAX_LEV_DISTANCE+1};var elength=elems.length;var firstGeneric=getObjectFromId(val.generics[y]).name;for(var x=0;x<elength;++x){var tmp_lev=levenshtein(getObjectFromId(elems[x]).name,firstGeneric);if(tmp_lev<lev.lev){lev.lev=tmp_lev;lev.pos=x}}if(lev.pos!==-1){elems.splice(lev.pos,1);lev_distance=Math.min(lev.lev,lev_distance);total+=lev.lev;done+=1}else{return MAX_LEV_DISTANCE+1}}return Math.ceil(total/done)}}return MAX_LEV_DISTANCE+1}function checkType(obj,val,literalSearch){var lev_distance=MAX_LEV_DISTANCE+1;var x;if(obj[NAME]===val.name){if(literalSearch===true){if(val.generics&&val.generics.length!==0){if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>=val.generics.length){var elems=obj[GENERICS_DATA].slice(0);var allFound=true;for(var y=0;allFound===true&&y<val.generics.length;++y){allFound=false;var firstGeneric=getObjectFromId(val.generics[y]).name;for(x=0;allFound===false&&x<elems.length;++x){allFound=getObjectFromId(elems[x]).name===firstGeneric}if(allFound===true){elems.splice(x-1,1)}}if(allFound===true){return true}}else{return false}}return true}if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length!==0){var tmp_lev=checkGenerics(obj,val);if(tmp_lev<=MAX_LEV_DISTANCE){return tmp_lev}}else{return 0}}if(literalSearch===true){if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>0){var length=obj[GENERICS_DATA].length;for(x=0;x<length;++x){if(obj[GENERICS_DATA][x]===val.name){return true}}}return false}lev_distance=Math.min(levenshtein(obj[NAME],val.name),lev_distance);if(lev_distance<=MAX_LEV_DISTANCE){lev_distance=Math.ceil((checkGenerics(obj,val)+lev_distance)/2)}else if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>0){var olength=obj[GENERICS_DATA].length;for(x=0;x<olength;++x){lev_distance=Math.min(levenshtein(obj[GENERICS_DATA][x],val.name),lev_distance)}}return lev_distance+1}function findArg(obj,val,literalSearch,typeFilter){var lev_distance=MAX_LEV_DISTANCE+1;if(obj&&obj.type&&obj.type[INPUTS_DATA]&&obj.type[INPUTS_DATA].length>0){var length=obj.type[INPUTS_DATA].length;for(var i=0;i<length;i++){var tmp=obj.type[INPUTS_DATA][i];if(typePassesFilter(typeFilter,tmp[1])===false){continue}tmp=checkType(tmp,val,literalSearch);if(literalSearch===true){if(tmp===true){return true}continue}lev_distance=Math.min(tmp,lev_distance);if(lev_distance===0){return 0}}}return literalSearch===true?false:lev_distance}function checkReturned(obj,val,literalSearch,typeFilter){var lev_distance=MAX_LEV_DISTANCE+1;if(obj&&obj.type&&obj.type.length>OUTPUT_DATA){var ret=obj.type[OUTPUT_DATA];if(typeof ret[0]==="string"){ret=[ret]}for(var x=0;x<ret.length;++x){var tmp=ret[x];if(typePassesFilter(typeFilter,tmp[1])===false){continue}tmp=checkType(tmp,val,literalSearch);if(literalSearch===true){if(tmp===true){return true}continue}lev_distance=Math.min(tmp,lev_distance);if(lev_distance===0){return 0}}}return literalSearch===true?false:lev_distance}function checkPath(contains,lastElem,ty){if(contains.length===0){return 0}var ret_lev=MAX_LEV_DISTANCE+1;var path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}var length=path.length;var clength=contains.length;if(clength>length){return MAX_LEV_DISTANCE+1}for(var i=0;i<length;++i){if(i+clength>length){break}var lev_total=0;var aborted=false;for(var x=0;x<clength;++x){var lev=levenshtein(path[i+x],contains[x]);if(lev>MAX_LEV_DISTANCE){aborted=true;break}lev_total+=lev}if(aborted===false){ret_lev=Math.min(ret_lev,Math.round(lev_total/clength))}}return ret_lev}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER)return true;if(filter===type)return true;var name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function generateId(ty){if(ty.parent&&ty.parent.name){return itemTypes[ty.ty]+ty.path+ty.parent.name+ty.name}return itemTypes[ty.ty]+ty.path+ty.name}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,desc:item.desc,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,}}function handleAliases(ret,query,filterCrates){var aliases=[];var crateAliases=[];var i;if(filterCrates!==undefined){if(ALIASES[filterCrates]&&ALIASES[filterCrates][query.search]){for(i=0;i<ALIASES[filterCrates][query.search].length;++i){aliases.push(createAliasFromItem(searchIndex[ALIASES[filterCrates][query.search][i]]))}}}else{Object.keys(ALIASES).forEach(function(crate){if(ALIASES[crate][query.search]){var pushTo=crate===window.currentCrate?crateAliases:aliases;for(i=0;i<ALIASES[crate][query.search].length;++i){pushTo.push(createAliasFromItem(searchIndex[ALIASES[crate][query.search][i]]))}}})}var sortFunc=function(aaa,bbb){if(aaa.path<bbb.path){return 1}else if(aaa.path===bbb.path){return 0}return-1};crateAliases.sort(sortFunc);aliases.sort(sortFunc);var pushFunc=function(alias){alias.alias=query.raw;var res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};onEach(aliases,pushFunc);onEach(crateAliases,pushFunc)}var nSearchWords=searchWords.length;var i;var ty;var fullId;var returned;var in_args;if((val.charAt(0)==="\""||val.charAt(0)==="'")&&val.charAt(val.length-1)===val.charAt(0)){val=extractGenerics(val.substr(1,val.length-2));for(i=0;i<nSearchWords;++i){if(filterCrates!==undefined&&searchIndex[i].crate!==filterCrates){continue}in_args=findArg(searchIndex[i],val,true,typeFilter);returned=checkReturned(searchIndex[i],val,true,typeFilter);ty=searchIndex[i];fullId=generateId(ty);if(searchWords[i]===val.name&&typePassesFilter(typeFilter,searchIndex[i].ty)&&results[fullId]===undefined){results[fullId]={id:i,index:-1,dontValidate:true,}}if(in_args===true&&results_in_args[fullId]===undefined){results_in_args[fullId]={id:i,index:-1,dontValidate:true,}}if(returned===true&&results_returned[fullId]===undefined){results_returned[fullId]={id:i,index:-1,dontValidate:true,}}}query.inputs=[val];query.output=val;query.search=val}else if(val.search("->")>-1){var trimmer=function(s){return s.trim()};var parts=val.split("->").map(trimmer);var input=parts[0];var inputs=input.split(",").map(trimmer).sort();for(i=0;i<inputs.length;++i){inputs[i]=extractGenerics(inputs[i])}var output=extractGenerics(parts[1]);for(i=0;i<nSearchWords;++i){if(filterCrates!==undefined&&searchIndex[i].crate!==filterCrates){continue}var type=searchIndex[i].type;ty=searchIndex[i];if(!type){continue}fullId=generateId(ty);returned=checkReturned(ty,output,true,NO_TYPE_FILTER);if(output.name==="*"||returned===true){in_args=false;var is_module=false;if(input==="*"){is_module=true}else{var allFound=true;for(var it=0;allFound===true&&it<inputs.length;it++){allFound=checkType(type,inputs[it],true)}in_args=allFound}if(in_args===true){results_in_args[fullId]={id:i,index:-1,dontValidate:true,}}if(returned===true){results_returned[fullId]={id:i,index:-1,dontValidate:true,}}if(is_module===true){results[fullId]={id:i,index:-1,dontValidate:true,}}}}query.inputs=inputs.map(function(input){return input.name});query.output=output.name}else{query.inputs=[val];query.output=val;query.search=val;val=val.replace(/\_/g,"");var valGenerics=extractGenerics(val);var paths=valLower.split("::");var j;for(j=0;j<paths.length;++j){if(paths[j]===""){paths.splice(j,1);j-=1}}val=paths[paths.length-1];var contains=paths.slice(0,paths.length>1?paths.length-1:1);var lev;for(j=0;j<nSearchWords;++j){ty=searchIndex[j];if(!ty||(filterCrates!==undefined&&ty.crate!==filterCrates)){continue}var lev_add=0;if(paths.length>1){lev=checkPath(contains,paths[paths.length-1],ty);if(lev>MAX_LEV_DISTANCE){continue}else if(lev>0){lev_add=lev/10}}returned=MAX_LEV_DISTANCE+1;in_args=MAX_LEV_DISTANCE+1;var index=-1;lev=MAX_LEV_DISTANCE+1;fullId=generateId(ty);if(searchWords[j].indexOf(split[i])>-1||searchWords[j].indexOf(val)>-1||searchWords[j].replace(/_/g,"").indexOf(val)>-1){if(typePassesFilter(typeFilter,ty.ty)&&results[fullId]===undefined){index=searchWords[j].replace(/_/g,"").indexOf(val)}}if((lev=levenshtein(searchWords[j],val))<=MAX_LEV_DISTANCE){if(typePassesFilter(typeFilter,ty.ty)===false){lev=MAX_LEV_DISTANCE+1}else{lev+=1}}in_args=findArg(ty,valGenerics,false,typeFilter);returned=checkReturned(ty,valGenerics,false,typeFilter);lev+=lev_add;if(lev>0&&val.length>3&&searchWords[j].indexOf(val)>-1){if(val.length<6){lev-=1}else{lev=0}}if(in_args<=MAX_LEV_DISTANCE){if(results_in_args[fullId]===undefined){results_in_args[fullId]={id:j,index:index,lev:in_args,}}results_in_args[fullId].lev=Math.min(results_in_args[fullId].lev,in_args)}if(returned<=MAX_LEV_DISTANCE){if(results_returned[fullId]===undefined){results_returned[fullId]={id:j,index:index,lev:returned,}}results_returned[fullId].lev=Math.min(results_returned[fullId].lev,returned)}if(index!==-1||lev<=MAX_LEV_DISTANCE){if(index!==-1&&paths.length<2){lev=0}if(results[fullId]===undefined){results[fullId]={id:j,index:index,lev:lev,}}results[fullId].lev=Math.min(results[fullId].lev,lev)}}}var ret={"in_args":sortResults(results_in_args,true),"returned":sortResults(results_returned,true),"others":sortResults(results),};handleAliases(ret,query,filterCrates);return ret}function validateResult(name,path,keys,parent){for(var i=0;i<keys.length;++i){if(!(name.indexOf(keys[i])>-1||path.indexOf(keys[i])>-1||(parent!==undefined&&parent.name!==undefined&&parent.name.toLowerCase().indexOf(keys[i])>-1)||levenshtein(name,keys[i])<=MAX_LEV_DISTANCE)){return false}}return true}function getQuery(raw){var matches,type,query;query=raw;matches=query.match(/^(fn|mod|struct|enum|trait|type|const|macro)\s*:\s*/i);if(matches){type=matches[1].replace(/^const$/,"constant");query=query.substring(matches[0].length)}return{raw:raw,query:query,type:type,id:query+type}}function initSearchNav(){var hoverTimeout;var click_func=function(e){var el=e.target;while(el.tagName!=="TR"){el=el.parentNode}var dst=e.target.getElementsByTagName("a");if(dst.length<1){return}dst=dst[0];if(window.location.pathname===dst.pathname){hideSearchResults();document.location.href=dst.href}};var mouseover_func=function(e){if(mouseMovedAfterSearch){var el=e.target;while(el.tagName!=="TR"){el=el.parentNode}clearTimeout(hoverTimeout);hoverTimeout=setTimeout(function(){onEachLazy(document.getElementsByClassName("search-results"),function(e){onEachLazy(e.getElementsByClassName("result"),function(i_e){removeClass(i_e,"highlighted")})});addClass(el,"highlighted")},20)}};onEachLazy(document.getElementsByClassName("search-results"),function(e){onEachLazy(e.getElementsByClassName("result"),function(i_e){i_e.onclick=click_func;i_e.onmouseover=mouseover_func})});search_input.onkeydown=function(e){var actives=[[],[],[]];var current=0;onEachLazy(document.getElementById("results").childNodes,function(e){onEachLazy(e.getElementsByClassName("highlighted"),function(e){actives[current].push(e)});current+=1});if(e.which===38){if(!actives[currentTab].length||!actives[currentTab][0].previousElementSibling){return}addClass(actives[currentTab][0].previousElementSibling,"highlighted");removeClass(actives[currentTab][0],"highlighted");e.preventDefault()}else if(e.which===40){if(!actives[currentTab].length){var results=document.getElementById("results").childNodes;if(results.length>0){var res=results[currentTab].getElementsByClassName("result");if(res.length>0){addClass(res[0],"highlighted")}}}else if(actives[currentTab][0].nextElementSibling){addClass(actives[currentTab][0].nextElementSibling,"highlighted");removeClass(actives[currentTab][0],"highlighted")}e.preventDefault()}else if(e.which===13){if(actives[currentTab].length){document.location.href=actives[currentTab][0].getElementsByTagName("a")[0].href}}else if(e.which===9){if(e.shiftKey){printTab(currentTab>0?currentTab-1:2)}else{printTab(currentTab>1?0:currentTab+1)}e.preventDefault()}else if(e.which===16){}else if(actives[currentTab].length>0){removeClass(actives[currentTab][0],"highlighted")}}}function buildHrefAndPath(item){var displayPath;var href;var type=itemTypes[item.ty];var name=item.name;var path=item.path;if(type==="mod"){displayPath=path+"::";href=rootPath+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="primitive"||type==="keyword"){displayPath="";href=rootPath+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=rootPath+name+"/index.html"}else if(item.parent!==undefined){var myparent=item.parent;var anchor="#"+type+"."+name;var parentType=itemTypes[myparent.ty];var pageType=parentType;var pageName=myparent.name;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){var splitPath=item.path.split("::");var enumName=splitPath.pop();path=splitPath.join("::");displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="#variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}href=rootPath+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html"+anchor}else{displayPath=item.path+"::";href=rootPath+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href]}function escape(content){var h1=document.createElement("h1");h1.textContent=content;return h1.innerHTML}function pathSplitter(path){var tmp="<span>"+path.replace(/::/g,"::</span><span>");if(tmp.endsWith("<span>")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){var extraStyle="";if(display===false){extraStyle=" style=\"display: none;\""}var output="";var duplicates={};var length=0;if(array.length>0){output="<table class=\"search-results\""+extraStyle+">";array.forEach(function(item){var name,type;name=item.name;type=itemTypes[item.ty];if(item.is_alias!==true){if(duplicates[item.fullPath]){return}duplicates[item.fullPath]=true}length+=1;output+="<tr class=\""+type+" result\"><td>"+"<a href=\""+item.href+"\">"+(item.is_alias===true?("<span class=\"alias\"><b>"+item.alias+" </b></span><span "+"class=\"grey\"><i> - see </i></span>"):"")+item.displayPath+"<span class=\""+type+"\">"+name+"</span></a></td><td>"+"<a href=\""+item.href+"\">"+"<span class=\"desc\">"+escape(item.desc)+" </span></a></td></tr>"});output+="</table>"}else{output="<div class=\"search-failed\""+extraStyle+">No results :(<br/>"+"Try on <a href=\"https://duckduckgo.com/?q="+encodeURIComponent("rust "+query.query)+"\">DuckDuckGo</a>?<br/><br/>"+"Or try looking in one of these:<ul><li>The <a "+"href=\"https://doc.rust-lang.org/reference/index.html\">Rust Reference</a> "+" for technical details about the language.</li><li><a "+"href=\"https://doc.rust-lang.org/rust-by-example/index.html\">Rust By "+"Example</a> for expository code examples.</a></li><li>The <a "+"href=\"https://doc.rust-lang.org/book/index.html\">Rust Book</a> for "+"introductions to language features and the language itself.</li><li><a "+"href=\"https://docs.rs\">Docs.rs</a> for documentation of crates released on"+" <a href=\"https://crates.io/\">crates.io</a>.</li></ul></div>"}return[output,length]}function makeTabHeader(tabNb,text,nbElems){if(currentTab===tabNb){return"<div class=\"selected\">"+text+" <div class=\"count\">("+nbElems+")</div></div>"}return"<div>"+text+" <div class=\"count\">("+nbElems+")</div></div>"}function showResults(results){if(results.others.length===1&&getCurrentValue("rustdoc-go-to-only-result")==="true"){var elem=document.createElement("a");elem.href=results.others[0].href;elem.style.display="none";document.body.appendChild(elem);elem.click()}var query=getQuery(search_input.value);currentResults=query.id;var ret_others=addTab(results.others,query);var ret_in_args=addTab(results.in_args,query,false);var ret_returned=addTab(results.returned,query,false);var output="<h1>Results for "+escape(query.query)+(query.type?" (type: "+escape(query.type)+")":"")+"</h1>"+"<div id=\"titles\">"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"</div><div id=\"results\">"+ret_others[0]+ret_in_args[0]+ret_returned[0]+"</div>";var search=getSearchElement();search.innerHTML=output;showSearchResults(search);var tds=search.getElementsByTagName("td");var td_width=0;if(tds.length>0){td_width=tds[0].offsetWidth}var width=search.offsetWidth-40-td_width;onEachLazy(search.getElementsByClassName("desc"),function(e){e.style.width=width+"px"});initSearchNav();var elems=document.getElementById("titles").childNodes;elems[0].onclick=function(){printTab(0)};elems[1].onclick=function(){printTab(1)};elems[2].onclick=function(){printTab(2)};printTab(currentTab)}function execSearch(query,searchWords,filterCrates){function getSmallest(arrays,positions,notDuplicates){var start=null;for(var it=0;it<positions.length;++it){if(arrays[it].length>positions[it]&&(start===null||start>arrays[it][positions[it]].lev)&&!notDuplicates[arrays[it][positions[it]].fullPath]){start=arrays[it][positions[it]].lev}}return start}function mergeArrays(arrays){var ret=[];var positions=[];var notDuplicates={};for(var x=0;x<arrays.length;++x){positions.push(0)}while(ret.length<MAX_RESULTS){var smallest=getSmallest(arrays,positions,notDuplicates);if(smallest===null){break}for(x=0;x<arrays.length&&ret.length<MAX_RESULTS;++x){if(arrays[x].length>positions[x]&&arrays[x][positions[x]].lev===smallest&&!notDuplicates[arrays[x][positions[x]].fullPath]){ret.push(arrays[x][positions[x]]);notDuplicates[arrays[x][positions[x]].fullPath]=true;positions[x]+=1}}}return ret}var queries=query.raw.split(",");var results={"in_args":[],"returned":[],"others":[],};for(var i=0;i<queries.length;++i){query=queries[i].trim();if(query.length!==0){var tmp=execQuery(getQuery(query),searchWords,filterCrates);results.in_args.push(tmp.in_args);results.returned.push(tmp.returned);results.others.push(tmp.others)}}if(queries.length>1){return{"in_args":mergeArrays(results.in_args),"returned":mergeArrays(results.returned),"others":mergeArrays(results.others),}}return{"in_args":results.in_args[0],"returned":results.returned[0],"others":results.others[0],}}function getFilterCrates(){var elem=document.getElementById("crate-search");if(elem&&elem.value!=="All crates"&&hasOwnProperty(rawSearchIndex,elem.value)){return elem.value}return undefined}function search(e,forced){var params=getQueryStringParams();var query=getQuery(search_input.value.trim());if(e){e.preventDefault()}if(query.query.length===0){return}if(forced!==true&&query.id===currentResults){if(query.query.length>0){putBackSearch(search_input)}return}document.title="Results for "+query.query+" - Rust";if(browserSupportsHistoryApi()){if(!history.state&&!params.search){history.pushState(query,"","?search="+encodeURIComponent(query.raw))}else{history.replaceState(query,"","?search="+encodeURIComponent(query.raw))}}var filterCrates=getFilterCrates();showResults(execSearch(query,index,filterCrates))}function buildIndex(rawSearchIndex){searchIndex=[];var searchWords=[];var i;var currentIndex=0;for(var crate in rawSearchIndex){if(!hasOwnProperty(rawSearchIndex,crate)){continue}var crateSize=0;searchWords.push(crate);searchIndex.push({crate:crate,ty:1,name:crate,path:"",desc:rawSearchIndex[crate].doc,type:null,});currentIndex+=1;var items=rawSearchIndex[crate].i;var paths=rawSearchIndex[crate].p;var aliases=rawSearchIndex[crate].a;var len=paths.length;for(i=0;i<len;++i){paths[i]={ty:paths[i][0],name:paths[i][1]}}len=items.length;var lastPath="";for(i=0;i<len;++i){var rawRow=items[i];if(!rawRow[2]){rawRow[2]=lastPath}var row={crate:crate,ty:rawRow[0],name:rawRow[1],path:rawRow[2],desc:rawRow[3],parent:paths[rawRow[4]],type:rawRow[5],};searchIndex.push(row);if(typeof row.name==="string"){var word=row.name.toLowerCase();searchWords.push(word)}else{searchWords.push("")}lastPath=row.path;crateSize+=1}if(aliases){ALIASES[crate]={};var j,local_aliases;for(var alias_name in aliases){if(!aliases.hasOwnProperty(alias_name)){continue}if(!ALIASES[crate].hasOwnProperty(alias_name)){ALIASES[crate][alias_name]=[]}local_aliases=aliases[alias_name];for(j=0;j<local_aliases.length;++j){ALIASES[crate][alias_name].push(local_aliases[j]+currentIndex)}}}currentIndex+=crateSize}return searchWords}function startSearch(){var callback=function(){clearInputTimeout();if(search_input.value.length===0){if(browserSupportsHistoryApi()){history.replaceState("",window.currentCrate+" - Rust","?search=")}hideSearchResults()}else{searchTimeout=setTimeout(search,500)}};search_input.onkeyup=callback;search_input.oninput=callback;document.getElementsByClassName("search-form")[0].onsubmit=function(e){e.preventDefault();clearInputTimeout();search()};search_input.onchange=function(e){if(e.target!==document.activeElement){return}clearInputTimeout();setTimeout(search,0)};search_input.onpaste=search_input.onchange;var selectCrate=document.getElementById("crate-search");if(selectCrate){selectCrate.onchange=function(){updateLocalStorage("rustdoc-saved-filter-crate",selectCrate.value);search(undefined,true)}}if(browserSupportsHistoryApi()){var previousTitle=document.title;window.addEventListener("popstate",function(e){var params=getQueryStringParams();document.title=previousTitle;currentResults=null;if(params.search&¶ms.search.length>0){search_input.value=params.search;search(e)}else{search_input.value="";hideSearchResults()}})}search()}index=buildIndex(rawSearchIndex);startSearch();if(rootPath==="../"||rootPath==="./"){var sidebar=document.getElementsByClassName("sidebar-elems")[0];if(sidebar){var div=document.createElement("div");div.className="block crate";div.innerHTML="<h3>Crates</h3>";var ul=document.createElement("ul");div.appendChild(ul);var crates=[];for(var crate in rawSearchIndex){if(!hasOwnProperty(rawSearchIndex,crate)){continue}crates.push(crate)}crates.sort();for(var i=0;i<crates.length;++i){var klass="crate";if(rootPath!=="./"&&crates[i]===window.currentCrate){klass+=" current"}var link=document.createElement("a");link.href=rootPath+crates[i]+"/index.html";link.title=rawSearchIndex[crates[i]].doc;link.className=klass;link.textContent=crates[i];var li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebar.appendChild(div)}}};window.initSidebarItems=function(items){var sidebar=document.getElementsByClassName("sidebar-elems")[0];var current=window.sidebarCurrent;function block(shortty,longty){var filtered=items[shortty];if(!filtered){return}var div=document.createElement("div");div.className="block "+shortty;var h3=document.createElement("h3");h3.textContent=longty;div.appendChild(h3);var ul=document.createElement("ul");var length=filtered.length;for(var i=0;i<length;++i){var item=filtered[i];var name=item[0];var desc=item[1];var klass=shortty;if(name===current.name&&shortty===current.ty){klass+=" current"}var path;if(shortty==="mod"){path=name+"/index.html"}else{path=shortty+"."+name+".html"}var link=document.createElement("a");link.href=current.relpath+path;link.title=desc;link.className=klass;link.textContent=name;var li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}div.appendChild(ul);if(sidebar){sidebar.appendChild(div)}}block("primitive","Primitive Types");block("mod","Modules");block("macro","Macros");block("struct","Structs");block("enum","Enums");block("union","Unions");block("constant","Constants");block("static","Statics");block("trait","Traits");block("fn","Functions");block("type","Type Definitions");block("foreigntype","Foreign Types");block("keyword","Keywords");block("traitalias","Trait Aliases")};window.register_implementors=function(imp){var implementors=document.getElementById("implementors-list");var synthetic_implementors=document.getElementById("synthetic-implementors-list");if(synthetic_implementors){var inlined_types=new Set();onEachLazy(synthetic_implementors.getElementsByClassName("impl"),function(el){var aliases=el.getAttribute("aliases");if(!aliases){return}aliases.split(",").forEach(function(alias){inlined_types.add(alias)})})}var libs=Object.getOwnPropertyNames(imp);var llength=libs.length;for(var i=0;i<llength;++i){if(libs[i]===currentCrate){continue}var structs=imp[libs[i]];var slength=structs.length;struct_loop:for(var j=0;j<slength;++j){var struct=structs[j];var list=struct.synthetic?synthetic_implementors:implementors;if(struct.synthetic){var stlength=struct.types.length;for(var k=0;k<stlength;k++){if(inlined_types.has(struct.types[k])){continue struct_loop}inlined_types.add(struct.types[k])}}var code=document.createElement("code");code.innerHTML=struct.text;var x=code.getElementsByTagName("a");var xlength=x.length;for(var it=0;it<xlength;it++){var href=x[it].getAttribute("href");if(href&&href.indexOf("http")!==0){x[it].setAttribute("href",rootPath+href)}}var display=document.createElement("h3");addClass(display,"impl");display.innerHTML="<span class=\"in-band\"><table class=\"table-display\">"+"<tbody><tr><td><code>"+code.outerHTML+"</code></td><td></td></tr>"+"</tbody></table></span>";list.appendChild(display)}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}function labelForToggleButton(sectionIsCollapsed){if(sectionIsCollapsed){return"+"}return"\u2212"}function onEveryMatchingChild(elem,className,func){if(elem&&className&&func){var length=elem.childNodes.length;var nodes=elem.childNodes;for(var i=0;i<length;++i){if(hasClass(nodes[i],className)){func(nodes[i])}else{onEveryMatchingChild(nodes[i],className,func)}}}}function toggleAllDocs(pageId,fromAutoCollapse){var innerToggle=document.getElementById("toggle-all-docs");if(!innerToggle){return}if(hasClass(innerToggle,"will-expand")){updateLocalStorage("rustdoc-collapse","false");removeClass(innerToggle,"will-expand");onEveryMatchingChild(innerToggle,"inner",function(e){e.innerHTML=labelForToggleButton(false)});innerToggle.title="collapse all docs";if(fromAutoCollapse!==true){onEachLazy(document.getElementsByClassName("collapse-toggle"),function(e){collapseDocs(e,"show")})}}else{updateLocalStorage("rustdoc-collapse","true");addClass(innerToggle,"will-expand");onEveryMatchingChild(innerToggle,"inner",function(e){var parent=e.parentNode;var superParent=null;if(parent){superParent=parent.parentNode}if(!parent||!superParent||superParent.id!=="main"||hasClass(parent,"impl")===false){e.innerHTML=labelForToggleButton(true)}});innerToggle.title="expand all docs";if(fromAutoCollapse!==true){onEachLazy(document.getElementsByClassName("collapse-toggle"),function(e){var parent=e.parentNode;var superParent=null;if(parent){superParent=parent.parentNode}if(!parent||!superParent||superParent.id!=="main"||hasClass(parent,"impl")===false){collapseDocs(e,"hide",pageId)}})}}}function collapseDocs(toggle,mode,pageId){if(!toggle||!toggle.parentNode){return}function adjustToggle(arg){return function(e){if(hasClass(e,"toggle-label")){if(arg){e.style.display="inline-block"}else{e.style.display="none"}}if(hasClass(e,"inner")){e.innerHTML=labelForToggleButton(arg)}}}function implHider(addOrRemove,fullHide){return function(n){var is_method=hasClass(n,"method")||fullHide;if(is_method||hasClass(n,"type")){if(is_method===true){if(addOrRemove){addClass(n,"hidden-by-impl-hider")}else{removeClass(n,"hidden-by-impl-hider")}}var ns=n.nextElementSibling;while(ns&&(hasClass(ns,"docblock")||hasClass(ns,"stability"))){if(addOrRemove){addClass(ns,"hidden-by-impl-hider")}else{removeClass(ns,"hidden-by-impl-hider")}ns=ns.nextElementSibling}}}}var relatedDoc;var action=mode;if(hasClass(toggle.parentNode,"impl")===false){relatedDoc=toggle.parentNode.nextElementSibling;if(hasClass(relatedDoc,"stability")){relatedDoc=relatedDoc.nextElementSibling}if(hasClass(relatedDoc,"docblock")||hasClass(relatedDoc,"sub-variant")){if(mode==="toggle"){if(hasClass(relatedDoc,"hidden-by-usual-hider")){action="show"}else{action="hide"}}if(action==="hide"){addClass(relatedDoc,"hidden-by-usual-hider");onEachLazy(toggle.childNodes,adjustToggle(true));addClass(toggle.parentNode,"collapsed")}else if(action==="show"){removeClass(relatedDoc,"hidden-by-usual-hider");removeClass(toggle.parentNode,"collapsed");onEachLazy(toggle.childNodes,adjustToggle(false))}}}else{var parentElem=toggle.parentNode;relatedDoc=parentElem;var docblock=relatedDoc.nextElementSibling;while(hasClass(relatedDoc,"impl-items")===false){relatedDoc=relatedDoc.nextElementSibling}if((!relatedDoc&&hasClass(docblock,"docblock")===false)||(pageId&&document.getElementById(pageId))){return}if(mode==="toggle"){if(hasClass(relatedDoc,"fns-now-collapsed")||hasClass(docblock,"hidden-by-impl-hider")){action="show"}else{action="hide"}}var dontApplyBlockRule=toggle.parentNode.parentNode.id!=="main";if(action==="show"){removeClass(relatedDoc,"fns-now-collapsed");removeClass(docblock,"hidden-by-usual-hider");onEachLazy(toggle.childNodes,adjustToggle(false,dontApplyBlockRule));onEachLazy(relatedDoc.childNodes,implHider(false,dontApplyBlockRule))}else if(action==="hide"){addClass(relatedDoc,"fns-now-collapsed");addClass(docblock,"hidden-by-usual-hider");onEachLazy(toggle.childNodes,adjustToggle(true,dontApplyBlockRule));onEachLazy(relatedDoc.childNodes,implHider(true,dontApplyBlockRule))}}}function collapser(pageId,e,collapse){var n=e.parentElement;if(n.id.match(/^impl(?:-\d+)?$/)===null){if(collapse||hasClass(n,"impl")){collapseDocs(e,"hide",pageId)}}}function autoCollapse(pageId,collapse){if(collapse){toggleAllDocs(pageId,true)}else if(getCurrentValue("rustdoc-auto-hide-trait-implementations")!=="false"){var impl_list=document.getElementById("trait-implementations-list");if(impl_list!==null){onEachLazy(impl_list.getElementsByClassName("collapse-toggle"),function(e){collapser(pageId,e,collapse)})}var blanket_list=document.getElementById("blanket-implementations-list");if(blanket_list!==null){onEachLazy(blanket_list.getElementsByClassName("collapse-toggle"),function(e){collapser(pageId,e,collapse)})}}}var toggles=document.getElementById("toggle-all-docs");if(toggles){toggles.onclick=toggleAllDocs}function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}function createSimpleToggle(sectionIsCollapsed){var toggle=document.createElement("a");toggle.href="javascript:void(0)";toggle.className="collapse-toggle";toggle.innerHTML="[<span class=\"inner\">"+labelForToggleButton(sectionIsCollapsed)+"</span>]";return toggle}function createToggle(toggle,otherMessage,fontSize,extraClass,show){var span=document.createElement("span");span.className="toggle-label";if(show){span.style.display="none"}if(!otherMessage){span.innerHTML=" Expand description"}else{span.innerHTML=otherMessage}if(fontSize){span.style.fontSize=fontSize}var mainToggle=toggle.cloneNode(true);mainToggle.appendChild(span);var wrapper=document.createElement("div");wrapper.className="toggle-wrapper";if(!show){addClass(wrapper,"collapsed");var inner=mainToggle.getElementsByClassName("inner");if(inner&&inner.length>0){inner[0].innerHTML="+"}}if(extraClass){addClass(wrapper,extraClass)}wrapper.appendChild(mainToggle);return wrapper}(function(){var toggle=createSimpleToggle(false);var hideMethodDocs=getCurrentValue("rustdoc-auto-hide-method-docs")==="true";var pageId=getPageId();var func=function(e){var next=e.nextElementSibling;if(!next){return}if(hasClass(next,"docblock")===true||(hasClass(next,"stability")===true&&hasClass(next.nextElementSibling,"docblock")===true)){var newToggle=toggle.cloneNode(true);insertAfter(newToggle,e.childNodes[e.childNodes.length-1]);if(hideMethodDocs===true&&hasClass(e,"method")===true){collapseDocs(newToggle,"hide",pageId)}}};var funcImpl=function(e){var next=e.nextElementSibling;if(next&&hasClass(next,"docblock")){next=next.nextElementSibling}if(!next){return}if(hasClass(e,"impl")&&(next.getElementsByClassName("method").length>0||next.getElementsByClassName("associatedconstant").length>0)){insertAfter(toggle.cloneNode(true),e.childNodes[e.childNodes.length-1])}};onEachLazy(document.getElementsByClassName("method"),func);onEachLazy(document.getElementsByClassName("associatedconstant"),func);onEachLazy(document.getElementsByClassName("impl"),funcImpl);var impl_call=function(){};if(hideMethodDocs===true){impl_call=function(e,newToggle){if(e.id.match(/^impl(?:-\d+)?$/)===null){if(hasClass(e,"impl")===true){collapseDocs(newToggle,"hide",pageId)}}}}var newToggle=document.createElement("a");newToggle.href="javascript:void(0)";newToggle.className="collapse-toggle hidden-default collapsed";newToggle.innerHTML="[<span class=\"inner\">"+labelForToggleButton(true)+"</span>] Show hidden undocumented items";function toggleClicked(){if(hasClass(this,"collapsed")){removeClass(this,"collapsed");onEachLazy(this.parentNode.getElementsByClassName("hidden"),function(x){if(hasClass(x,"content")===false){removeClass(x,"hidden");addClass(x,"x")}},true);this.innerHTML="[<span class=\"inner\">"+labelForToggleButton(false)+"</span>] Hide undocumented items"}else{addClass(this,"collapsed");onEachLazy(this.parentNode.getElementsByClassName("x"),function(x){if(hasClass(x,"content")===false){addClass(x,"hidden");removeClass(x,"x")}},true);this.innerHTML="[<span class=\"inner\">"+labelForToggleButton(true)+"</span>] Show hidden undocumented items"}}onEachLazy(document.getElementsByClassName("impl-items"),function(e){onEachLazy(e.getElementsByClassName("associatedconstant"),func);var hiddenElems=e.getElementsByClassName("hidden");var needToggle=false;var hlength=hiddenElems.length;for(var i=0;i<hlength;++i){if(hasClass(hiddenElems[i],"content")===false&&hasClass(hiddenElems[i],"docblock")===false){needToggle=true;break}}if(needToggle===true){var inner_toggle=newToggle.cloneNode(true);inner_toggle.onclick=toggleClicked;e.insertBefore(inner_toggle,e.firstChild);impl_call(e.previousSibling,inner_toggle)}});var currentType=document.getElementsByClassName("type-decl")[0];var className=null;if(currentType){currentType=currentType.getElementsByClassName("rust")[0];if(currentType){currentType.classList.forEach(function(item){if(item!=="main"){className=item;return true}})}}var showItemDeclarations=getCurrentValue("rustdoc-auto-hide-"+className);if(showItemDeclarations===null){if(className==="enum"||className==="macro"){showItemDeclarations="false"}else if(className==="struct"||className==="union"||className==="trait"){showItemDeclarations="true"}else{showItemDeclarations=getCurrentValue("rustdoc-auto-hide-declarations")}}showItemDeclarations=showItemDeclarations==="false";function buildToggleWrapper(e){if(hasClass(e,"autohide")){var wrap=e.previousElementSibling;if(wrap&&hasClass(wrap,"toggle-wrapper")){var inner_toggle=wrap.childNodes[0];var extra=e.childNodes[0].tagName==="H3";e.style.display="none";addClass(wrap,"collapsed");onEachLazy(inner_toggle.getElementsByClassName("inner"),function(e){e.innerHTML=labelForToggleButton(true)});onEachLazy(inner_toggle.getElementsByClassName("toggle-label"),function(e){e.style.display="inline-block";if(extra===true){e.innerHTML=" Show "+e.childNodes[0].innerHTML}})}}if(e.parentNode.id==="main"){var otherMessage="";var fontSize;var extraClass;if(hasClass(e,"type-decl")){fontSize="20px";otherMessage=" Show declaration";if(showItemDeclarations===false){extraClass="collapsed"}}else if(hasClass(e,"sub-variant")){otherMessage=" Show fields"}else if(hasClass(e,"non-exhaustive")){otherMessage=" This ";if(hasClass(e,"non-exhaustive-struct")){otherMessage+="struct"}else if(hasClass(e,"non-exhaustive-enum")){otherMessage+="enum"}else if(hasClass(e,"non-exhaustive-variant")){otherMessage+="enum variant"}else if(hasClass(e,"non-exhaustive-type")){otherMessage+="type"}otherMessage+=" is marked as non-exhaustive"}else if(hasClass(e.childNodes[0],"impl-items")){extraClass="marg-left"}e.parentNode.insertBefore(createToggle(toggle,otherMessage,fontSize,extraClass,hasClass(e,"type-decl")===false||showItemDeclarations===true),e);if(hasClass(e,"type-decl")===true&&showItemDeclarations===true){collapseDocs(e.previousSibling.childNodes[0],"toggle")}if(hasClass(e,"non-exhaustive")===true){collapseDocs(e.previousSibling.childNodes[0],"toggle")}}}onEachLazy(document.getElementsByClassName("docblock"),buildToggleWrapper);onEachLazy(document.getElementsByClassName("sub-variant"),buildToggleWrapper);var pageId=getPageId();autoCollapse(pageId,getCurrentValue("rustdoc-collapse")==="true");if(pageId!==null){expandSection(pageId)}}());function createToggleWrapper(tog){var span=document.createElement("span");span.className="toggle-label";span.style.display="none";span.innerHTML=" Expand attributes";tog.appendChild(span);var wrapper=document.createElement("div");wrapper.className="toggle-wrapper toggle-attributes";wrapper.appendChild(tog);return wrapper}(function(){var itemAttributesFunc=function(){};if(getCurrentValue("rustdoc-auto-hide-attributes")!=="false"){itemAttributesFunc=function(x){collapseDocs(x.previousSibling.childNodes[0],"toggle")}}var attributesToggle=createToggleWrapper(createSimpleToggle(false));onEachLazy(main.getElementsByClassName("attributes"),function(i_e){var attr_tog=attributesToggle.cloneNode(true);if(hasClass(i_e,"top-attr")===true){addClass(attr_tog,"top-attr")}i_e.parentNode.insertBefore(attr_tog,i_e);itemAttributesFunc(i_e)})}());(function(){var lineNumbersFunc=function(){};if(getCurrentValue("rustdoc-line-numbers")==="true"){lineNumbersFunc=function(x){var count=x.textContent.split("\n").length;var elems=[];for(var i=0;i<count;++i){elems.push(i+1)}var node=document.createElement("pre");addClass(node,"line-number");node.innerHTML=elems.join("\n");x.parentNode.insertBefore(node,x)}}onEachLazy(document.getElementsByClassName("rust-example-rendered"),function(e){if(hasClass(e,"compile_fail")){e.addEventListener("mouseover",function(){this.parentElement.previousElementSibling.childNodes[0].style.color="#f00"});e.addEventListener("mouseout",function(){this.parentElement.previousElementSibling.childNodes[0].style.color=""})}else if(hasClass(e,"ignore")){e.addEventListener("mouseover",function(){this.parentElement.previousElementSibling.childNodes[0].style.color="#ff9200"});e.addEventListener("mouseout",function(){this.parentElement.previousElementSibling.childNodes[0].style.color=""})}lineNumbersFunc(e)})}());function printTab(nb){if(nb===0||nb===1||nb===2){currentTab=nb}var nb_copy=nb;onEachLazy(document.getElementById("titles").childNodes,function(elem){if(nb_copy===0){addClass(elem,"selected")}else{removeClass(elem,"selected")}nb_copy-=1});onEachLazy(document.getElementById("results").childNodes,function(elem){if(nb===0){elem.style.display=""}else{elem.style.display="none"}nb-=1})}function putBackSearch(search_input){var search=getSearchElement();if(search_input.value!==""&&hasClass(search,"hidden")){showSearchResults(search);if(browserSupportsHistoryApi()){history.replaceState(search_input.value,"","?search="+encodeURIComponent(search_input.value))}}}if(search_input){search_input.onfocus=function(){putBackSearch(this)}}var params=getQueryStringParams();if(params&¶ms.search){var search=getSearchElement();search.innerHTML="<h3 style=\"text-align: center;\">Loading search results...</h3>";showSearchResults(search)}var sidebar_menu=document.getElementsByClassName("sidebar-menu")[0];if(sidebar_menu){sidebar_menu.onclick=function(){var sidebar=document.getElementsByClassName("sidebar")[0];if(hasClass(sidebar,"mobile")===true){hideSidebar()}else{showSidebar()}}}window.onresize=function(){hideSidebar()};if(main){onEachLazy(main.getElementsByClassName("loading-content"),function(e){e.remove()});onEachLazy(main.childNodes,function(e){if(e.tagName==="H2"||e.tagName==="H3"){var nextTagName=e.nextElementSibling.tagName;if(nextTagName=="H2"||nextTagName=="H3"){e.nextElementSibling.style.display="flex"}else{e.nextElementSibling.style.display="block"}}})}window.addSearchOptions=function(crates){var elem=document.getElementById("crate-search");if(!elem){return}var crates_text=[];if(Object.keys(crates).length>1){for(var crate in crates){if(hasOwnProperty(crates,crate)){crates_text.push(crate)}}}crates_text.sort(function(a,b){var lower_a=a.toLowerCase();var lower_b=b.toLowerCase();if(lower_a<lower_b){return-1}else if(lower_a>lower_b){return 1}return 0});var savedCrate=getCurrentValue("rustdoc-saved-filter-crate");for(var i=0;i<crates_text.length;++i){var option=document.createElement("option");option.value=crates_text[i];option.innerText=crates_text[i];elem.appendChild(option);if(crates_text[i]===savedCrate){elem.value=savedCrate}}if(search_input){search_input.removeAttribute('disabled')}};function buildHelperPopup(){var popup=document.createElement("aside");addClass(popup,"hidden");popup.id="help";var container=document.createElement("div");var shortcuts=[["?","Show this help dialog"],["S","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["↹","Switch tab"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"<dt><kbd>"+x[0]+"</kbd></dt><dd>"+x[1]+"</dd>").join("");var div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="<h2>Keyboard Shortcuts</h2><dl>"+shortcuts+"</dl></div>";var infos=["Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to \
- restrict the search to a given type.","Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, \
- <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, \
- and <code>const</code>.","Search functions by type signature (e.g., <code>vec -> usize</code> or \
- <code>* -> vec</code>)","Search multiple things at once by splitting your query with comma (e.g., \
- <code>str,u8</code> or <code>String,struct:Vec,test</code>)","You can look for items with an exact name by putting double quotes around \
- your request: <code>\"string\"</code>","Look for items inside another one by searching for a path: <code>vec::Vec</code>",].map(x=>"<p>"+x+"</p>").join("");var div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="<h2>Search Tricks</h2>"+infos;container.appendChild(div_shortcuts);container.appendChild(div_infos);popup.appendChild(container);insertAfter(popup,getSearchElement())}onHashChange(null);window.onhashchange=onHashChange;buildHelperPopup()}());window.onunload=function(){}
\ No newline at end of file
+++ /dev/null
-/*! normalize.css v3.0.0 | MIT License | git.io/normalize */
-html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}
\ No newline at end of file
+++ /dev/null
-#main>h2+div,#main>h2+h3,#main>h3+div{display:block;}.loading-content{display:none;}#main>h2+div,#main>h3+div{display:block;}#main>h2+h3{display:flex;}
\ No newline at end of file
+++ /dev/null
- @font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular.woff") format('woff');}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium.woff") format('woff');}@font-face {font-family:'Source Serif Pro';font-style:normal;font-weight:400;src:local('Source Serif Pro'),url("SourceSerifPro-Regular.ttf.woff") format('woff');}@font-face {font-family:'Source Serif Pro';font-style:italic;font-weight:400;src:local('Source Serif Pro Italic'),url("SourceSerifPro-It.ttf.woff") format('woff');}@font-face {font-family:'Source Serif Pro';font-style:normal;font-weight:700;src:local('Source Serif Pro Bold'),url("SourceSerifPro-Bold.ttf.woff") format('woff');}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular.woff") format('woff');}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold.woff") format('woff');}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}html{content:"";}@media (prefers-color-scheme:light){html{content:"light";}}@media (prefers-color-scheme:dark){html{content:"dark";}}body{font:16px/1.4 "Source Serif Pro",serif;margin:0;position:relative;padding:10px 15px 20px 15px;-webkit-font-feature-settings:"kern","liga";-moz-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";}h1{font-size:1.5em;}h2{font-size:1.4em;}h3{font-size:1.3em;}h1,h2,h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.important),h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant){font-weight:500;margin:20px 0 15px 0;padding-bottom:6px;}h1.fqn{border-bottom:1px dashed;margin-top:0;}h1.fqn>.in-band>a:hover{text-decoration:underline;}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant){border-bottom:1px solid;}h3.impl,h3.method,h4.method,h3.type,h4.type,h4.associatedconstant{flex-basis:100%;font-weight:600;margin-top:16px;margin-bottom:10px;position:relative;}h3.impl,h3.method,h3.type{padding-left:15px;}h1,h2,h3,h4,.sidebar,a.source,.search-input,.content table :not(code)>a,.collapse-toggle,div.item-list .out-of-band,#source-sidebar,#sidebar-toggle{font-family:"Fira Sans",sans-serif;}ol,ul{padding-left:25px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.6em;}p{margin:0 0 .6em 0;}summary{outline:none;}code,pre,a.test-arrow{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.1em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;}.source .content pre{padding:20px;}img{max-width:100%;}li{position:relative;}.source .content{margin-top:50px;max-width:none;overflow:visible;margin-left:0px;min-width:70em;}nav.sub{font-size:16px;text-transform:uppercase;}.sidebar{width:200px;position:fixed;left:0;top:0;bottom:0;overflow:auto;}*{scrollbar-width:initial;}.sidebar{scrollbar-width:thin;}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;}.sidebar .block>ul>li{margin-right:-10px;}.content,nav{max-width:960px;}.hidden{display:none !important;}.logo-container{height:100px;width:100px;position:relative;margin:20px auto;display:block;margin-top:10px;}.logo-container>img{max-width:100px;max-height:100px;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:block;}.sidebar .location{border:1px solid;font-size:17px;margin:30px 10px 20px 10px;text-align:center;word-wrap:break-word;}.sidebar .version{font-size:15px;text-align:center;border-bottom:1px solid;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;}.location:empty{border:none;}.location a:first-child{font-weight:500;}.block{padding:0;margin-bottom:14px;}.block h2,.block h3{margin-top:0;margin-bottom:8px;text-align:center;}.block ul,.block li{margin:0 10px;padding:0;list-style:none;}.block a{display:block;text-overflow:ellipsis;overflow:hidden;line-height:15px;padding:7px 5px;font-size:14px;font-weight:300;transition:border 500ms ease-out;}.sidebar-title{border-top:1px solid;border-bottom:1px solid;text-align:center;font-size:17px;margin-bottom:5px;}.sidebar-links{margin-bottom:15px;}.sidebar-links>a{padding-left:10px;width:100%;}.sidebar-menu{display:none;}.content{padding:15px 0;}.source .content pre.rust{white-space:pre;overflow:auto;padding-left:0;}.rustdoc:not(.source) .example-wrap{display:inline-flex;margin-bottom:10px;position:relative;}.example-wrap{width:100%;}.example-wrap>pre.line-number{overflow:initial;border:1px solid;border-top-left-radius:5px;border-bottom-left-radius:5px;padding:13px 8px;text-align:right;}.rustdoc:not(.source) .example-wrap>pre.rust{width:100%;overflow-x:auto;}.rustdoc:not(.source) .example-wrap>pre{margin:0;}#search{margin-left:230px;position:relative;}#results{position:absolute;right:0;left:0;overflow:auto;}#results>table{width:100%;table-layout:fixed;}.content pre.line-numbers{float:left;border:none;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.line-numbers span{cursor:pointer;}.docblock-short p{display:inline;}.docblock-short.nowrap{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}.docblock-short p{overflow:hidden;text-overflow:ellipsis;margin:0;}.docblock code,.docblock-short code{white-space:pre-wrap;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom:1px solid;}#main>.docblock h1{font-size:1.3em;}#main>.docblock h2{font-size:1.15em;}#main>.docblock h3,#main>.docblock h4,#main>.docblock h5{font-size:1em;}#main>h2+div,#main>h2+h3,#main>h3+div{display:none;flex-wrap:wrap;}.docblock h1{font-size:1em;}.docblock h2{font-size:0.95em;}.docblock h3,.docblock h4,.docblock h5{font-size:0.9em;}.docblock{margin-left:24px;position:relative;}.content .out-of-band{float:right;font-size:23px;margin:0px;padding:0px;font-weight:normal;}h3.impl>.out-of-band{font-size:21px;}h4.method>.out-of-band{font-size:19px;}h4>code,h3>code,.invisible>code{max-width:calc(100% - 41px);display:block;}.invisible{width:100%;display:inline-block;}.content .in-band{margin:0px;padding:0px;}.in-band>code{display:inline-block;}#main{position:relative;}#main>.since{top:inherit;font-family:"Fira Sans",sans-serif;}.content table:not(.table-display){border-spacing:0 5px;}.content td{vertical-align:top;}.content td:first-child{padding-right:20px;}.content td p:first-child{margin-top:0;}.content td h1,.content td h2{margin-left:0;font-size:1.1em;}.content tr:first-child td{border-top:0;}.docblock table{margin:.5em 0;width:calc(100% - 2px);border:1px dashed;}.docblock table td{padding:.5em;border:1px dashed;}.docblock table th{padding:.5em;text-align:left;border:1px solid;}.fields+table{margin-bottom:1em;}.content .item-list{list-style-type:none;padding:0;}.content .multi-column{-moz-column-count:5;-moz-column-gap:2.5em;-webkit-column-count:5;-webkit-column-gap:2.5em;column-count:5;column-gap:2.5em;}.content .multi-column li{width:100%;display:inline-block;}.content .method{font-size:1em;position:relative;}.content .method .where,.content .fn .where,.content .where.fmt-newline{display:block;font-size:0.8em;}.content .methods>div{margin-left:40px;margin-bottom:15px;}.content .docblock>.impl-items{margin-left:20px;margin-top:-34px;}.content .docblock>.impl-items>h4{border-bottom:0;}.content .docblock>.impl-items .table-display{margin:0;}.content .docblock>.impl-items table td{padding:0;}.toggle-wrapper.marg-left>.collapse-toggle{left:-24px;}.content .docblock>.impl-items .table-display,.impl-items table td{border:none;}.content .stability code{font-size:90%;}.content .stability{position:relative;margin-left:33px;margin-top:-13px;}.sub-variant>div>.stability{margin-top:initial;}.content .stability::before{content:'⬑';font-size:25px;position:absolute;top:-6px;left:-19px;}.content .impl-items .method,.content .impl-items>.type,.impl-items>.associatedconstant{margin-left:20px;}.content .impl-items .docblock,.content .impl-items .stability{margin-bottom:.6em;}.content .impl-items>.stability{margin-left:40px;}.methods>.stability,.content .impl-items>.stability{margin-top:-8px;}.impl-items{flex-basis:100%;}#main>.stability{margin-top:0;}nav:not(.sidebar){border-bottom:1px solid;padding-bottom:10px;margin-bottom:10px;}nav.main{padding:20px 0;text-align:center;}nav.main .current{border-top:1px solid;border-bottom:1px solid;}nav.main .separator{border:1px solid;display:inline-block;height:23px;margin:0 20px;}nav.sum{text-align:right;}nav.sub form{display:inline;}nav.sub,.content{margin-left:230px;}a{text-decoration:none;background:transparent;}.small-section-header:hover>.anchor{display:initial;}.in-band:hover>.anchor,.impl:hover>.anchor{display:inline-block;position:absolute;}.anchor{display:none;position:absolute;left:-7px;}.anchor.field{left:-5px;}.small-section-header>.anchor{left:-28px;padding-right:10px;}.anchor:before{content:'\2002\00a7\2002';}.docblock a:not(.srclink):not(.test-arrow):hover,.docblock-short a:not(.srclink):not(.test-arrow):hover,.stability a{text-decoration:underline;}.invisible>.srclink,h4>code+.srclink{position:absolute;top:0;right:0;font-size:17px;font-weight:normal;}.block a.current.crate{font-weight:500;}.search-container{position:relative;}.search-container>div{display:inline-flex;width:calc(100% - 34px);}#crate-search{margin-top:5px;padding:6px;padding-right:19px;flex:none;border:0;border-right:0;border-radius:4px 0 0 4px;outline:none;cursor:pointer;border-right:1px solid;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;text-overflow:"";background-repeat:no-repeat;background-color:transparent;background-size:20px;background-position:calc(100% - 1px) 56%;}.search-container>.top-button{position:absolute;right:0;top:10px;}.search-input{-moz-box-sizing:border-box !important;box-sizing:border-box !important;outline:none;border:none;border-radius:1px;margin-top:5px;padding:10px 16px;font-size:17px;transition:border-color 300ms ease;transition:border-radius 300ms ease-in-out;transition:box-shadow 300ms ease-in-out;width:100%;}#crate-search+.search-input{border-radius:0 1px 1px 0;width:calc(100% - 32px);}.search-input:focus{border-radius:2px;border:0;outline:0;}.search-results .desc{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:block;}.search-results a{display:block;}.content .search-results td:first-child{padding-right:0;width:50%;}.content .search-results td:first-child a{padding-right:10px;}.content .search-results td:first-child a:after{clear:both;content:"";display:block;}.content .search-results td:first-child a span{float:left;}tr.result span.primitive::after{content:' (primitive type)';font-style:italic;}tr.result span.keyword::after{content:' (keyword)';font-style:italic;}body.blur>:not(#help){filter:blur(8px);-webkit-filter:blur(8px);opacity:.7;}#help{width:100%;height:100vh;position:fixed;top:0;left:0;display:flex;justify-content:center;align-items:center;}#help>div{flex:0 0 auto;box-shadow:0 0 6px rgba(0,0,0,.2);width:550px;height:auto;border:1px solid;}#help dt{float:left;clear:left;display:block;}#help dd{margin:5px 35px;}#help .infos{padding-left:0;}#help h1,#help h2{margin-top:0;}#help>div div{width:50%;float:left;padding:20px;padding-left:17px;}.stab{display:table;border-width:1px;border-style:solid;padding:3px;margin-bottom:5px;font-size:90%;}.stab p{display:inline;}.stab summary{display:list-item;}.stab .emoji{font-size:1.5em;}.module-item .stab{border-radius:3px;display:inline-block;font-size:80%;line-height:1.2;margin-bottom:0;margin-right:.3em;padding:2px;vertical-align:text-bottom;}.module-item.unstable{opacity:0.65;}.since{font-weight:normal;font-size:initial;position:absolute;right:0;top:0;}.impl-items .since,.impl .since{flex-grow:0;padding-left:12px;padding-right:2px;position:initial;}.impl-items .srclink,.impl .srclink{flex-grow:0;font-size:17px;font-weight:normal;}.impl-items code,.impl code{flex-grow:1;}.impl-items h4,h4.impl,h3.impl{display:flex;flex-basis:100%;font-size:16px;margin-bottom:12px;justify-content:space-between;}.variants_table{width:100%;}.variants_table tbody tr td:first-child{width:1%;}td.summary-column{width:100%;}.summary{padding-right:0px;}pre.rust .question-mark{font-weight:bold;}a.test-arrow{display:inline-block;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:130%;top:5px;right:5px;z-index:1;}a.test-arrow:hover{text-decoration:none;}.section-header:hover a:before{position:absolute;left:-25px;padding-right:10px;content:'\2002\00a7\2002';}.section-header:hover a{text-decoration:none;}.section-header a{color:inherit;}.collapse-toggle{font-weight:300;position:absolute;left:-23px;top:0;}h3>.collapse-toggle,h4>.collapse-toggle{font-size:0.8em;top:5px;}.toggle-wrapper>.collapse-toggle{left:-24px;margin-top:0px;}.toggle-wrapper{position:relative;margin-top:0;}.toggle-wrapper.collapsed{height:25px;transition:height .2s;margin-bottom:.6em;}.collapse-toggle>.inner{display:inline-block;width:1.2ch;text-align:center;}.collapse-toggle.hidden-default{position:relative;margin-left:20px;}.since+.srclink{display:table-cell;padding-left:10px;}.item-spacer{width:100%;height:12px;}.out-of-band>span.since{position:initial;font-size:20px;margin-right:5px;}.toggle-wrapper>.collapse-toggle{left:0;}.variant+.toggle-wrapper+.docblock>p{margin-top:5px;}.sub-variant,.sub-variant>h3{margin-top:1px !important;}#main>.sub-variant>h3{font-size:15px;margin-left:25px;margin-bottom:5px;}.sub-variant>div{margin-left:20px;margin-bottom:10px;}.sub-variant>div>span{display:block;position:relative;}.toggle-label{display:inline-block;margin-left:4px;margin-top:3px;}.enum>.toggle-wrapper+.docblock,.struct>.toggle-wrapper+.docblock{margin-left:30px;margin-bottom:20px;margin-top:5px;}.docblock>.section-header:first-child{margin-left:15px;margin-top:0;}.docblock>.section-header:first-child:hover>a:before{left:-10px;}.enum>.collapsed,.struct>.collapsed{margin-bottom:25px;}#main>.variant,#main>.structfield{display:block;}.attributes{display:block;margin-top:0px !important;margin-right:0px;margin-bottom:0px !important;margin-left:30px;}.toggle-attributes.collapsed{margin-bottom:0;}.impl-items>.toggle-attributes{margin-left:20px;}.impl-items .attributes{font-weight:500;}:target>code{opacity:1;}.information{position:absolute;left:-25px;margin-top:7px;z-index:1;}.tooltip{position:relative;display:inline-block;cursor:pointer;}.tooltip .tooltiptext{width:120px;display:none;text-align:center;padding:5px 3px 3px 3px;border-radius:6px;margin-left:5px;top:-5px;left:105%;z-index:10;font-size:16px;}.tooltip:hover .tooltiptext{display:inline;}.tooltip .tooltiptext::after{content:" ";position:absolute;top:50%;left:16px;margin-top:-5px;border-width:5px;border-style:solid;}.tooltip.compile_fail,.tooltip.should_panic,.tooltip.ignore{font-weight:bold;font-size:20px;}.tooltip .tooltiptext{border:1px solid;font-weight:normal;}pre.rust{position:relative;tab-size:4;-moz-tab-size:4;}.search-failed{text-align:center;margin-top:20px;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#titles{height:35px;}#titles>div{float:left;width:33.3%;text-align:center;font-size:18px;cursor:pointer;border-top:2px solid;}#titles>div:not(:last-child){margin-right:1px;width:calc(33.3% - 1px);}#titles>div>div.count{display:inline-block;font-size:16px;}#all-types{text-align:center;border:1px solid;margin:0 10px;margin-bottom:10px;display:block;border-radius:7px;}#all-types>p{margin:5px 0;}#sidebar-toggle{position:fixed;top:30px;left:300px;z-index:10;padding:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;cursor:pointer;font-weight:bold;transition:left .5s;font-size:1.2em;border:1px solid;border-left:0;}#source-sidebar{position:fixed;top:0;bottom:0;left:0;width:300px;z-index:1;overflow:auto;transition:left .5s;border-right:1px solid;}#source-sidebar>.title{font-size:1.5em;text-align:center;border-bottom:1px solid;margin-bottom:6px;}.theme-picker{position:absolute;left:211px;top:19px;}.theme-picker button{outline:none;}#settings-menu{position:absolute;right:0;top:10px;outline:none;}#theme-picker,#settings-menu{padding:4px;width:27px;height:29px;border:1px solid;border-radius:3px;cursor:pointer;}#theme-choices{display:none;position:absolute;left:0;top:28px;border:1px solid;border-radius:3px;z-index:1;cursor:pointer;}#theme-choices>button{border:none;width:100%;padding:4px;text-align:center;background:rgba(0,0,0,0);}#theme-choices>button:not(:first-child){border-top:1px solid;}@media (max-width:700px){body{padding-top:0px;}.rustdoc>.sidebar{height:45px;min-height:40px;margin:0;margin-left:-15px;padding:0 15px;position:static;z-index:11;}.sidebar>.location{float:right;margin:0px;margin-top:2px;padding:3px 10px 1px 10px;min-height:39px;background:inherit;text-align:left;font-size:24px;}.sidebar .location:empty{padding:0;}.sidebar .logo-container{width:35px;height:35px;margin-top:5px;margin-bottom:5px;float:left;margin-left:50px;}.sidebar .logo-container>img{max-width:35px;max-height:35px;}.sidebar-menu{position:fixed;z-index:10;font-size:2rem;cursor:pointer;width:45px;left:0;text-align:center;display:block;border-bottom:1px solid;border-right:1px solid;height:45px;}.rustdoc.source>.sidebar>.sidebar-menu{display:none;}.sidebar-elems{position:fixed;z-index:1;left:0;top:45px;bottom:0;overflow-y:auto;border-right:1px solid;display:none;}.sidebar>.block.version{border-bottom:none;margin-top:12px;}nav.sub{width:calc(100% - 32px);float:right;}.content{margin-left:0px;}#main{margin-top:45px;padding:0;}.content .in-band{width:100%;}.content h4>.out-of-band{position:inherit;}.toggle-wrapper>.collapse-toggle{left:0px;}.toggle-wrapper{height:1.5em;}#search{margin-left:0;}.content .impl-items .method,.content .impl-items>.type,.impl-items>.associatedconstant{display:flex;}.anchor{display:none !important;}h1.fqn{overflow:initial;}.theme-picker{left:10px;top:54px;z-index:1;}#titles>div>div.count{float:left;width:100%;}#titles{height:50px;}.sidebar.mobile{position:fixed;width:100%;margin-left:0;background-color:rgba(0,0,0,0);height:100%;}.sidebar{width:calc(100% + 30px);}.show-it{display:block;width:246px;}.show-it>.block.items{margin:8px 0;}.show-it>.block.items>ul{margin:0;}.show-it>.block.items>ul>li{text-align:center;margin:2px 0;}.show-it>.block.items>ul>li>a{font-size:21px;}#sidebar-filler{position:fixed;left:45px;width:calc(100% - 45px);top:0;height:45px;z-index:-1;border-bottom:1px solid;}.collapse-toggle{left:-20px;}.impl>.collapse-toggle{left:-10px;}#all-types{margin:10px;}#sidebar-toggle{top:100px;width:30px;font-size:1.5rem;text-align:center;padding:0;}#source-sidebar{z-index:11;}#main>.line-numbers{margin-top:0;}}@media print{nav.sub,.content .out-of-band,.collapse-toggle{display:none;}}@media (max-width:416px){#titles{height:73px;}#titles>div{height:73px;}}h3.important{margin:0;margin-bottom:13px;font-size:19px;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px;border-radius:3px;box-shadow:inset 0 -1px 0;cursor:default;}.hidden-by-impl-hider,.hidden-by-usual-hider{display:none !important;}#implementations-list>h3>span.in-band{width:100%;}.table-display{width:100%;border:0;border-collapse:collapse;border-spacing:0;font-size:16px;}.table-display tr td:first-child{padding-right:0;}.table-display tr td:last-child{float:right;}.table-display .out-of-band{position:relative;font-size:19px;display:block;}#implementors-list>.impl-items .table-display .out-of-band{font-size:17px;}.table-display td:hover .anchor{display:block;top:2px;left:-5px;}#main>ul{padding-left:10px;}#main>ul>li{list-style:none;}.non-exhaustive{margin-bottom:1em;}div.children{padding-left:27px;display:none;}div.name{cursor:pointer;position:relative;margin-left:16px;}div.files>a{display:block;padding:0 3px;}div.files>a:hover,div.name:hover{background-color:#a14b4b;}div.name.expand+.children{display:block;}div.name::before{content:"\25B6";padding-left:4px;font-size:0.7em;position:absolute;left:-16px;top:4px;}div.name.expand::before{transform:rotate(90deg);left:-15px;top:2px;}.type-decl>pre>.toggle-wrapper.toggle-attributes.top-attr{margin-left:0 !important;}.type-decl>pre>.docblock.attributes.top-attr{margin-left:1.8em !important;}.type-decl>pre>.toggle-attributes{margin-left:2.2em;}.type-decl>pre>.docblock.attributes{margin-left:4em;}
\ No newline at end of file
+++ /dev/null
-var searchIndex = JSON.parse('{\
-"magical":{"doc":"","i":[[3,"FeeRate","magical","Fee rate",null,null],[3,"UTXO","","A wallet unspent output",null,null],[12,"outpoint","","",0,null],[12,"txout","","",0,null],[12,"is_internal","","",0,null],[3,"TransactionDetails","","A wallet transaction",null,null],[12,"transaction","","",1,null],[12,"txid","","",1,null],[12,"timestamp","","",1,null],[12,"received","","",1,null],[12,"sent","","",1,null],[12,"fees","","",1,null],[12,"height","","",1,null],[4,"Error","","Errors that can be thrown by the `Wallet`",null,null],[13,"KeyMismatch","","",2,null],[13,"MissingInputUTXO","","",2,null],[13,"InvalidU32Bytes","","",2,null],[13,"Generic","","",2,null],[13,"ScriptDoesntHaveAddressForm","","",2,null],[13,"SendAllMultipleOutputs","","",2,null],[13,"NoAddressees","","",2,null],[13,"OutputBelowDustLimit","","",2,null],[13,"InsufficientFunds","","",2,null],[13,"InvalidAddressNetwork","","",2,null],[13,"UnknownUTXO","","",2,null],[13,"DifferentTransactions","","",2,null],[13,"TransactionNotFound","","",2,null],[13,"TransactionConfirmed","","",2,null],[13,"IrreplaceableTransaction","","",2,null],[13,"FeeRateTooLow","","",2,null],[12,"required","magical::Error","",3,null],[13,"ChecksumMismatch","magical","",2,null],[13,"DifferentDescriptorStructure","","",2,null],[13,"SpendingPolicyRequired","","",2,null],[13,"InvalidPolicyPathError","","",2,null],[13,"Signer","","",2,null],[13,"Uncapable","","",2,null],[13,"OfflineClient","","",2,null],[13,"InvalidProgressValue","","",2,null],[13,"ProgressUpdateError","","",2,null],[13,"MissingCachedAddresses","","",2,null],[13,"InvalidOutpoint","","",2,null],[13,"Descriptor","","",2,null],[13,"AddressValidator","","",2,null],[13,"Encode","","",2,null],[13,"Miniscript","","",2,null],[13,"BIP32","","",2,null],[13,"Secp256k1","","",2,null],[13,"JSON","","",2,null],[13,"Hex","","",2,null],[13,"PSBT","","",2,null],[13,"Electrum","","",2,null],[13,"Esplora","","",2,null],[13,"CompactFilters","","",2,null],[13,"Sled","","",2,null],[4,"ScriptType","","Types of script",null,null],[13,"External","","",4,null],[13,"Internal","","",4,null],[0,"blockchain","","Blockchain backends",null,null],[3,"OfflineBlockchain","magical::blockchain","Type that only implements [`Blockchain`] and is always…",null,null],[3,"NoopProgress","","Type that implements [`Progress`] and drops every update…",null,null],[3,"LogProgress","","Type that implements [`Progress`] and logs at level `INFO`…",null,null],[4,"Capability","","Capabilities that can be supported by an…",null,null],[13,"FullHistory","","Can recover the full history of a wallet and not only the…",5,null],[13,"GetAnyTx","","Can fetch any historical transaction given its txid",5,null],[13,"AccurateFees","","Can compute accurate fees for the transactions found…",5,null],[5,"progress","","Shortcut to create a [`channel`] (pair of [`Sender`] and…",null,[[]]],[5,"noop_progress","","Create a new instance of [`NoopProgress`]",null,[[],["noopprogress",3]]],[5,"log_progress","","Create a nwe instance of [`LogProgress`]",null,[[],["logprogress",3]]],[0,"electrum","","Electrum",null,null],[3,"ElectrumBlockchain","magical::blockchain::electrum","Wrapper over an Electrum Client that implements the…",null,null],[0,"esplora","magical::blockchain","Esplora",null,null],[3,"EsploraBlockchain","magical::blockchain::esplora","Structure that implements the logic to sync with Esplora",null,null],[4,"EsploraError","","Errors that can happen during a sync with…",null,null],[13,"Reqwest","","Error with the HTTP call",6,null],[13,"Parsing","","Invalid number returned",6,null],[13,"BitcoinEncoding","","Invalid Bitcoin data returned",6,null],[13,"TransactionNotFound","","Transaction not found",6,null],[11,"new","","Create a new instance of the client from a base URL",7,[[]]],[0,"compact_filters","magical::blockchain","Compact Filters",null,null],[3,"Mempool","magical::blockchain::compact_filters","Container for unconfirmed, but valid Bitcoin transactions",null,null],[3,"Peer","","A Bitcoin peer",null,null],[3,"CompactFiltersBlockchain","","Structure implementing the required blockchain traits",null,null],[4,"CompactFiltersError","","An error that can occur during sync with a…",null,null],[13,"InvalidResponse","","A peer sent an invalid or unexpected response",8,null],[13,"InvalidHeaders","","The headers returned are invalid",8,null],[13,"InvalidFilterHeader","","The compact filter headers returned are invalid",8,null],[13,"InvalidFilter","","The compact filter returned is invalid",8,null],[13,"MissingBlock","","The peer is missing a block in the valid chain",8,null],[13,"DataCorruption","","The data stored in the block filters storage are corrupted",8,null],[13,"NotConnected","","A peer is not connected",8,null],[13,"Timeout","","A peer took too long to reply to one of our messages",8,null],[13,"NoPeers","","No peers have been specified",8,null],[13,"DB","","Internal database error",8,null],[13,"IO","","Internal I/O error",8,null],[13,"BIP158","","Invalid BIP158 filter",8,null],[13,"Time","","Internal system time error",8,null],[13,"Global","","Wrapper for [`crate::error::Error`]",8,null],[11,"add_tx","","Add a transaction to the mempool",9,[[["transaction",3]]]],[11,"get_tx","","Look-up a transaction in the mempool given an…",9,[[["inventory",4]],[["option",4],["transaction",3]]]],[11,"has_tx","","Return whether or not the mempool contains a transaction…",9,[[["txid",3]]]],[11,"iter_txs","","Return the list of transactions contained in the mempool",9,[[],[["transaction",3],["vec",3]]]],[11,"connect","","Connect to a peer over a plaintext TCP connection",10,[[["mempool",3],["tosocketaddrs",8],["arc",3],["network",4]],[["result",4],["compactfilterserror",4]]]],[11,"connect_proxy","","Connect to a peer through a SOCKS5 proxy, optionally by…",10,[[["mempool",3],["tosocketaddrs",8],["option",4],["totargetaddr",8],["arc",3],["network",4]],[["result",4],["compactfilterserror",4]]]],[11,"get_version","","Return the [`VersionMessage`] sent by the peer",10,[[],["versionmessage",3]]],[11,"get_network","","Return the Bitcoin [`Network`] in use",10,[[],["network",4]]],[11,"get_mempool","","Return the mempool used by this peer",10,[[],[["mempool",3],["arc",3]]]],[11,"is_connected","","Return whether or not the peer is still connected",10,[[]]],[11,"send","","Send a raw Bitcoin message to the peer",10,[[["networkmessage",4]],[["result",4],["compactfilterserror",4]]]],[11,"recv","","Waits for a specific incoming Bitcoin message, optionally…",10,[[["option",4],["duration",3]],[["result",4],["compactfilterserror",4],["option",4]]]],[11,"new","","Construct a new instance given a list of peers, a path to…",11,[[["asref",8],["option",4],["peer",3],["vec",3],["path",3]],[["result",4],["compactfilterserror",4]]]],[6,"ProgressData","magical::blockchain","Data sent with a progress update over a [`channel`]",null,null],[8,"Blockchain","","Base trait for a blockchain backend",null,null],[10,"is_online","","Return whether or not the client has the ability to…",12,[[]]],[10,"offline","","Create a new instance of the client that is offline-only",12,[[]]],[8,"OnlineBlockchain","","Trait that defines the actions that must be supported by…",null,null],[10,"get_capabilities","","Return the set of [`Capability`] supported by this backend",13,[[],[["hashset",3],["capability",4]]]],[10,"setup","","Setup the backend and populate the internal database for…",13,[[["option",4],["progress",8]],[["error",4],["result",4]]]],[11,"sync","","Populate the internal database with transactions and UTXOs",13,[[["option",4],["progress",8]],[["error",4],["result",4]]]],[10,"get_tx","","Fetch a transaction from the blockchain given its txid",13,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[10,"broadcast","","Broadcast a transaction",13,[[["transaction",3]],[["error",4],["result",4]]]],[10,"get_height","","Return the current height",13,[[],[["result",4],["error",4]]]],[10,"estimate_fee","","Estimate the fee rate required to confirm a transaction in…",13,[[],[["result",4],["feerate",3],["error",4]]]],[8,"Progress","","Trait for types that can receive and process progress…",null,null],[10,"update","","Send a new progress update",14,[[["string",3],["option",4]],[["error",4],["result",4]]]],[0,"database","magical","Database types",null,null],[0,"memory","magical::database","In-memory ephemeral database",null,null],[3,"MemoryDatabase","magical::database::memory","In-memory ephemeral database",null,null],[11,"new","","Create a new empty database",15,[[]]],[8,"BatchOperations","magical::database","Trait for operations that can be batched",null,null],[10,"set_script_pubkey","","Store a script_pubkey along with its script type and child…",16,[[["script",3],["scripttype",4]],[["error",4],["result",4]]]],[10,"set_utxo","","Store a [`UTXO`]",16,[[["utxo",3]],[["error",4],["result",4]]]],[10,"set_raw_tx","","Store a raw transaction",16,[[["transaction",3]],[["error",4],["result",4]]]],[10,"set_tx","","Store the metadata of a transaction",16,[[["transactiondetails",3]],[["error",4],["result",4]]]],[10,"set_last_index","","Store the last derivation index for a given script type",16,[[["scripttype",4]],[["error",4],["result",4]]]],[10,"del_script_pubkey_from_path","","Delete a script_pubkey given the script type and its child…",16,[[["scripttype",4]],[["error",4],["result",4],["option",4]]]],[10,"del_path_from_script_pubkey","","Delete the data related to a specific script_pubkey,…",16,[[["script",3]],[["result",4],["option",4],["error",4]]]],[10,"del_utxo","","Delete a [`UTXO`] given its [`OutPoint`]",16,[[["outpoint",3]],[["result",4],["option",4],["error",4]]]],[10,"del_raw_tx","","Delete a raw transaction given its [`Txid`]",16,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[10,"del_tx","","Delete the metadata of a transaction and optionally the…",16,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[10,"del_last_index","","Delete the last derivation index for a script type",16,[[["scripttype",4]],[["option",4],["result",4],["error",4]]]],[8,"Database","","Trait for reading data from a database",null,null],[10,"check_descriptor_checksum","","Read and checks the descriptor checksum for a given script…",17,[[["scripttype",4],["asref",8]],[["error",4],["result",4]]]],[10,"iter_script_pubkeys","","Return the list of script_pubkeys",17,[[["option",4],["scripttype",4]],[["result",4],["vec",3],["error",4]]]],[10,"iter_utxos","","Return the list of [`UTXO`]s",17,[[],[["error",4],["vec",3],["result",4]]]],[10,"iter_raw_txs","","Return the list of raw transactions",17,[[],[["result",4],["vec",3],["error",4]]]],[10,"iter_txs","","Return the list of transactions metadata",17,[[],[["result",4],["vec",3],["error",4]]]],[10,"get_script_pubkey_from_path","","Fetch a script_pubkey given the script type and child number",17,[[["scripttype",4]],[["error",4],["result",4],["option",4]]]],[10,"get_path_from_script_pubkey","","Fetch the script type and child number of a given…",17,[[["script",3]],[["result",4],["option",4],["error",4]]]],[10,"get_utxo","","Fetch a [`UTXO`] given its [`OutPoint`]",17,[[["outpoint",3]],[["result",4],["option",4],["error",4]]]],[10,"get_raw_tx","","Fetch a raw transaction given its [`Txid`]",17,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[10,"get_tx","","Fetch the transaction metadata and optionally also the raw…",17,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[10,"get_last_index","","Return the last defivation index for a script type",17,[[["scripttype",4]],[["option",4],["result",4],["error",4]]]],[10,"increment_last_index","","Increment the last derivation index for a script type and…",17,[[["scripttype",4]],[["result",4],["error",4]]]],[8,"BatchDatabase","","Trait for a database that supports batch operations",null,null],[16,"Batch","","Container for the operations",18,null],[10,"begin_batch","","Create a new batch container",18,[[]]],[10,"commit_batch","","Consume and apply a batch of operations",18,[[],[["error",4],["result",4]]]],[0,"descriptor","magical","Descriptors",null,null],[4,"Descriptor","magical::descriptor","Script descriptor",null,null],[13,"Bare","","A raw scriptpubkey (including pay-to-pubkey) under Legacy…",19,null],[13,"Pk","","Pay-to-Pubkey",19,null],[13,"Pkh","","Pay-to-PubKey-Hash",19,null],[13,"Wpkh","","Pay-to-Witness-PubKey-Hash",19,null],[13,"ShWpkh","","Pay-to-Witness-PubKey-Hash inside P2SH",19,null],[13,"Sh","","Pay-to-ScriptHash with Legacy context",19,null],[13,"Wsh","","Pay-to-Witness-ScriptHash with Segwitv0 context",19,null],[13,"ShWsh","","P2SH-P2WSH with Segwitv0 context",19,null],[4,"Legacy","","Legacy ScriptContext",null,null],[3,"Miniscript","","Top-level script AST type",null,null],[12,"node","","A node in the Abstract Syntax Tree(",20,null],[12,"ty","","The correctness and malleability type information for the…",20,null],[12,"ext","","Additional information helpful for extra analysis.",20,null],[8,"MiniscriptKey","","Public key trait which can be converted to Hash type",null,null],[11,"is_uncompressed","","Check if the publicKey is uncompressed. The default…",21,[[]]],[16,"Hash","","The associated Hash type with the publicKey",21,null],[10,"to_pubkeyhash","","Converts an object to PublicHash",21,[[]]],[8,"ScriptContext","","",null,null],[10,"check_frag_non_malleable","","Depending on ScriptContext, fragments can be malleable.…",22,[[["terminal",4]],[["scriptcontexterror",4],["result",4]]]],[10,"check_frag_validity","","Depending on script Context, some of the Terminals might…",22,[[["terminal",4]],[["scriptcontexterror",4],["result",4]]]],[4,"Segwitv0","","Segwitv0 ScriptContext",null,null],[4,"Terminal","","All AST elements",null,null],[13,"True","","`1`",23,null],[13,"False","","`0`",23,null],[13,"PkK","","`<key>`",23,null],[13,"PkH","","`DUP HASH160 <keyhash> EQUALVERIFY`",23,null],[13,"After","","`n CHECKLOCKTIMEVERIFY`",23,null],[13,"Older","","`n CHECKSEQUENCEVERIFY`",23,null],[13,"Sha256","","`SIZE 32 EQUALVERIFY SHA256 <hash> EQUAL`",23,null],[13,"Hash256","","`SIZE 32 EQUALVERIFY HASH256 <hash> EQUAL`",23,null],[13,"Ripemd160","","`SIZE 32 EQUALVERIFY RIPEMD160 <hash> EQUAL`",23,null],[13,"Hash160","","`SIZE 32 EQUALVERIFY HASH160 <hash> EQUAL`",23,null],[13,"Alt","","`TOALTSTACK [E] FROMALTSTACK`",23,null],[13,"Swap","","`SWAP [E1]`",23,null],[13,"Check","","`[Kt]/[Ke] CHECKSIG`",23,null],[13,"DupIf","","`DUP IF [V] ENDIF`",23,null],[13,"Verify","","[T] VERIFY",23,null],[13,"NonZero","","SIZE 0NOTEQUAL IF [Fn] ENDIF",23,null],[13,"ZeroNotEqual","","[X] 0NOTEQUAL",23,null],[13,"AndV","","[V] [T]/[V]/[F]/[Kt]",23,null],[13,"AndB","","[E] [W] BOOLAND",23,null],[13,"AndOr","","[various] NOTIF [various] ELSE [various] ENDIF",23,null],[13,"OrB","","[E] [W] BOOLOR",23,null],[13,"OrD","","[E] IFDUP NOTIF [T]/[E] ENDIF",23,null],[13,"OrC","","[E] NOTIF [V] ENDIF",23,null],[13,"OrI","","IF [various] ELSE [various] ENDIF",23,null],[13,"Thresh","","[E] ([W] ADD)* k EQUAL",23,null],[13,"Multi","","k ()* n CHECKMULTISIG",23,null],[8,"ToPublicKey","","Trait describing public key types which can be converted…",null,null],[10,"to_public_key","","Converts an object to a public key",24,[[],["publickey",3]]],[11,"serialized_len","","Computes the size of a public key when serialized in a…",24,[[]]],[10,"hash_to_hash160","","Converts a hashed version of the public key to a `hash160`…",24,[[],["hash",3]]],[0,"checksum","","Descriptor checksum",null,null],[5,"get_checksum","magical::descriptor::checksum","Compute the checksum of a descriptor",null,[[],[["string",3],["error",4],["result",4]]]],[0,"error","magical::descriptor","Descriptor errors",null,null],[4,"Error","magical::descriptor::error","Errors related to the parsing and usage of descriptors",null,null],[13,"InternalError","","",25,null],[13,"InvalidPrefix","","",25,null],[13,"HardenedDerivationOnXpub","","",25,null],[13,"MalformedInput","","",25,null],[13,"KeyParsingError","","",25,null],[13,"Policy","","",25,null],[13,"InputIndexDoesntExist","","",25,null],[13,"MissingPublicKey","","",25,null],[13,"MissingDetails","","",25,null],[13,"InvalidDescriptorCharacter","","",25,null],[13,"CantDeriveWithMiniscript","","",25,null],[13,"BIP32","","",25,null],[13,"Base58","","",25,null],[13,"PK","","",25,null],[13,"Miniscript","","",25,null],[13,"Hex","","",25,null],[0,"policy","magical::descriptor","Descriptor policy",null,null],[3,"PKOrF","magical::descriptor::policy","Raw public key or extended key fingerprint",null,null],[3,"Policy","","Descriptor spending policy",null,null],[12,"id","","Identifier for this policy node",26,null],[12,"item","","Type of this policy node",26,null],[12,"satisfaction","","How a much given PSBT already satisfies this polcy node…",26,null],[12,"contribution","","How the wallet\'s descriptor can satisfy this policy node",26,null],[3,"Condition","","An extra condition that must be satisfied but that is out…",null,null],[12,"csv","","",27,null],[12,"timelock","","",27,null],[4,"SatisfiableItem","","An item that need to be satisfied",null,null],[13,"Signature","","",28,null],[13,"SignatureKey","","",28,null],[13,"SHA256Preimage","","",28,null],[12,"hash","magical::descriptor::policy::SatisfiableItem","",29,null],[13,"HASH256Preimage","magical::descriptor::policy","",28,null],[12,"hash","magical::descriptor::policy::SatisfiableItem","",30,null],[13,"RIPEMD160Preimage","magical::descriptor::policy","",28,null],[12,"hash","magical::descriptor::policy::SatisfiableItem","",31,null],[13,"HASH160Preimage","magical::descriptor::policy","",28,null],[12,"hash","magical::descriptor::policy::SatisfiableItem","",32,null],[13,"AbsoluteTimelock","magical::descriptor::policy","",28,null],[12,"value","magical::descriptor::policy::SatisfiableItem","",33,null],[13,"RelativeTimelock","magical::descriptor::policy","",28,null],[12,"value","magical::descriptor::policy::SatisfiableItem","",34,null],[13,"Thresh","magical::descriptor::policy","",28,null],[12,"items","magical::descriptor::policy::SatisfiableItem","",35,null],[12,"threshold","","",35,null],[13,"Multisig","magical::descriptor::policy","",28,null],[12,"keys","magical::descriptor::policy::SatisfiableItem","",36,null],[12,"threshold","","",36,null],[4,"Satisfaction","magical::descriptor::policy","Represent if and how much a policy item is satisfied by…",null,null],[13,"Partial","","Only a partial satisfaction of some kind of threshold policy",37,null],[12,"n","magical::descriptor::policy::Satisfaction","Total number of items",38,null],[12,"m","","Threshold",38,null],[12,"items","","The items that can be satisfied by the descriptor",38,null],[12,"conditions","","Extra conditions that also need to be satisfied",38,null],[13,"PartialComplete","magical::descriptor::policy","Can reach the threshold of some kind of threshold policy",37,null],[12,"n","magical::descriptor::policy::Satisfaction","Total number of items",39,null],[12,"m","","Threshold",39,null],[12,"items","","The items that can be satisfied by the descriptor",39,null],[12,"conditions","","Extra conditions that also need to be satisfied",39,null],[13,"Complete","magical::descriptor::policy","Can satisfy the policy item",37,null],[12,"condition","magical::descriptor::policy::Satisfaction","Extra conditions that also need to be satisfied",40,null],[13,"None","magical::descriptor::policy","Cannot satisfy or contribute to the policy item",37,null],[4,"PolicyError","","Errors that can happen while extracting and manipulating…",null,null],[13,"NotEnoughItemsSelected","","",41,null],[13,"TooManyItemsSelected","","",41,null],[13,"IndexOutOfRange","","",41,null],[13,"AddOnLeaf","","",41,null],[13,"AddOnPartialComplete","","",41,null],[13,"MixedTimelockUnits","","",41,null],[13,"IncompatibleConditions","","",41,null],[6,"ConditionMap","","",null,null],[6,"FoldedConditionMap","","",null,null],[11,"is_leaf","","",28,[[]]],[11,"id","","",28,[[],["string",3]]],[11,"is_leaf","","",37,[[]]],[11,"is_null","","",27,[[]]],[11,"requires_path","","Return whether or not a specific path in the policy tree…",26,[[]]],[11,"get_condition","","Return the conditions that are set by the spending policy…",26,[[["btreemap",3]],[["condition",3],["policyerror",4],["result",4]]]],[6,"ExtendedDescriptor","magical::descriptor","Alias for a [`Descriptor`] that can contain extended keys…",null,null],[6,"HDKeyPaths","","Alias for the type of maps that represent derivation paths…",null,null],[8,"ExtractPolicy","","Trait implemented on [`Descriptor`]s to add a method to…",null,null],[10,"extract_policy","","",42,[[["arc",3],["signerscontainer",3]],[["result",4],["option",4],["error",4]]]],[11,"as_byte","magical","",4,[[]]],[11,"is_internal","","",4,[[]]],[11,"from_btc_per_kvb","","Create a new instance of [`FeeRate`] given a float fee…",43,[[]]],[11,"from_sat_per_vb","","Create a new instance of [`FeeRate`] given a float fee…",43,[[]]],[11,"default_min_relay_fee","","Create a new [`FeeRate`] with the default min relay fee…",43,[[]]],[11,"as_sat_vb","","Return the value as satoshi/vbyte",43,[[]]],[0,"wallet","","Wallet",null,null],[3,"Wallet","magical::wallet","A Bitcoin wallet",null,null],[0,"address_validator","","Address validation callbacks",null,null],[4,"AddressValidatorError","magical::wallet::address_validator","Errors that can be returned to fail the validation of an…",null,null],[13,"UserRejected","","",44,null],[13,"ConnectionError","","",44,null],[13,"TimeoutError","","",44,null],[13,"InvalidScript","","",44,null],[13,"Message","","",44,null],[8,"AddressValidator","","Trait to build address validators",null,null],[10,"validate","","Validate or inspect an address",45,[[["script",3],["scripttype",4],["hdkeypaths",6]],[["result",4],["addressvalidatorerror",4]]]],[0,"coin_selection","magical::wallet","Coin selection",null,null],[3,"CoinSelectionResult","magical::wallet::coin_selection","Result of a successful coin selection",null,null],[12,"txin","","List of inputs to use, with the respective previous…",46,null],[12,"selected_amount","","Sum of the selected inputs\' value",46,null],[12,"fee_amount","","Total fee amount in satoshi",46,null],[3,"DumbCoinSelection","","Simple and dumb coin selection",null,null],[6,"DefaultCoinSelectionAlgorithm","","Default coin selection algorithm used by `TxBuilder` if…",null,null],[8,"CoinSelectionAlgorithm","","Trait for generalized coin selection algorithms",null,null],[10,"coin_select","","Perform the coin selection",47,[[["utxo",3],["vec",3],["feerate",3]],[["coinselectionresult",3],["result",4],["error",4]]]],[0,"export","magical::wallet","Wallet export",null,null],[3,"WalletExport","magical::wallet::export","Structure that contains the export of a wallet",null,null],[12,"blockheight","","Earliest block to rescan when looking for the wallet\'s…",48,null],[12,"label","","Arbitrary label for the wallet",48,null],[11,"export_wallet","","Export a wallet",48,[[["wallet",3]],["result",4]]],[11,"descriptor","","Return the external descriptor",48,[[],["string",3]]],[11,"change_descriptor","","Return the internal descriptor, if present",48,[[],[["string",3],["option",4]]]],[0,"signer","magical::wallet","Generalized signers",null,null],[3,"SignerOrdering","magical::wallet::signer","Defines the order in which signers are called",null,null],[12,"0","","",49,null],[3,"SignersContainer","","Container for multiple signers",null,null],[4,"SignerId","","Identifier of a signer in the `SignersContainers`. Used as…",null,null],[13,"PkHash","","",50,null],[13,"Fingerprint","","",50,null],[4,"SignerError","","Signing error",null,null],[13,"MissingKey","","The private key is missing for the required public key",51,null],[13,"UserCanceled","","The user canceled the operation",51,null],[13,"MissingSighash","","The sighash is missing in the PSBT input",51,null],[13,"InputIndexOutOfRange","","Input index is out of range",51,null],[13,"MissingNonWitnessUtxo","","The `non_witness_utxo` field of the transaction is…",51,null],[13,"InvalidNonWitnessUtxo","","The `non_witness_utxo` specified is invalid",51,null],[13,"MissingWitnessUtxo","","The `witness_utxo` field of the transaction is required to…",51,null],[13,"MissingWitnessScript","","The `witness_script` field of the transaction is requied…",51,null],[13,"MissingHDKeypath","","The fingerprint and derivation path are missing from the…",51,null],[8,"Signer","","Trait for signers",null,null],[10,"sign","","Sign a PSBT",52,[[["partiallysignedtransaction",3],["option",4]],[["signererror",4],["result",4]]]],[10,"sign_whole_tx","","Return whether or not the signer signs the whole…",52,[[]]],[11,"descriptor_secret_key","","Return the secret key for the signer",52,[[],[["descriptorsecretkey",4],["option",4]]]],[11,"as_key_map","","",53,[[],["keymap",6]]],[11,"new","","Default constructor",53,[[]]],[11,"add_external","","Adds an external signer to the container for the specified…",53,[[["signerordering",3],["box",3],["signerid",4],["arc",3]],[["option",4],["arc",3]]]],[11,"remove","","Removes a signer from the container and returns it",53,[[["signerordering",3],["signerid",4]],[["option",4],["arc",3]]]],[11,"ids","","Returns the list of identifiers of all the signers in the…",53,[[],[["vec",3],["signerid",4]]]],[11,"signers","","Returns the list of signers in the container, sorted by…",53,[[],[["arc",3],["vec",3]]]],[11,"find","","Finds the signer with lowest ordering for a given id in…",53,[[["signerid",4]],[["arc",3],["option",4]]]],[0,"time","magical::wallet","Cross-platform time",null,null],[5,"get_timestamp","magical::wallet::time","Return the current timestamp in seconds",null,[[]]],[0,"tx_builder","magical::wallet","Transaction builder",null,null],[3,"TxBuilder","magical::wallet::tx_builder","A transaction builder",null,null],[4,"TxOrdering","","Ordering of the transaction\'s inputs and outputs",null,null],[13,"Shuffle","","Randomized (default)",54,null],[13,"Untouched","","Unchanged",54,null],[13,"BIP69Lexicographic","","BIP69 / Lexicographic",54,null],[4,"ChangeSpendPolicy","","Policy regarding the use of change outputs when creating a…",null,null],[13,"ChangeAllowed","","Use both change and non-change outputs (default)",55,null],[13,"OnlyChange","","Only use change outputs (see…",55,null],[13,"ChangeForbidden","","Only use non-change outputs (see…",55,null],[11,"new","","Create an empty builder",56,[[]]],[11,"with_recipients","","Create a builder starting from a list of recipients",56,[[["vec",3]]]],[11,"set_recipients","","Replace the recipients already added with a new list",56,[[["vec",3]]]],[11,"add_recipient","","Add a recipient to the internal list",56,[[["script",3]]]],[11,"send_all","","Send all the selected utxos to a single output",56,[[]]],[11,"fee_rate","","Set a custom fee rate",56,[[["feerate",3]]]],[11,"policy_path","","Set the policy path to use while creating the transaction",56,[[["vec",3],["string",3],["btreemap",3]]]],[11,"utxos","","Replace the internal list of utxos that must be spent with…",56,[[["vec",3],["outpoint",3]]]],[11,"add_utxo","","Add a utxo to the internal list of utxos that must be spent",56,[[["outpoint",3]]]],[11,"unspendable","","Replace the internal list of unspendable utxos with a new…",56,[[["vec",3],["outpoint",3]]]],[11,"add_unspendable","","Add a utxo to the internal list of unspendable utxos",56,[[["outpoint",3]]]],[11,"sighash","","Sign with a specific sig hash",56,[[["sighashtype",4]]]],[11,"ordering","","Choose the ordering for inputs and outputs of the…",56,[[["txordering",4]]]],[11,"nlocktime","","Use a specific nLockTime while creating the transaction",56,[[]]],[11,"enable_rbf","","Enable signaling RBF",56,[[]]],[11,"enable_rbf_with_sequence","","Enable signaling RBF with a specific nSequence value",56,[[]]],[11,"version","","Build a transaction with a specific version",56,[[]]],[11,"do_not_spend_change","","Do not spend change outputs",56,[[]]],[11,"only_spend_change","","Only spend change outputs",56,[[]]],[11,"change_policy","","Set a specific [`ChangeSpendPolicy`]. See…",56,[[["changespendpolicy",4]]]],[11,"force_non_witness_utxo","","Fill-in the `psbt::Input::non_witness_utxo` field even if…",56,[[]]],[11,"coin_selection","","Choose the coin selection algorithm",56,[[["coinselectionalgorithm",8]],[["coinselectionalgorithm",8],["txbuilder",3]]]],[11,"sort_tx","","",54,[[["transaction",3]]]],[6,"OfflineWallet","magical::wallet","Type alias for a [`Wallet`] that uses [`OfflineBlockchain`]",null,null],[8,"IsDust","","Trait to check if a value is below the dust limit",null,null],[10,"is_dust","","Check whether or not a value is below dust limit",57,[[]]],[11,"new_offline","","Create a new \\\"offline\\\" wallet",58,[[["option",4],["network",4]],[["error",4],["result",4]]]],[11,"get_new_address","","Return a newly generated address using the external…",58,[[],[["result",4],["address",3],["error",4]]]],[11,"is_mine","","Return whether or not a `script` is part of this wallet…",58,[[["script",3]],[["result",4],["error",4]]]],[11,"list_unspent","","Return the list of unspent outputs of this wallet",58,[[],[["error",4],["vec",3],["result",4]]]],[11,"list_transactions","","Return the list of transactions made and received by the…",58,[[],[["result",4],["vec",3],["error",4]]]],[11,"get_balance","","Return the balance, meaning the sum of this wallet\'s…",58,[[],[["result",4],["error",4]]]],[11,"add_signer","","Add an external signer",58,[[["signerordering",3],["scripttype",4],["descriptorpublickey",4],["box",3],["arc",3],["signerid",4]]]],[11,"add_address_validator","","Add an address validator",58,[[["box",3],["arc",3]]]],[11,"create_tx","","Create a new transaction following the options specified…",58,[[["coinselectionalgorithm",8],["txbuilder",3]],[["result",4],["error",4]]]],[11,"bump_fee","","Bump the fee of a transaction following the options…",58,[[["txid",3],["coinselectionalgorithm",8],["txbuilder",3]],[["result",4],["error",4]]]],[11,"sign","","Sign a transaction with all the wallet\'s signers, in the…",58,[[["psbt",3],["option",4]],[["result",4],["error",4]]]],[11,"policies","","Return the spending policies for the wallet\'s descriptor",58,[[["scripttype",4]],[["error",4],["option",4],["result",4]]]],[11,"public_descriptor","","Return the \\\"public\\\" version of the wallet\'s descriptor,…",58,[[["scripttype",4]],[["option",4],["result",4],["error",4]]]],[11,"finalize_psbt","","Try to finalize a PSBT",58,[[["psbt",3],["option",4]],[["result",4],["error",4]]]],[11,"new","","Create a new \\\"online\\\" wallet",58,[[["option",4],["network",4]],[["error",4],["result",4]]]],[11,"sync","","Sync the internal database with the blockchain",58,[[["option",4],["progress",8]],[["error",4],["result",4]]]],[11,"client","","Return a reference to the internal blockchain client",58,[[]]],[11,"broadcast","","Broadcast a transaction to the network",58,[[["transaction",3]],[["error",4],["result",4],["txid",3]]]],[11,"from","magical","",43,[[]]],[11,"into","","",43,[[]]],[11,"to_owned","","",43,[[]]],[11,"clone_into","","",43,[[]]],[11,"try_from","","",43,[[],["result",4]]],[11,"try_into","","",43,[[],["result",4]]],[11,"borrow","","",43,[[]]],[11,"borrow_mut","","",43,[[]]],[11,"type_id","","",43,[[],["typeid",3]]],[11,"vzip","","",43,[[]]],[11,"from","","",0,[[]]],[11,"into","","",0,[[]]],[11,"to_owned","","",0,[[]]],[11,"clone_into","","",0,[[]]],[11,"try_from","","",0,[[],["result",4]]],[11,"try_into","","",0,[[],["result",4]]],[11,"borrow","","",0,[[]]],[11,"borrow_mut","","",0,[[]]],[11,"type_id","","",0,[[],["typeid",3]]],[11,"equivalent","","",0,[[]]],[11,"vzip","","",0,[[]]],[11,"from","","",1,[[]]],[11,"into","","",1,[[]]],[11,"to_owned","","",1,[[]]],[11,"clone_into","","",1,[[]]],[11,"try_from","","",1,[[],["result",4]]],[11,"try_into","","",1,[[],["result",4]]],[11,"borrow","","",1,[[]]],[11,"borrow_mut","","",1,[[]]],[11,"type_id","","",1,[[],["typeid",3]]],[11,"equivalent","","",1,[[]]],[11,"vzip","","",1,[[]]],[11,"from","","",2,[[]]],[11,"into","","",2,[[]]],[11,"to_string","","",2,[[],["string",3]]],[11,"try_from","","",2,[[],["result",4]]],[11,"try_into","","",2,[[],["result",4]]],[11,"borrow","","",2,[[]]],[11,"borrow_mut","","",2,[[]]],[11,"type_id","","",2,[[],["typeid",3]]],[11,"vzip","","",2,[[]]],[11,"from","","",4,[[]]],[11,"into","","",4,[[]]],[11,"to_owned","","",4,[[]]],[11,"clone_into","","",4,[[]]],[11,"try_from","","",4,[[],["result",4]]],[11,"try_into","","",4,[[],["result",4]]],[11,"borrow","","",4,[[]]],[11,"borrow_mut","","",4,[[]]],[11,"type_id","","",4,[[],["typeid",3]]],[11,"write_base32","","",4,[[],["result",4]]],[11,"base32_len","","",4,[[]]],[11,"check_base32","","",4,[[],[["result",4],["vec",3]]]],[11,"equivalent","","",4,[[]]],[11,"vzip","","",4,[[]]],[11,"from","magical::blockchain","",59,[[]]],[11,"into","","",59,[[]]],[11,"try_from","","",59,[[],["result",4]]],[11,"try_into","","",59,[[],["result",4]]],[11,"borrow","","",59,[[]]],[11,"borrow_mut","","",59,[[]]],[11,"type_id","","",59,[[],["typeid",3]]],[11,"vzip","","",59,[[]]],[11,"from","","",60,[[]]],[11,"into","","",60,[[]]],[11,"to_owned","","",60,[[]]],[11,"clone_into","","",60,[[]]],[11,"try_from","","",60,[[],["result",4]]],[11,"try_into","","",60,[[],["result",4]]],[11,"borrow","","",60,[[]]],[11,"borrow_mut","","",60,[[]]],[11,"type_id","","",60,[[],["typeid",3]]],[11,"vzip","","",60,[[]]],[11,"from","","",61,[[]]],[11,"into","","",61,[[]]],[11,"to_owned","","",61,[[]]],[11,"clone_into","","",61,[[]]],[11,"try_from","","",61,[[],["result",4]]],[11,"try_into","","",61,[[],["result",4]]],[11,"borrow","","",61,[[]]],[11,"borrow_mut","","",61,[[]]],[11,"type_id","","",61,[[],["typeid",3]]],[11,"vzip","","",61,[[]]],[11,"from","","",5,[[]]],[11,"into","","",5,[[]]],[11,"to_owned","","",5,[[]]],[11,"clone_into","","",5,[[]]],[11,"try_from","","",5,[[],["result",4]]],[11,"try_into","","",5,[[],["result",4]]],[11,"borrow","","",5,[[]]],[11,"borrow_mut","","",5,[[]]],[11,"type_id","","",5,[[],["typeid",3]]],[11,"equivalent","","",5,[[]]],[11,"vzip","","",5,[[]]],[11,"from","magical::blockchain::electrum","",62,[[]]],[11,"into","","",62,[[]]],[11,"try_from","","",62,[[],["result",4]]],[11,"try_into","","",62,[[],["result",4]]],[11,"borrow","","",62,[[]]],[11,"borrow_mut","","",62,[[]]],[11,"type_id","","",62,[[],["typeid",3]]],[11,"vzip","","",62,[[]]],[11,"from","magical::blockchain::esplora","",7,[[]]],[11,"into","","",7,[[]]],[11,"try_from","","",7,[[],["result",4]]],[11,"try_into","","",7,[[],["result",4]]],[11,"borrow","","",7,[[]]],[11,"borrow_mut","","",7,[[]]],[11,"type_id","","",7,[[],["typeid",3]]],[11,"vzip","","",7,[[]]],[11,"from","","",6,[[]]],[11,"into","","",6,[[]]],[11,"to_string","","",6,[[],["string",3]]],[11,"try_from","","",6,[[],["result",4]]],[11,"try_into","","",6,[[],["result",4]]],[11,"borrow","","",6,[[]]],[11,"borrow_mut","","",6,[[]]],[11,"type_id","","",6,[[],["typeid",3]]],[11,"vzip","","",6,[[]]],[11,"from","magical::blockchain::compact_filters","",9,[[]]],[11,"into","","",9,[[]]],[11,"try_from","","",9,[[],["result",4]]],[11,"try_into","","",9,[[],["result",4]]],[11,"borrow","","",9,[[]]],[11,"borrow_mut","","",9,[[]]],[11,"type_id","","",9,[[],["typeid",3]]],[11,"vzip","","",9,[[]]],[11,"from","","",10,[[]]],[11,"into","","",10,[[]]],[11,"try_from","","",10,[[],["result",4]]],[11,"try_into","","",10,[[],["result",4]]],[11,"borrow","","",10,[[]]],[11,"borrow_mut","","",10,[[]]],[11,"type_id","","",10,[[],["typeid",3]]],[11,"vzip","","",10,[[]]],[11,"from","","",11,[[]]],[11,"into","","",11,[[]]],[11,"try_from","","",11,[[],["result",4]]],[11,"try_into","","",11,[[],["result",4]]],[11,"borrow","","",11,[[]]],[11,"borrow_mut","","",11,[[]]],[11,"type_id","","",11,[[],["typeid",3]]],[11,"vzip","","",11,[[]]],[11,"from","","",8,[[]]],[11,"into","","",8,[[]]],[11,"to_string","","",8,[[],["string",3]]],[11,"try_from","","",8,[[],["result",4]]],[11,"try_into","","",8,[[],["result",4]]],[11,"borrow","","",8,[[]]],[11,"borrow_mut","","",8,[[]]],[11,"type_id","","",8,[[],["typeid",3]]],[11,"vzip","","",8,[[]]],[11,"from","magical::database::memory","",15,[[]]],[11,"into","","",15,[[]]],[11,"try_from","","",15,[[],["result",4]]],[11,"try_into","","",15,[[],["result",4]]],[11,"borrow","","",15,[[]]],[11,"borrow_mut","","",15,[[]]],[11,"type_id","","",15,[[],["typeid",3]]],[11,"vzip","","",15,[[]]],[11,"from","magical::descriptor","",19,[[]]],[11,"into","","",19,[[]]],[11,"to_owned","","",19,[[]]],[11,"clone_into","","",19,[[]]],[11,"to_string","","",19,[[],["string",3]]],[11,"try_from","","",19,[[],["result",4]]],[11,"try_into","","",19,[[],["result",4]]],[11,"borrow","","",19,[[]]],[11,"borrow_mut","","",19,[[]]],[11,"type_id","","",19,[[],["typeid",3]]],[11,"equivalent","","",19,[[]]],[11,"vzip","","",19,[[]]],[11,"from","","",63,[[]]],[11,"into","","",63,[[]]],[11,"to_owned","","",63,[[]]],[11,"clone_into","","",63,[[]]],[11,"try_from","","",63,[[],["result",4]]],[11,"try_into","","",63,[[],["result",4]]],[11,"borrow","","",63,[[]]],[11,"borrow_mut","","",63,[[]]],[11,"type_id","","",63,[[],["typeid",3]]],[11,"equivalent","","",63,[[]]],[11,"vzip","","",63,[[]]],[11,"from","","",20,[[]]],[11,"into","","",20,[[]]],[11,"to_owned","","",20,[[]]],[11,"clone_into","","",20,[[]]],[11,"to_string","","",20,[[],["string",3]]],[11,"try_from","","",20,[[],["result",4]]],[11,"try_into","","",20,[[],["result",4]]],[11,"borrow","","",20,[[]]],[11,"borrow_mut","","",20,[[]]],[11,"type_id","","",20,[[],["typeid",3]]],[11,"equivalent","","",20,[[]]],[11,"vzip","","",20,[[]]],[11,"from","","",64,[[]]],[11,"into","","",64,[[]]],[11,"to_owned","","",64,[[]]],[11,"clone_into","","",64,[[]]],[11,"try_from","","",64,[[],["result",4]]],[11,"try_into","","",64,[[],["result",4]]],[11,"borrow","","",64,[[]]],[11,"borrow_mut","","",64,[[]]],[11,"type_id","","",64,[[],["typeid",3]]],[11,"equivalent","","",64,[[]]],[11,"vzip","","",64,[[]]],[11,"from","","",23,[[]]],[11,"into","","",23,[[]]],[11,"to_owned","","",23,[[]]],[11,"clone_into","","",23,[[]]],[11,"to_string","","",23,[[],["string",3]]],[11,"try_from","","",23,[[],["result",4]]],[11,"try_into","","",23,[[],["result",4]]],[11,"borrow","","",23,[[]]],[11,"borrow_mut","","",23,[[]]],[11,"type_id","","",23,[[],["typeid",3]]],[11,"equivalent","","",23,[[]]],[11,"vzip","","",23,[[]]],[11,"from","magical::descriptor::error","",25,[[]]],[11,"into","","",25,[[]]],[11,"to_string","","",25,[[],["string",3]]],[11,"try_from","","",25,[[],["result",4]]],[11,"try_into","","",25,[[],["result",4]]],[11,"borrow","","",25,[[]]],[11,"borrow_mut","","",25,[[]]],[11,"type_id","","",25,[[],["typeid",3]]],[11,"vzip","","",25,[[]]],[11,"from","magical::descriptor::policy","",65,[[]]],[11,"into","","",65,[[]]],[11,"to_owned","","",65,[[]]],[11,"clone_into","","",65,[[]]],[11,"try_from","","",65,[[],["result",4]]],[11,"try_into","","",65,[[],["result",4]]],[11,"borrow","","",65,[[]]],[11,"borrow_mut","","",65,[[]]],[11,"type_id","","",65,[[],["typeid",3]]],[11,"vzip","","",65,[[]]],[11,"from","","",26,[[]]],[11,"into","","",26,[[]]],[11,"to_owned","","",26,[[]]],[11,"clone_into","","",26,[[]]],[11,"try_from","","",26,[[],["result",4]]],[11,"try_into","","",26,[[],["result",4]]],[11,"borrow","","",26,[[]]],[11,"borrow_mut","","",26,[[]]],[11,"type_id","","",26,[[],["typeid",3]]],[11,"vzip","","",26,[[]]],[11,"from","","",27,[[]]],[11,"into","","",27,[[]]],[11,"to_owned","","",27,[[]]],[11,"clone_into","","",27,[[]]],[11,"try_from","","",27,[[],["result",4]]],[11,"try_into","","",27,[[],["result",4]]],[11,"borrow","","",27,[[]]],[11,"borrow_mut","","",27,[[]]],[11,"type_id","","",27,[[],["typeid",3]]],[11,"equivalent","","",27,[[]]],[11,"vzip","","",27,[[]]],[11,"from","","",28,[[]]],[11,"into","","",28,[[]]],[11,"to_owned","","",28,[[]]],[11,"clone_into","","",28,[[]]],[11,"try_from","","",28,[[],["result",4]]],[11,"try_into","","",28,[[],["result",4]]],[11,"borrow","","",28,[[]]],[11,"borrow_mut","","",28,[[]]],[11,"type_id","","",28,[[],["typeid",3]]],[11,"vzip","","",28,[[]]],[11,"from","","",37,[[]]],[11,"into","","",37,[[]]],[11,"to_owned","","",37,[[]]],[11,"clone_into","","",37,[[]]],[11,"try_from","","",37,[[],["result",4]]],[11,"try_into","","",37,[[],["result",4]]],[11,"borrow","","",37,[[]]],[11,"borrow_mut","","",37,[[]]],[11,"type_id","","",37,[[],["typeid",3]]],[11,"vzip","","",37,[[]]],[11,"from","","",41,[[]]],[11,"into","","",41,[[]]],[11,"to_string","","",41,[[],["string",3]]],[11,"try_from","","",41,[[],["result",4]]],[11,"try_into","","",41,[[],["result",4]]],[11,"borrow","","",41,[[]]],[11,"borrow_mut","","",41,[[]]],[11,"type_id","","",41,[[],["typeid",3]]],[11,"vzip","","",41,[[]]],[11,"from","magical::wallet","",58,[[]]],[11,"into","","",58,[[]]],[11,"try_from","","",58,[[],["result",4]]],[11,"try_into","","",58,[[],["result",4]]],[11,"borrow","","",58,[[]]],[11,"borrow_mut","","",58,[[]]],[11,"type_id","","",58,[[],["typeid",3]]],[11,"vzip","","",58,[[]]],[11,"from","magical::wallet::address_validator","",44,[[]]],[11,"into","","",44,[[]]],[11,"to_owned","","",44,[[]]],[11,"clone_into","","",44,[[]]],[11,"to_string","","",44,[[],["string",3]]],[11,"try_from","","",44,[[],["result",4]]],[11,"try_into","","",44,[[],["result",4]]],[11,"borrow","","",44,[[]]],[11,"borrow_mut","","",44,[[]]],[11,"type_id","","",44,[[],["typeid",3]]],[11,"equivalent","","",44,[[]]],[11,"vzip","","",44,[[]]],[11,"from","magical::wallet::coin_selection","",46,[[]]],[11,"into","","",46,[[]]],[11,"try_from","","",46,[[],["result",4]]],[11,"try_into","","",46,[[],["result",4]]],[11,"borrow","","",46,[[]]],[11,"borrow_mut","","",46,[[]]],[11,"type_id","","",46,[[],["typeid",3]]],[11,"vzip","","",46,[[]]],[11,"from","","",66,[[]]],[11,"into","","",66,[[]]],[11,"try_from","","",66,[[],["result",4]]],[11,"try_into","","",66,[[],["result",4]]],[11,"borrow","","",66,[[]]],[11,"borrow_mut","","",66,[[]]],[11,"type_id","","",66,[[],["typeid",3]]],[11,"vzip","","",66,[[]]],[11,"from","magical::wallet::export","",48,[[]]],[11,"into","","",48,[[]]],[11,"to_string","","",48,[[],["string",3]]],[11,"try_from","","",48,[[],["result",4]]],[11,"try_into","","",48,[[],["result",4]]],[11,"borrow","","",48,[[]]],[11,"borrow_mut","","",48,[[]]],[11,"type_id","","",48,[[],["typeid",3]]],[11,"vzip","","",48,[[]]],[11,"from","magical::wallet::signer","",49,[[]]],[11,"into","","",49,[[]]],[11,"to_owned","","",49,[[]]],[11,"clone_into","","",49,[[]]],[11,"try_from","","",49,[[],["result",4]]],[11,"try_into","","",49,[[],["result",4]]],[11,"borrow","","",49,[[]]],[11,"borrow_mut","","",49,[[]]],[11,"type_id","","",49,[[],["typeid",3]]],[11,"equivalent","","",49,[[]]],[11,"vzip","","",49,[[]]],[11,"from","","",53,[[]]],[11,"into","","",53,[[]]],[11,"to_owned","","",53,[[]]],[11,"clone_into","","",53,[[]]],[11,"try_from","","",53,[[],["result",4]]],[11,"try_into","","",53,[[],["result",4]]],[11,"borrow","","",53,[[]]],[11,"borrow_mut","","",53,[[]]],[11,"type_id","","",53,[[],["typeid",3]]],[11,"vzip","","",53,[[]]],[11,"from","","",50,[[]]],[11,"into","","",50,[[]]],[11,"to_owned","","",50,[[]]],[11,"clone_into","","",50,[[]]],[11,"try_from","","",50,[[],["result",4]]],[11,"try_into","","",50,[[],["result",4]]],[11,"borrow","","",50,[[]]],[11,"borrow_mut","","",50,[[]]],[11,"type_id","","",50,[[],["typeid",3]]],[11,"equivalent","","",50,[[]]],[11,"vzip","","",50,[[]]],[11,"from","","",51,[[]]],[11,"into","","",51,[[]]],[11,"to_owned","","",51,[[]]],[11,"clone_into","","",51,[[]]],[11,"to_string","","",51,[[],["string",3]]],[11,"try_from","","",51,[[],["result",4]]],[11,"try_into","","",51,[[],["result",4]]],[11,"borrow","","",51,[[]]],[11,"borrow_mut","","",51,[[]]],[11,"type_id","","",51,[[],["typeid",3]]],[11,"equivalent","","",51,[[]]],[11,"vzip","","",51,[[]]],[11,"from","magical::wallet::tx_builder","",56,[[]]],[11,"into","","",56,[[]]],[11,"try_from","","",56,[[],["result",4]]],[11,"try_into","","",56,[[],["result",4]]],[11,"borrow","","",56,[[]]],[11,"borrow_mut","","",56,[[]]],[11,"type_id","","",56,[[],["typeid",3]]],[11,"vzip","","",56,[[]]],[11,"from","","",54,[[]]],[11,"into","","",54,[[]]],[11,"to_owned","","",54,[[]]],[11,"clone_into","","",54,[[]]],[11,"try_from","","",54,[[],["result",4]]],[11,"try_into","","",54,[[],["result",4]]],[11,"borrow","","",54,[[]]],[11,"borrow_mut","","",54,[[]]],[11,"type_id","","",54,[[],["typeid",3]]],[11,"equivalent","","",54,[[]]],[11,"vzip","","",54,[[]]],[11,"from","","",55,[[]]],[11,"into","","",55,[[]]],[11,"to_owned","","",55,[[]]],[11,"clone_into","","",55,[[]]],[11,"try_from","","",55,[[],["result",4]]],[11,"try_into","","",55,[[],["result",4]]],[11,"borrow","","",55,[[]]],[11,"borrow_mut","","",55,[[]]],[11,"type_id","","",55,[[],["typeid",3]]],[11,"equivalent","","",55,[[]]],[11,"vzip","","",55,[[]]],[11,"eq","magical::descriptor","",20,[[["miniscript",3]]]],[11,"eq","","",19,[[["descriptor",4]]]],[11,"ne","","",19,[[["descriptor",4]]]],[11,"eq","","",64,[[["segwitv0",4]]]],[11,"eq","","",23,[[["terminal",4]]]],[11,"ne","","",23,[[["terminal",4]]]],[11,"eq","","",63,[[["legacy",4]]]],[11,"check_frag_non_malleable","","",63,[[["terminal",4]],[["scriptcontexterror",4],["result",4]]]],[11,"check_frag_validity","","",63,[[["terminal",4]],[["scriptcontexterror",4],["result",4]]]],[11,"check_frag_non_malleable","","",64,[[["terminal",4]],[["scriptcontexterror",4],["result",4]]]],[11,"check_frag_validity","","",64,[[["terminal",4]],[["scriptcontexterror",4],["result",4]]]],[11,"cmp","","",23,[[["terminal",4]],["ordering",4]]],[11,"cmp","","",64,[[["segwitv0",4]],["ordering",4]]],[11,"cmp","","",63,[[["legacy",4]],["ordering",4]]],[11,"cmp","","",19,[[["descriptor",4]],["ordering",4]]],[11,"cmp","","",20,[[["miniscript",3]],["ordering",4]]],[11,"fmt","","",20,[[["formatter",3]],[["result",4],["error",3]]]],[11,"fmt","","",19,[[["formatter",3]],[["result",4],["error",3]]]],[11,"fmt","","",23,[[["formatter",3]],[["result",4],["error",3]]]],[11,"from_str","","",19,[[],[["error",4],["descriptor",4],["result",4]]]],[11,"from_str","","",20,[[],[["error",4],["miniscript",3],["result",4]]]],[11,"hash","","",20,[[]]],[11,"hash","","",23,[[]]],[11,"fmt","","",20,[[["formatter",3]],[["result",4],["error",3]]]],[11,"fmt","","",64,[[["formatter",3]],[["result",4],["error",3]]]],[11,"fmt","","",63,[[["formatter",3]],[["result",4],["error",3]]]],[11,"fmt","","",23,[[["formatter",3]],[["result",4],["error",3]]]],[11,"fmt","","",19,[[["formatter",3]],[["result",4],["error",3]]]],[11,"partial_cmp","","",20,[[["miniscript",3]],[["ordering",4],["option",4]]]],[11,"partial_cmp","","",64,[[["segwitv0",4]],[["ordering",4],["option",4]]]],[11,"partial_cmp","","",19,[[["descriptor",4]],[["ordering",4],["option",4]]]],[11,"lt","","",19,[[["descriptor",4]]]],[11,"le","","",19,[[["descriptor",4]]]],[11,"gt","","",19,[[["descriptor",4]]]],[11,"ge","","",19,[[["descriptor",4]]]],[11,"partial_cmp","","",23,[[["terminal",4]],[["ordering",4],["option",4]]]],[11,"lt","","",23,[[["terminal",4]]]],[11,"le","","",23,[[["terminal",4]]]],[11,"gt","","",23,[[["terminal",4]]]],[11,"ge","","",23,[[["terminal",4]]]],[11,"partial_cmp","","",63,[[["legacy",4]],[["ordering",4],["option",4]]]],[11,"from_tree","","Parse an expression tree into a Miniscript. As a general…",20,[[["tree",3]],[["error",4],["miniscript",3],["result",4]]]],[11,"from_tree","","",23,[[["tree",3]],[["error",4],["terminal",4],["result",4]]]],[11,"from_tree","","Parse an expression tree into a descriptor",19,[[["tree",3]],[["error",4],["descriptor",4],["result",4]]]],[11,"lift","","",19,[[],["policy",4]]],[11,"lift","","",20,[[],["policy",4]]],[11,"lift","","",23,[[],["policy",4]]],[11,"clone","","",19,[[],["descriptor",4]]],[11,"clone","","",20,[[],["miniscript",3]]],[11,"clone","","",63,[[],["legacy",4]]],[11,"clone","","",64,[[],["segwitv0",4]]],[11,"clone","","",23,[[],["terminal",4]]],[11,"offline","magical::blockchain::electrum","",62,[[]]],[11,"is_online","","",62,[[]]],[11,"offline","magical::blockchain::esplora","",7,[[]]],[11,"is_online","","",7,[[]]],[11,"offline","magical::blockchain::compact_filters","",11,[[]]],[11,"is_online","","",11,[[]]],[11,"offline","magical::blockchain","",59,[[]]],[11,"is_online","","",59,[[]]],[11,"update","","",60,[[["string",3],["option",4]],[["error",4],["result",4]]]],[11,"update","","",61,[[["string",3],["option",4]],[["error",4],["result",4]]]],[11,"set_script_pubkey","magical::database::memory","",15,[[["script",3],["scripttype",4]],[["error",4],["result",4]]]],[11,"set_utxo","","",15,[[["utxo",3]],[["error",4],["result",4]]]],[11,"set_raw_tx","","",15,[[["transaction",3]],[["error",4],["result",4]]]],[11,"set_tx","","",15,[[["transactiondetails",3]],[["error",4],["result",4]]]],[11,"set_last_index","","",15,[[["scripttype",4]],[["error",4],["result",4]]]],[11,"del_script_pubkey_from_path","","",15,[[["scripttype",4]],[["error",4],["result",4],["option",4]]]],[11,"del_path_from_script_pubkey","","",15,[[["script",3]],[["result",4],["option",4],["error",4]]]],[11,"del_utxo","","",15,[[["outpoint",3]],[["result",4],["option",4],["error",4]]]],[11,"del_raw_tx","","",15,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[11,"del_tx","","",15,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[11,"del_last_index","","",15,[[["scripttype",4]],[["option",4],["result",4],["error",4]]]],[11,"check_descriptor_checksum","","",15,[[["scripttype",4],["asref",8]],[["error",4],["result",4]]]],[11,"iter_script_pubkeys","","",15,[[["option",4],["scripttype",4]],[["result",4],["vec",3],["error",4]]]],[11,"iter_utxos","","",15,[[],[["error",4],["vec",3],["result",4]]]],[11,"iter_raw_txs","","",15,[[],[["result",4],["vec",3],["error",4]]]],[11,"iter_txs","","",15,[[],[["result",4],["vec",3],["error",4]]]],[11,"get_script_pubkey_from_path","","",15,[[["scripttype",4]],[["error",4],["result",4],["option",4]]]],[11,"get_path_from_script_pubkey","","",15,[[["script",3]],[["result",4],["option",4],["error",4]]]],[11,"get_utxo","","",15,[[["outpoint",3]],[["result",4],["option",4],["error",4]]]],[11,"get_raw_tx","","",15,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[11,"get_tx","","",15,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[11,"get_last_index","","",15,[[["scripttype",4]],[["option",4],["result",4],["error",4]]]],[11,"increment_last_index","","",15,[[["scripttype",4]],[["result",4],["error",4]]]],[11,"begin_batch","","",15,[[]]],[11,"commit_batch","","",15,[[],[["error",4],["result",4]]]],[11,"extract_policy","magical::descriptor","",20,[[["arc",3],["signerscontainer",3]],[["result",4],["option",4],["error",4]]]],[11,"extract_policy","","",19,[[["arc",3],["signerscontainer",3]],[["result",4],["option",4],["error",4]]]],[11,"coin_select","magical::wallet::coin_selection","",66,[[["utxo",3],["vec",3],["feerate",3]],[["coinselectionresult",3],["result",4],["error",4]]]],[11,"get_capabilities","magical::blockchain::electrum","",62,[[],[["hashset",3],["capability",4]]]],[11,"setup","","",62,[[["option",4],["progress",8]],[["error",4],["result",4]]]],[11,"get_tx","","",62,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[11,"broadcast","","",62,[[["transaction",3]],[["error",4],["result",4]]]],[11,"get_height","","",62,[[],[["result",4],["error",4]]]],[11,"estimate_fee","","",62,[[],[["result",4],["feerate",3],["error",4]]]],[11,"get_capabilities","magical::blockchain::esplora","",7,[[],[["hashset",3],["capability",4]]]],[11,"setup","","",7,[[["option",4],["progress",8]],[["error",4],["result",4]]]],[11,"get_tx","","",7,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[11,"broadcast","","",7,[[["transaction",3]],[["error",4],["result",4]]]],[11,"get_height","","",7,[[],[["result",4],["error",4]]]],[11,"estimate_fee","","",7,[[],[["result",4],["feerate",3],["error",4]]]],[11,"get_capabilities","magical::blockchain::compact_filters","",11,[[],[["hashset",3],["capability",4]]]],[11,"setup","","",11,[[["option",4],["progress",8]],[["error",4],["result",4]]]],[11,"get_tx","","",11,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[11,"broadcast","","",11,[[["transaction",3]],[["error",4],["result",4]]]],[11,"get_height","","",11,[[],[["result",4],["error",4]]]],[11,"estimate_fee","","",11,[[],[["result",4],["feerate",3],["error",4]]]],[11,"as_ref","magical","",4,[[]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["addressvalidatorerror",4]]]],[11,"from","","",2,[[["policyerror",4]]]],[11,"from","","",2,[[["signererror",4]]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["error",3]]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["esploraerror",4]]]],[11,"from","","",2,[[["error",4]]]],[11,"from","","",2,[[["compactfilterserror",4]]]],[11,"from","magical::blockchain::electrum","",62,[[["client",4]]]],[11,"from","magical::blockchain::esplora","",6,[[["error",3]]]],[11,"from","","",6,[[["parseinterror",3]]]],[11,"from","","",6,[[["error",4]]]],[11,"from","magical::blockchain::compact_filters","",8,[[["error",3]]]],[11,"from","","",8,[[["error",3]]]],[11,"from","","",8,[[["error",4]]]],[11,"from","","",8,[[["systemtimeerror",3]]]],[11,"from","","",8,[[["error",4]]]],[11,"from","magical::descriptor::error","",25,[[["error",4]]]],[11,"from","","",25,[[["error",4]]]],[11,"from","","",25,[[["error",4]]]],[11,"from","","",25,[[["error",4]]]],[11,"from","","",25,[[["error",4]]]],[11,"from","","",25,[[["policyerror",4]]]],[11,"from","magical::descriptor::policy","",37,[[]]],[11,"from","","",26,[[["satisfiableitem",4]]]],[11,"from","magical::wallet::signer","",50,[[["hash",3]],[["descriptorpublickey",4],["signerid",4]]]],[11,"from","","",50,[[["fingerprint",3]],[["descriptorpublickey",4],["signerid",4]]]],[11,"from","","",53,[[["keymap",6]],[["descriptorpublickey",4],["signerscontainer",3]]]],[11,"clone","magical::blockchain","",5,[[],["capability",4]]],[11,"clone","","",60,[[],["noopprogress",3]]],[11,"clone","","",61,[[],["logprogress",3]]],[11,"clone","magical::descriptor::policy","",65,[[],["pkorf",3]]],[11,"clone","","",28,[[],["satisfiableitem",4]]],[11,"clone","","",37,[[],["satisfaction",4]]],[11,"clone","","",26,[[],["policy",3]]],[11,"clone","","",27,[[],["condition",3]]],[11,"clone","magical","",4,[[],["scripttype",4]]],[11,"clone","","",43,[[],["feerate",3]]],[11,"clone","","",0,[[],["utxo",3]]],[11,"clone","","",1,[[],["transactiondetails",3]]],[11,"clone","magical::wallet::address_validator","",44,[[],["addressvalidatorerror",4]]],[11,"clone","magical::wallet::signer","",50,[[],["signerid",4]]],[11,"clone","","",51,[[],["signererror",4]]],[11,"clone","","",49,[[],["signerordering",3]]],[11,"clone","","",53,[[],["signerscontainer",3]]],[11,"clone","magical::wallet::tx_builder","",54,[[],["txordering",4]]],[11,"clone","","",55,[[],["changespendpolicy",4]]],[11,"default","magical::blockchain::compact_filters","",9,[[],["mempool",3]]],[11,"default","magical::database::memory","",15,[[],["memorydatabase",3]]],[11,"default","magical::descriptor::policy","",65,[[],["pkorf",3]]],[11,"default","","",27,[[],["condition",3]]],[11,"default","magical","",43,[[]]],[11,"default","","",1,[[],["transactiondetails",3]]],[11,"default","magical::wallet::coin_selection","",66,[[],["dumbcoinselection",3]]],[11,"default","magical::wallet::signer","",49,[[]]],[11,"default","","",53,[[],["signerscontainer",3]]],[11,"default","magical::wallet::tx_builder","",56,[[],["txbuilder",3]]],[11,"default","","",54,[[]]],[11,"default","","",55,[[]]],[11,"cmp","magical::descriptor::policy","",27,[[["condition",3]],["ordering",4]]],[11,"cmp","magical::wallet::signer","",49,[[["signerordering",3]],["ordering",4]]],[11,"cmp","magical::wallet::tx_builder","",54,[[["txordering",4]],["ordering",4]]],[11,"cmp","","",55,[[["changespendpolicy",4]],["ordering",4]]],[11,"eq","magical::blockchain","",5,[[["capability",4]]]],[11,"eq","magical::descriptor::policy","",27,[[["condition",3]]]],[11,"ne","","",27,[[["condition",3]]]],[11,"eq","magical","",4,[[["scripttype",4]]]],[11,"eq","","",43,[[["feerate",3]]]],[11,"ne","","",43,[[["feerate",3]]]],[11,"eq","","",0,[[["utxo",3]]]],[11,"ne","","",0,[[["utxo",3]]]],[11,"eq","","",1,[[["transactiondetails",3]]]],[11,"ne","","",1,[[["transactiondetails",3]]]],[11,"eq","magical::wallet::address_validator","",44,[[["addressvalidatorerror",4]]]],[11,"ne","","",44,[[["addressvalidatorerror",4]]]],[11,"eq","magical::wallet::signer","",50,[[["signerid",4]]]],[11,"ne","","",50,[[["signerid",4]]]],[11,"eq","","",51,[[["signererror",4]]]],[11,"eq","","",49,[[["signerordering",3]]]],[11,"ne","","",49,[[["signerordering",3]]]],[11,"eq","magical::wallet::tx_builder","",54,[[["txordering",4]]]],[11,"eq","","",55,[[["changespendpolicy",4]]]],[11,"partial_cmp","magical::descriptor::policy","",27,[[["condition",3]],[["option",4],["ordering",4]]]],[11,"lt","","",27,[[["condition",3]]]],[11,"le","","",27,[[["condition",3]]]],[11,"gt","","",27,[[["condition",3]]]],[11,"ge","","",27,[[["condition",3]]]],[11,"partial_cmp","magical","",43,[[["feerate",3]],[["option",4],["ordering",4]]]],[11,"lt","","",43,[[["feerate",3]]]],[11,"le","","",43,[[["feerate",3]]]],[11,"gt","","",43,[[["feerate",3]]]],[11,"ge","","",43,[[["feerate",3]]]],[11,"partial_cmp","magical::wallet::signer","",49,[[["signerordering",3]],[["option",4],["ordering",4]]]],[11,"lt","","",49,[[["signerordering",3]]]],[11,"le","","",49,[[["signerordering",3]]]],[11,"gt","","",49,[[["signerordering",3]]]],[11,"ge","","",49,[[["signerordering",3]]]],[11,"partial_cmp","magical::wallet::tx_builder","",54,[[["txordering",4]],[["option",4],["ordering",4]]]],[11,"partial_cmp","","",55,[[["changespendpolicy",4]],[["option",4],["ordering",4]]]],[11,"to_string","magical::wallet::export","",48,[[],["string",3]]],[11,"fmt","magical","",2,[[["formatter",3]],["result",6]]],[11,"fmt","magical::blockchain::esplora","",7,[[["formatter",3]],["result",6]]],[11,"fmt","","",6,[[["formatter",3]],["result",6]]],[11,"fmt","magical::blockchain::compact_filters","",9,[[["formatter",3]],["result",6]]],[11,"fmt","","",10,[[["formatter",3]],["result",6]]],[11,"fmt","","",11,[[["formatter",3]],["result",6]]],[11,"fmt","","",8,[[["formatter",3]],["result",6]]],[11,"fmt","magical::blockchain","",5,[[["formatter",3]],["result",6]]],[11,"fmt","magical::database::memory","",15,[[["formatter",3]],["result",6]]],[11,"fmt","magical::descriptor::error","",25,[[["formatter",3]],["result",6]]],[11,"fmt","magical::descriptor::policy","",65,[[["formatter",3]],["result",6]]],[11,"fmt","","",28,[[["formatter",3]],["result",6]]],[11,"fmt","","",37,[[["formatter",3]],["result",6]]],[11,"fmt","","",26,[[["formatter",3]],["result",6]]],[11,"fmt","","",27,[[["formatter",3]],["result",6]]],[11,"fmt","","",41,[[["formatter",3]],["result",6]]],[11,"fmt","magical","",4,[[["formatter",3]],["result",6]]],[11,"fmt","","",43,[[["formatter",3]],["result",6]]],[11,"fmt","","",0,[[["formatter",3]],["result",6]]],[11,"fmt","","",1,[[["formatter",3]],["result",6]]],[11,"fmt","magical::wallet::address_validator","",44,[[["formatter",3]],["result",6]]],[11,"fmt","magical::wallet::coin_selection","",46,[[["formatter",3]],["result",6]]],[11,"fmt","","",66,[[["formatter",3]],["result",6]]],[11,"fmt","magical::wallet::export","",48,[[["formatter",3]],["result",6]]],[11,"fmt","magical::wallet::signer","",50,[[["formatter",3]],["result",6]]],[11,"fmt","","",51,[[["formatter",3]],["result",6]]],[11,"fmt","","",49,[[["formatter",3]],["result",6]]],[11,"fmt","","",53,[[["formatter",3]],["result",6]]],[11,"fmt","magical::wallet::tx_builder","",56,[[["formatter",3]],["result",6]]],[11,"fmt","","",54,[[["formatter",3]],["result",6]]],[11,"fmt","","",55,[[["formatter",3]],["result",6]]],[11,"fmt","magical","",2,[[["formatter",3]],["result",6]]],[11,"fmt","magical::blockchain::esplora","",6,[[["formatter",3]],["result",6]]],[11,"fmt","magical::blockchain::compact_filters","",8,[[["formatter",3]],["result",6]]],[11,"fmt","magical::descriptor::error","",25,[[["formatter",3]],["result",6]]],[11,"fmt","magical::descriptor::policy","",41,[[["formatter",3]],["result",6]]],[11,"fmt","magical::wallet::address_validator","",44,[[["formatter",3]],["result",6]]],[11,"fmt","magical::wallet::signer","",51,[[["formatter",3]],["result",6]]],[11,"hash","magical::blockchain","",5,[[]]],[11,"hash","magical::descriptor::policy","",27,[[]]],[11,"hash","magical","",4,[[]]],[11,"hash","magical::wallet::signer","",50,[[]]],[11,"hash","magical::wallet::tx_builder","",54,[[]]],[11,"hash","","",55,[[]]],[11,"from_str","magical::wallet::export","",48,[[],["result",4]]],[11,"serialize","magical::descriptor::policy","",65,[[],["result",4]]],[11,"serialize","","",28,[[],["result",4]]],[11,"serialize","","",37,[[],["result",4]]],[11,"serialize","","",26,[[],["result",4]]],[11,"serialize","","",27,[[],["result",4]]],[11,"serialize","magical","",4,[[],["result",4]]],[11,"serialize","","",0,[[],["result",4]]],[11,"serialize","","",1,[[],["result",4]]],[11,"serialize","magical::wallet::export","",48,[[],["result",4]]],[11,"deserialize","magical","",4,[[],["result",4]]],[11,"deserialize","","",0,[[],["result",4]]],[11,"deserialize","","",1,[[],["result",4]]],[11,"deserialize","magical::wallet::export","",48,[[],["result",4]]],[11,"translate_pk","magical::descriptor","Convert a descriptor using abstract keys to one using…",19,[[],[["result",4],["descriptor",4]]]],[11,"address","","Computes the Bitcoin address of the descriptor, if one…",19,[[["network",4]],[["option",4],["address",3]]]],[11,"script_pubkey","","Computes the scriptpubkey of the descriptor",19,[[],["script",3]]],[11,"unsigned_script_sig","","Computes the scriptSig that will be in place for an…",19,[[],["script",3]]],[11,"witness_script","","Computes the \\\"witness script\\\" of the descriptor, i.e. the…",19,[[],["script",3]]],[11,"satisfy","","Attempts to produce a satisfying witness and scriptSig to…",19,[[["txin",3]],[["error",4],["result",4]]]],[11,"max_satisfaction_weight","","Computes an upper bound on the weight of a satisfying…",19,[[]]],[11,"derive","","Derives all wildcard keys in the descriptor using the…",19,[[],[["descriptor",4],["descriptorpublickey",4]]]],[11,"parse_secret","","",19,[[],[["error",4],["result",4]]]],[11,"to_string_with_secret","","",19,[[["hashmap",3]],["string",3]]],[11,"from_ast","","Add type information(Type and Extdata) to Miniscript based…",20,[[["terminal",4]],[["error",4],["miniscript",3],["result",4]]]],[11,"into_inner","","Extracts the `AstElem` representing the root of the…",20,[[],["terminal",4]]],[11,"as_inner","","",20,[[],["terminal",4]]],[11,"parse","","Attempt to parse a script into a Miniscript representation",20,[[["script",3]],[["error",4],["miniscript",3],["result",4]]]],[11,"encode","","Encode as a Bitcoin script",20,[[],["script",3]]],[11,"script_size","","Size, in bytes of the script-pubkey. If this Miniscript is…",20,[[]]],[11,"max_satisfaction_witness_elements","","Maximum number of witness elements used to satisfy the…",20,[[]]],[11,"max_satisfaction_size","","Maximum size, in bytes, of a satisfying witness. For…",20,[[]]],[11,"translate_pk","","This will panic if translatefpk returns an uncompressed…",20,[[],[["miniscript",3],["result",4]]]],[11,"satisfy","","Attempt to produce a satisfying witness for the witness…",20,[[],[["vec",3],["option",4]]]],[11,"translate_pk","","Convert an AST element with one public key type to one of…",23,[[],[["terminal",4],["result",4]]]],[11,"encode","","Encode the element as a fragment of Bitcoin Script. The…",23,[[["builder",3]],["builder",3]]],[11,"script_size","","Size, in bytes of the script-pubkey. If this Miniscript is…",23,[[]]],[11,"max_dissatisfaction_witness_elements","","Maximum number of witness elements used to dissatisfy the…",23,[[],["option",4]]],[11,"max_dissatisfaction_size","","Maximum dissatisfaction cost, in bytes, of a Miniscript…",23,[[],["option",4]]],[11,"max_satisfaction_witness_elements","","Maximum number of witness elements used to satisfy the…",23,[[]]],[11,"max_satisfaction_size","","Maximum size, in bytes, of a satisfying witness. For…",23,[[]]]],"p":[[3,"UTXO"],[3,"TransactionDetails"],[4,"Error"],[13,"FeeRateTooLow"],[4,"ScriptType"],[4,"Capability"],[4,"EsploraError"],[3,"EsploraBlockchain"],[4,"CompactFiltersError"],[3,"Mempool"],[3,"Peer"],[3,"CompactFiltersBlockchain"],[8,"Blockchain"],[8,"OnlineBlockchain"],[8,"Progress"],[3,"MemoryDatabase"],[8,"BatchOperations"],[8,"Database"],[8,"BatchDatabase"],[4,"Descriptor"],[3,"Miniscript"],[8,"MiniscriptKey"],[8,"ScriptContext"],[4,"Terminal"],[8,"ToPublicKey"],[4,"Error"],[3,"Policy"],[3,"Condition"],[4,"SatisfiableItem"],[13,"SHA256Preimage"],[13,"HASH256Preimage"],[13,"RIPEMD160Preimage"],[13,"HASH160Preimage"],[13,"AbsoluteTimelock"],[13,"RelativeTimelock"],[13,"Thresh"],[13,"Multisig"],[4,"Satisfaction"],[13,"Partial"],[13,"PartialComplete"],[13,"Complete"],[4,"PolicyError"],[8,"ExtractPolicy"],[3,"FeeRate"],[4,"AddressValidatorError"],[8,"AddressValidator"],[3,"CoinSelectionResult"],[8,"CoinSelectionAlgorithm"],[3,"WalletExport"],[3,"SignerOrdering"],[4,"SignerId"],[4,"SignerError"],[8,"Signer"],[3,"SignersContainer"],[4,"TxOrdering"],[4,"ChangeSpendPolicy"],[3,"TxBuilder"],[8,"IsDust"],[3,"Wallet"],[3,"OfflineBlockchain"],[3,"NoopProgress"],[3,"LogProgress"],[3,"ElectrumBlockchain"],[4,"Legacy"],[4,"Segwitv0"],[3,"PKOrF"],[3,"DumbCoinSelection"]]}\
-}');
-addSearchOptions(searchIndex);initSearch(searchIndex);
\ No newline at end of file
+++ /dev/null
-.setting-line{padding:5px;position:relative;}.setting-line>div{max-width:calc(100% - 74px);display:inline-block;vertical-align:top;font-size:17px;padding-top:2px;}.setting-line>.title{font-size:19px;width:100%;max-width:none;border-bottom:1px solid;}.toggle{position:relative;display:inline-block;width:45px;height:27px;margin-right:20px;}.toggle input{display:none;}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.3s;transition:.3s;}.slider:before{position:absolute;content:"";height:19px;width:19px;left:4px;bottom:4px;background-color:white;-webkit-transition:.3s;transition:.3s;}input:checked+.slider{background-color:#2196F3;}input:focus+.slider{box-shadow:0 0 1px #2196F3;}input:checked+.slider:before{-webkit-transform:translateX(19px);-ms-transform:translateX(19px);transform:translateX(19px);}.setting-line>.sub-settings{padding-left:42px;width:100%;display:block;}
\ No newline at end of file
+++ /dev/null
-<!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="Settings of Rustdoc"><meta name="keywords" content="rust, rustlang, rust-lang"><title>Rustdoc settings</title><link rel="stylesheet" type="text/css" href="./normalize.css"><link rel="stylesheet" type="text/css" href="./rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="./settings.css"><link rel="stylesheet" type="text/css" href="./dark.css"><link rel="stylesheet" type="text/css" href="./light.css" id="themeStyle"><script src="./storage.js"></script><noscript><link rel="stylesheet" href="./noscript.css"></noscript><link rel="shortcut icon" href="./favicon.ico"><style type="text/css">#crate-search{background-image:url("./down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='./magical/index.html'><div class='logo-container'><img src='./rust-logo.png' alt='logo'></div></a><p class='location'>Settings</p><div class='sidebar-elems'></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="./brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="./theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="./settings.html"><img src="./wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Rustdoc settings</span></h1><div class='settings'><div class='setting-line'><div class='title'>Auto-hide item declarations</div><div class='sub-settings'><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-struct' checked><span class='slider'></span></label><div>Auto-hide structs declaration</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-enum' ><span class='slider'></span></label><div>Auto-hide enums declaration</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-union' checked><span class='slider'></span></label><div>Auto-hide unions declaration</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-trait' checked><span class='slider'></span></label><div>Auto-hide traits declaration</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-macro' ><span class='slider'></span></label><div>Auto-hide macros declaration</div></div></div>
- </div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-attributes' checked><span class='slider'></span></label><div>Auto-hide item attributes.</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-method-docs' ><span class='slider'></span></label><div>Auto-hide item methods' documentation</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-trait-implementations' checked><span class='slider'></span></label><div>Auto-hide trait implementations documentation</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='go-to-only-result' ><span class='slider'></span></label><div>Directly go to item in search if there is only one result</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='line-numbers' ><span class='slider'></span></label><div>Show line numbers on code examples</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='disable-shortcuts' ><span class='slider'></span></label><div>Disable keyboard shortcuts</div></div></div><script src='./settings.js'></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "./";window.currentCrate = "magical";</script><script src="./main.js"></script><script defer src="./search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-(function(){function changeSetting(settingName,isEnabled){updateLocalStorage('rustdoc-'+settingName,isEnabled)}function getSettingValue(settingName){return getCurrentValue('rustdoc-'+settingName)}function setEvents(){var elems=document.getElementsByClassName("slider");if(!elems||elems.length===0){return}for(var i=0;i<elems.length;++i){var toggle=elems[i].previousElementSibling;var settingId=toggle.id;var settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=function(){changeSetting(this.id,this.checked)}}}setEvents()})()
\ No newline at end of file
+++ /dev/null
-var N = null;var sourcesIndex = {};
-sourcesIndex["magical"] = {"name":"","dirs":[{"name":"blockchain","dirs":[{"name":"compact_filters","files":["mod.rs","peer.rs","store.rs","sync.rs"]}],"files":["electrum.rs","esplora.rs","mod.rs","utils.rs"]},{"name":"database","files":["keyvalue.rs","memory.rs","mod.rs"]},{"name":"descriptor","files":["checksum.rs","error.rs","mod.rs","policy.rs"]},{"name":"psbt","files":["mod.rs"]},{"name":"wallet","files":["address_validator.rs","coin_selection.rs","export.rs","mod.rs","rbf.rs","signer.rs","time.rs","tx_builder.rs","utils.rs"]}],"files":["error.rs","lib.rs","types.rs"]};
-createSourceSidebar();
+++ /dev/null
-function getCurrentFilePath(){var parts=window.location.pathname.split("/");var rootPathParts=window.rootPath.split("/");for(var i=0;i<rootPathParts.length;++i){if(rootPathParts[i]===".."){parts.pop()}}var file=window.location.pathname.substring(parts.join("/").length);if(file.startsWith("/")){file=file.substring(1)}return file.substring(0,file.length-5)}function createDirEntry(elem,parent,fullPath,currentFile,hasFoundFile){var name=document.createElement("div");name.className="name";fullPath+=elem["name"]+"/";name.onclick=function(){if(hasClass(this,"expand")){removeClass(this,"expand")}else{addClass(this,"expand")}};name.innerText=elem["name"];var children=document.createElement("div");children.className="children";var folders=document.createElement("div");folders.className="folders";if(elem.dirs){for(var i=0;i<elem.dirs.length;++i){if(createDirEntry(elem.dirs[i],folders,fullPath,currentFile,hasFoundFile)===true){addClass(name,"expand");hasFoundFile=true}}}children.appendChild(folders);var files=document.createElement("div");files.className="files";if(elem.files){for(i=0;i<elem.files.length;++i){var file=document.createElement("a");file.innerText=elem.files[i];file.href=window.rootPath+"src/"+fullPath+elem.files[i]+".html";if(hasFoundFile===false&¤tFile===fullPath+elem.files[i]){file.className="selected";addClass(name,"expand");hasFoundFile=true}files.appendChild(file)}}search.fullPath=fullPath;children.appendChild(files);parent.appendChild(name);parent.appendChild(children);return hasFoundFile===true&¤tFile.startsWith(fullPath)}function toggleSidebar(){var sidebar=document.getElementById("source-sidebar");var child=this.children[0].children[0];if(child.innerText===">"){sidebar.style.left="";this.style.left="";child.innerText="<";updateLocalStorage("rustdoc-source-sidebar-show","true")}else{sidebar.style.left="-300px";this.style.left="0";child.innerText=">";updateLocalStorage("rustdoc-source-sidebar-show","false")}}function createSidebarToggle(){var sidebarToggle=document.createElement("div");sidebarToggle.id="sidebar-toggle";sidebarToggle.onclick=toggleSidebar;var inner1=document.createElement("div");inner1.style.position="relative";var inner2=document.createElement("div");inner2.style.paddingTop="3px";if(getCurrentValue("rustdoc-source-sidebar-show")==="true"){inner2.innerText="<"}else{inner2.innerText=">";sidebarToggle.style.left="0"}inner1.appendChild(inner2);sidebarToggle.appendChild(inner1);return sidebarToggle}function createSourceSidebar(){if(window.rootPath.endsWith("/")===false){window.rootPath+="/"}var main=document.getElementById("main");var sidebarToggle=createSidebarToggle();main.insertBefore(sidebarToggle,main.firstChild);var sidebar=document.createElement("div");sidebar.id="source-sidebar";if(getCurrentValue("rustdoc-source-sidebar-show")!=="true"){sidebar.style.left="-300px"}var currentFile=getCurrentFilePath();var hasFoundFile=false;var title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);Object.keys(sourcesIndex).forEach(function(key){sourcesIndex[key].name=key;hasFoundFile=createDirEntry(sourcesIndex[key],sidebar,"",currentFile,hasFoundFile)});main.insertBefore(sidebar,main.firstChild)}
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/blockchain/compact_filters/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../../magical/index.html'><div class='logo-container'><img src='../../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-<span id="203">203</span>
-<span id="204">204</span>
-<span id="205">205</span>
-<span id="206">206</span>
-<span id="207">207</span>
-<span id="208">208</span>
-<span id="209">209</span>
-<span id="210">210</span>
-<span id="211">211</span>
-<span id="212">212</span>
-<span id="213">213</span>
-<span id="214">214</span>
-<span id="215">215</span>
-<span id="216">216</span>
-<span id="217">217</span>
-<span id="218">218</span>
-<span id="219">219</span>
-<span id="220">220</span>
-<span id="221">221</span>
-<span id="222">222</span>
-<span id="223">223</span>
-<span id="224">224</span>
-<span id="225">225</span>
-<span id="226">226</span>
-<span id="227">227</span>
-<span id="228">228</span>
-<span id="229">229</span>
-<span id="230">230</span>
-<span id="231">231</span>
-<span id="232">232</span>
-<span id="233">233</span>
-<span id="234">234</span>
-<span id="235">235</span>
-<span id="236">236</span>
-<span id="237">237</span>
-<span id="238">238</span>
-<span id="239">239</span>
-<span id="240">240</span>
-<span id="241">241</span>
-<span id="242">242</span>
-<span id="243">243</span>
-<span id="244">244</span>
-<span id="245">245</span>
-<span id="246">246</span>
-<span id="247">247</span>
-<span id="248">248</span>
-<span id="249">249</span>
-<span id="250">250</span>
-<span id="251">251</span>
-<span id="252">252</span>
-<span id="253">253</span>
-<span id="254">254</span>
-<span id="255">255</span>
-<span id="256">256</span>
-<span id="257">257</span>
-<span id="258">258</span>
-<span id="259">259</span>
-<span id="260">260</span>
-<span id="261">261</span>
-<span id="262">262</span>
-<span id="263">263</span>
-<span id="264">264</span>
-<span id="265">265</span>
-<span id="266">266</span>
-<span id="267">267</span>
-<span id="268">268</span>
-<span id="269">269</span>
-<span id="270">270</span>
-<span id="271">271</span>
-<span id="272">272</span>
-<span id="273">273</span>
-<span id="274">274</span>
-<span id="275">275</span>
-<span id="276">276</span>
-<span id="277">277</span>
-<span id="278">278</span>
-<span id="279">279</span>
-<span id="280">280</span>
-<span id="281">281</span>
-<span id="282">282</span>
-<span id="283">283</span>
-<span id="284">284</span>
-<span id="285">285</span>
-<span id="286">286</span>
-<span id="287">287</span>
-<span id="288">288</span>
-<span id="289">289</span>
-<span id="290">290</span>
-<span id="291">291</span>
-<span id="292">292</span>
-<span id="293">293</span>
-<span id="294">294</span>
-<span id="295">295</span>
-<span id="296">296</span>
-<span id="297">297</span>
-<span id="298">298</span>
-<span id="299">299</span>
-<span id="300">300</span>
-<span id="301">301</span>
-<span id="302">302</span>
-<span id="303">303</span>
-<span id="304">304</span>
-<span id="305">305</span>
-<span id="306">306</span>
-<span id="307">307</span>
-<span id="308">308</span>
-<span id="309">309</span>
-<span id="310">310</span>
-<span id="311">311</span>
-<span id="312">312</span>
-<span id="313">313</span>
-<span id="314">314</span>
-<span id="315">315</span>
-<span id="316">316</span>
-<span id="317">317</span>
-<span id="318">318</span>
-<span id="319">319</span>
-<span id="320">320</span>
-<span id="321">321</span>
-<span id="322">322</span>
-<span id="323">323</span>
-<span id="324">324</span>
-<span id="325">325</span>
-<span id="326">326</span>
-<span id="327">327</span>
-<span id="328">328</span>
-<span id="329">329</span>
-<span id="330">330</span>
-<span id="331">331</span>
-<span id="332">332</span>
-<span id="333">333</span>
-<span id="334">334</span>
-<span id="335">335</span>
-<span id="336">336</span>
-<span id="337">337</span>
-<span id="338">338</span>
-<span id="339">339</span>
-<span id="340">340</span>
-<span id="341">341</span>
-<span id="342">342</span>
-<span id="343">343</span>
-<span id="344">344</span>
-<span id="345">345</span>
-<span id="346">346</span>
-<span id="347">347</span>
-<span id="348">348</span>
-<span id="349">349</span>
-<span id="350">350</span>
-<span id="351">351</span>
-<span id="352">352</span>
-<span id="353">353</span>
-<span id="354">354</span>
-<span id="355">355</span>
-<span id="356">356</span>
-<span id="357">357</span>
-<span id="358">358</span>
-<span id="359">359</span>
-<span id="360">360</span>
-<span id="361">361</span>
-<span id="362">362</span>
-<span id="363">363</span>
-<span id="364">364</span>
-<span id="365">365</span>
-<span id="366">366</span>
-<span id="367">367</span>
-<span id="368">368</span>
-<span id="369">369</span>
-<span id="370">370</span>
-<span id="371">371</span>
-<span id="372">372</span>
-<span id="373">373</span>
-<span id="374">374</span>
-<span id="375">375</span>
-<span id="376">376</span>
-<span id="377">377</span>
-<span id="378">378</span>
-<span id="379">379</span>
-<span id="380">380</span>
-<span id="381">381</span>
-<span id="382">382</span>
-<span id="383">383</span>
-<span id="384">384</span>
-<span id="385">385</span>
-<span id="386">386</span>
-<span id="387">387</span>
-<span id="388">388</span>
-<span id="389">389</span>
-<span id="390">390</span>
-<span id="391">391</span>
-<span id="392">392</span>
-<span id="393">393</span>
-<span id="394">394</span>
-<span id="395">395</span>
-<span id="396">396</span>
-<span id="397">397</span>
-<span id="398">398</span>
-<span id="399">399</span>
-<span id="400">400</span>
-<span id="401">401</span>
-<span id="402">402</span>
-<span id="403">403</span>
-<span id="404">404</span>
-<span id="405">405</span>
-<span id="406">406</span>
-<span id="407">407</span>
-<span id="408">408</span>
-<span id="409">409</span>
-<span id="410">410</span>
-<span id="411">411</span>
-<span id="412">412</span>
-<span id="413">413</span>
-<span id="414">414</span>
-<span id="415">415</span>
-<span id="416">416</span>
-<span id="417">417</span>
-<span id="418">418</span>
-<span id="419">419</span>
-<span id="420">420</span>
-<span id="421">421</span>
-<span id="422">422</span>
-<span id="423">423</span>
-<span id="424">424</span>
-<span id="425">425</span>
-<span id="426">426</span>
-<span id="427">427</span>
-<span id="428">428</span>
-<span id="429">429</span>
-<span id="430">430</span>
-<span id="431">431</span>
-<span id="432">432</span>
-<span id="433">433</span>
-<span id="434">434</span>
-<span id="435">435</span>
-<span id="436">436</span>
-<span id="437">437</span>
-<span id="438">438</span>
-<span id="439">439</span>
-<span id="440">440</span>
-<span id="441">441</span>
-<span id="442">442</span>
-<span id="443">443</span>
-<span id="444">444</span>
-<span id="445">445</span>
-<span id="446">446</span>
-<span id="447">447</span>
-<span id="448">448</span>
-<span id="449">449</span>
-<span id="450">450</span>
-<span id="451">451</span>
-<span id="452">452</span>
-<span id="453">453</span>
-<span id="454">454</span>
-<span id="455">455</span>
-<span id="456">456</span>
-<span id="457">457</span>
-<span id="458">458</span>
-<span id="459">459</span>
-<span id="460">460</span>
-<span id="461">461</span>
-<span id="462">462</span>
-<span id="463">463</span>
-<span id="464">464</span>
-<span id="465">465</span>
-<span id="466">466</span>
-<span id="467">467</span>
-<span id="468">468</span>
-<span id="469">469</span>
-<span id="470">470</span>
-<span id="471">471</span>
-<span id="472">472</span>
-<span id="473">473</span>
-<span id="474">474</span>
-<span id="475">475</span>
-<span id="476">476</span>
-<span id="477">477</span>
-<span id="478">478</span>
-<span id="479">479</span>
-<span id="480">480</span>
-<span id="481">481</span>
-<span id="482">482</span>
-<span id="483">483</span>
-<span id="484">484</span>
-<span id="485">485</span>
-<span id="486">486</span>
-<span id="487">487</span>
-<span id="488">488</span>
-<span id="489">489</span>
-<span id="490">490</span>
-<span id="491">491</span>
-<span id="492">492</span>
-<span id="493">493</span>
-<span id="494">494</span>
-<span id="495">495</span>
-<span id="496">496</span>
-<span id="497">497</span>
-<span id="498">498</span>
-<span id="499">499</span>
-<span id="500">500</span>
-<span id="501">501</span>
-<span id="502">502</span>
-<span id="503">503</span>
-<span id="504">504</span>
-<span id="505">505</span>
-<span id="506">506</span>
-<span id="507">507</span>
-<span id="508">508</span>
-<span id="509">509</span>
-<span id="510">510</span>
-<span id="511">511</span>
-<span id="512">512</span>
-<span id="513">513</span>
-<span id="514">514</span>
-<span id="515">515</span>
-<span id="516">516</span>
-<span id="517">517</span>
-<span id="518">518</span>
-<span id="519">519</span>
-<span id="520">520</span>
-<span id="521">521</span>
-<span id="522">522</span>
-<span id="523">523</span>
-<span id="524">524</span>
-<span id="525">525</span>
-<span id="526">526</span>
-<span id="527">527</span>
-<span id="528">528</span>
-<span id="529">529</span>
-<span id="530">530</span>
-<span id="531">531</span>
-<span id="532">532</span>
-<span id="533">533</span>
-<span id="534">534</span>
-<span id="535">535</span>
-<span id="536">536</span>
-<span id="537">537</span>
-<span id="538">538</span>
-<span id="539">539</span>
-<span id="540">540</span>
-<span id="541">541</span>
-<span id="542">542</span>
-<span id="543">543</span>
-<span id="544">544</span>
-<span id="545">545</span>
-<span id="546">546</span>
-<span id="547">547</span>
-<span id="548">548</span>
-<span id="549">549</span>
-<span id="550">550</span>
-<span id="551">551</span>
-<span id="552">552</span>
-<span id="553">553</span>
-<span id="554">554</span>
-<span id="555">555</span>
-<span id="556">556</span>
-<span id="557">557</span>
-<span id="558">558</span>
-<span id="559">559</span>
-<span id="560">560</span>
-<span id="561">561</span>
-<span id="562">562</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="doccomment">//! Compact Filters</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! This module contains a multithreaded implementation of an [`OnlineBlockchain`] backend that</span>
-<span class="doccomment">//! uses BIP157 (aka "Neutrino") to populate the wallet's [database](crate::database::Database)</span>
-<span class="doccomment">//! by downloading compact filters from the P2P network.</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! Since there are currently very few peers "in the wild" that advertise the required service</span>
-<span class="doccomment">//! flag, this implementation requires that one or more known peers are provided by the user.</span>
-<span class="doccomment">//! No dns or other kinds of peer discovery are done internally.</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! Moreover, this module doesn't currently support detecting and resolving conflicts between</span>
-<span class="doccomment">//! messages received by different peers. Thus, it's recommended to use this module by only</span>
-<span class="doccomment">//! connecting to a single peer at a time, optionally by opening multiple connections if it's</span>
-<span class="doccomment">//! desirable to use multiple threads at once to sync in parallel.</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ## Example</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ```no_run</span>
-<span class="doccomment">//! # use std::sync::Arc;</span>
-<span class="doccomment">//! # use bitcoin::*;</span>
-<span class="doccomment">//! # use magical::*;</span>
-<span class="doccomment">//! # use magical::blockchain::compact_filters::*;</span>
-<span class="doccomment">//! let num_threads = 4;</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! let mempool = Arc::new(Mempool::default());</span>
-<span class="doccomment">//! let peers = (0..num_threads)</span>
-<span class="doccomment">//! .map(|_| Peer::connect(</span>
-<span class="doccomment">//! "btcd-mainnet.lightning.computer:8333",</span>
-<span class="doccomment">//! Arc::clone(&mempool),</span>
-<span class="doccomment">//! Network::Bitcoin,</span>
-<span class="doccomment">//! ))</span>
-<span class="doccomment">//! .collect::<Result<_, _>>()?;</span>
-<span class="doccomment">//! let blockchain = CompactFiltersBlockchain::new(peers, "./wallet-filters", Some(500_000))?;</span>
-<span class="doccomment">//! # Ok::<(), magical::error::Error>(())</span>
-<span class="doccomment">//! ```</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashSet</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">atomic</span>::{<span class="ident">AtomicUsize</span>, <span class="ident">Ordering</span>};
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::{<span class="ident">Arc</span>, <span class="ident">Mutex</span>};
-
-<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_imports</span>)]</span>
-<span class="kw">use</span> <span class="ident">log</span>::{<span class="ident">debug</span>, <span class="ident">error</span>, <span class="ident">info</span>, <span class="ident">trace</span>};
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">message_blockdata</span>::<span class="ident">Inventory</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">OutPoint</span>, <span class="ident">Transaction</span>, <span class="ident">Txid</span>};
-
-<span class="kw">use</span> <span class="ident">rocksdb</span>::{<span class="ident">Options</span>, <span class="ident">SliceTransform</span>, <span class="ident">DB</span>};
-
-<span class="kw">mod</span> <span class="ident">peer</span>;
-<span class="kw">mod</span> <span class="ident">store</span>;
-<span class="kw">mod</span> <span class="ident">sync</span>;
-
-<span class="kw">use</span> <span class="kw">super</span>::{<span class="ident">Blockchain</span>, <span class="ident">Capability</span>, <span class="ident">OnlineBlockchain</span>, <span class="ident">Progress</span>};
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::{<span class="ident">BatchDatabase</span>, <span class="ident">BatchOperations</span>, <span class="ident">DatabaseUtils</span>};
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::{<span class="ident">ScriptType</span>, <span class="ident">TransactionDetails</span>, <span class="ident">UTXO</span>};
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">FeeRate</span>;
-
-<span class="kw">use</span> <span class="ident">peer</span>::<span class="kw-2">*</span>;
-<span class="kw">use</span> <span class="ident">store</span>::<span class="kw-2">*</span>;
-<span class="kw">use</span> <span class="ident">sync</span>::<span class="kw-2">*</span>;
-
-<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">peer</span>::{<span class="ident">Mempool</span>, <span class="ident">Peer</span>};
-
-<span class="kw">const</span> <span class="ident">SYNC_HEADERS_COST</span>: <span class="ident">f32</span> <span class="op">=</span> <span class="number">1.0</span>;
-<span class="kw">const</span> <span class="ident">SYNC_FILTERS_COST</span>: <span class="ident">f32</span> <span class="op">=</span> <span class="number">11.6</span> <span class="op">*</span> <span class="number">1_000.0</span>;
-<span class="kw">const</span> <span class="ident">PROCESS_BLOCKS_COST</span>: <span class="ident">f32</span> <span class="op">=</span> <span class="number">20_000.0</span>;
-
-<span class="doccomment">/// Structure implementing the required blockchain traits</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// ## Example</span>
-<span class="doccomment">/// See the [`blockchain::compact_filters`](crate::blockchain::compact_filters) module for a usage example.</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">CompactFiltersBlockchain</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">CompactFilters</span><span class="op">></span>);
-
-<span class="kw">impl</span> <span class="ident">CompactFiltersBlockchain</span> {
- <span class="doccomment">/// Construct a new instance given a list of peers, a path to store headers and block</span>
- <span class="doccomment">/// filters downloaded during the sync and optionally a number of blocks to ignore starting</span>
- <span class="doccomment">/// from the genesis while scanning for the wallet's outputs.</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// For each [`Peer`] specified a new thread will be spawned to download and verify the filters</span>
- <span class="doccomment">/// in parallel. It's currently recommended to only connect to a single peer to avoid</span>
- <span class="doccomment">/// inconsistencies in the data returned, optionally with multiple connections in parallel to</span>
- <span class="doccomment">/// speed-up the sync process.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span><span class="op"><</span><span class="ident">P</span>: <span class="ident">AsRef</span><span class="op"><</span><span class="ident">Path</span><span class="op">></span><span class="op">></span>(
- <span class="ident">peers</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Peer</span><span class="op">></span>,
- <span class="ident">storage_dir</span>: <span class="ident">P</span>,
- <span class="ident">skip_blocks</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="ident">CompactFiltersBlockchain</span>(<span class="prelude-val">Some</span>(<span class="ident">CompactFilters</span>::<span class="ident">new</span>(
- <span class="ident">peers</span>,
- <span class="ident">storage_dir</span>,
- <span class="ident">skip_blocks</span>,
- )<span class="question-mark">?</span>)))
- }
-}
-
-<span class="doccomment">/// Internal struct that contains the state of a [`CompactFiltersBlockchain`]</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">struct</span> <span class="ident">CompactFilters</span> {
- <span class="ident">peers</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Arc</span><span class="op"><</span><span class="ident">Peer</span><span class="op">></span><span class="op">></span>,
- <span class="ident">headers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Full</span><span class="op">></span><span class="op">></span>,
- <span class="ident">skip_blocks</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
-}
-
-<span class="kw">impl</span> <span class="ident">CompactFilters</span> {
- <span class="doccomment">/// Constructor, see [`CompactFiltersBlockchain::new`] for the documentation</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span><span class="op"><</span><span class="ident">P</span>: <span class="ident">AsRef</span><span class="op"><</span><span class="ident">Path</span><span class="op">></span><span class="op">></span>(
- <span class="ident">peers</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Peer</span><span class="op">></span>,
- <span class="ident">storage_dir</span>: <span class="ident">P</span>,
- <span class="ident">skip_blocks</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">if</span> <span class="ident">peers</span>.<span class="ident">is_empty</span>() {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">NoPeers</span>);
- }
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">opts</span> <span class="op">=</span> <span class="ident">Options</span>::<span class="ident">default</span>();
- <span class="ident">opts</span>.<span class="ident">create_if_missing</span>(<span class="bool-val">true</span>);
- <span class="ident">opts</span>.<span class="ident">set_prefix_extractor</span>(<span class="ident">SliceTransform</span>::<span class="ident">create_fixed_prefix</span>(<span class="number">16</span>));
-
- <span class="kw">let</span> <span class="ident">network</span> <span class="op">=</span> <span class="ident">peers</span>[<span class="number">0</span>].<span class="ident">get_network</span>();
-
- <span class="kw">let</span> <span class="ident">cfs</span> <span class="op">=</span> <span class="ident">DB</span>::<span class="ident">list_cf</span>(<span class="kw-2">&</span><span class="ident">opts</span>, <span class="kw-2">&</span><span class="ident">storage_dir</span>).<span class="ident">unwrap_or</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="string">"default"</span>.<span class="ident">to_string</span>()]);
- <span class="kw">let</span> <span class="ident">db</span> <span class="op">=</span> <span class="ident">DB</span>::<span class="ident">open_cf</span>(<span class="kw-2">&</span><span class="ident">opts</span>, <span class="kw-2">&</span><span class="ident">storage_dir</span>, <span class="kw-2">&</span><span class="ident">cfs</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">headers</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">ChainStore</span>::<span class="ident">new</span>(<span class="ident">db</span>, <span class="ident">network</span>)<span class="question-mark">?</span>);
-
- <span class="comment">// try to recover partial snapshots</span>
- <span class="kw">for</span> <span class="ident">cf_name</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">cfs</span> {
- <span class="kw">if</span> <span class="op">!</span><span class="ident">cf_name</span>.<span class="ident">starts_with</span>(<span class="string">"_headers:"</span>) {
- <span class="kw">continue</span>;
- }
-
- <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Trying to recover: {:?}"</span>, <span class="ident">cf_name</span>);
- <span class="ident">headers</span>.<span class="ident">recover_snapshot</span>(<span class="ident">cf_name</span>)<span class="question-mark">?</span>;
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">CompactFilters</span> {
- <span class="ident">peers</span>: <span class="ident">peers</span>.<span class="ident">into_iter</span>().<span class="ident">map</span>(<span class="ident">Arc</span>::<span class="ident">new</span>).<span class="ident">collect</span>(),
- <span class="ident">headers</span>,
- <span class="ident">skip_blocks</span>,
- })
- }
-
- <span class="doccomment">/// Process a transaction by looking for inputs that spend from a UTXO in the database or</span>
- <span class="doccomment">/// outputs that send funds to a know script_pubkey.</span>
- <span class="kw">fn</span> <span class="ident">process_tx</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
- <span class="ident">tx</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>,
- <span class="ident">height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
- <span class="ident">timestamp</span>: <span class="ident">u64</span>,
- <span class="ident">internal_max_deriv</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
- <span class="ident">external_max_deriv</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">updates</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">begin_batch</span>();
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">incoming</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">outgoing</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">inputs_sum</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">outputs_sum</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
-
- <span class="comment">// look for our own inputs</span>
- <span class="kw">for</span> (<span class="ident">i</span>, <span class="ident">input</span>) <span class="kw">in</span> <span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">previous_output</span>) <span class="op">=</span> <span class="ident">database</span>.<span class="ident">get_previous_output</span>(<span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">previous_output</span>)<span class="question-mark">?</span> {
- <span class="ident">inputs_sum</span> <span class="op">+</span><span class="op">=</span> <span class="ident">previous_output</span>.<span class="ident">value</span>;
-
- <span class="kw">if</span> <span class="ident">database</span>.<span class="ident">is_mine</span>(<span class="kw-2">&</span><span class="ident">previous_output</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span> {
- <span class="ident">outgoing</span> <span class="op">+</span><span class="op">=</span> <span class="ident">previous_output</span>.<span class="ident">value</span>;
-
- <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"{} input #{} is mine, removing from utxo"</span>, <span class="ident">tx</span>.<span class="ident">txid</span>(), <span class="ident">i</span>);
- <span class="ident">updates</span>.<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">previous_output</span>)<span class="question-mark">?</span>;
- }
- }
- }
-
- <span class="kw">for</span> (<span class="ident">i</span>, <span class="ident">output</span>) <span class="kw">in</span> <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
- <span class="comment">// to compute the fees later</span>
- <span class="ident">outputs_sum</span> <span class="op">+</span><span class="op">=</span> <span class="ident">output</span>.<span class="ident">value</span>;
-
- <span class="comment">// this output is ours, we have a path to derive it</span>
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">script_type</span>, <span class="ident">child</span>)) <span class="op">=</span>
- <span class="ident">database</span>.<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">output</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span>
- {
- <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"{} output #{} is mine, adding utxo"</span>, <span class="ident">tx</span>.<span class="ident">txid</span>(), <span class="ident">i</span>);
- <span class="ident">updates</span>.<span class="ident">set_utxo</span>(<span class="kw-2">&</span><span class="ident">UTXO</span> {
- <span class="ident">outpoint</span>: <span class="ident">OutPoint</span>::<span class="ident">new</span>(<span class="ident">tx</span>.<span class="ident">txid</span>(), <span class="ident">i</span> <span class="kw">as</span> <span class="ident">u32</span>),
- <span class="ident">txout</span>: <span class="ident">output</span>.<span class="ident">clone</span>(),
- <span class="ident">is_internal</span>: <span class="ident">script_type</span>.<span class="ident">is_internal</span>(),
- })<span class="question-mark">?</span>;
- <span class="ident">incoming</span> <span class="op">+</span><span class="op">=</span> <span class="ident">output</span>.<span class="ident">value</span>;
-
- <span class="kw">if</span> <span class="ident">script_type</span> <span class="op">=</span><span class="op">=</span> <span class="ident">ScriptType</span>::<span class="ident">Internal</span>
- <span class="kw-2">&</span><span class="op">&</span> (<span class="ident">internal_max_deriv</span>.<span class="ident">is_none</span>() <span class="op">|</span><span class="op">|</span> <span class="ident">child</span> <span class="op">></span> <span class="ident">internal_max_deriv</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>))
- {
- <span class="kw-2">*</span><span class="ident">internal_max_deriv</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">child</span>);
- } <span class="kw">else</span> <span class="kw">if</span> <span class="ident">script_type</span> <span class="op">=</span><span class="op">=</span> <span class="ident">ScriptType</span>::<span class="ident">External</span>
- <span class="kw-2">&</span><span class="op">&</span> (<span class="ident">external_max_deriv</span>.<span class="ident">is_none</span>() <span class="op">|</span><span class="op">|</span> <span class="ident">child</span> <span class="op">></span> <span class="ident">external_max_deriv</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>))
- {
- <span class="kw-2">*</span><span class="ident">external_max_deriv</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">child</span>);
- }
- }
- }
-
- <span class="kw">if</span> <span class="ident">incoming</span> <span class="op">></span> <span class="number">0</span> <span class="op">|</span><span class="op">|</span> <span class="ident">outgoing</span> <span class="op">></span> <span class="number">0</span> {
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">TransactionDetails</span> {
- <span class="ident">txid</span>: <span class="ident">tx</span>.<span class="ident">txid</span>(),
- <span class="ident">transaction</span>: <span class="prelude-val">Some</span>(<span class="ident">tx</span>.<span class="ident">clone</span>()),
- <span class="ident">received</span>: <span class="ident">incoming</span>,
- <span class="ident">sent</span>: <span class="ident">outgoing</span>,
- <span class="ident">height</span>,
- <span class="ident">timestamp</span>,
- <span class="ident">fees</span>: <span class="ident">inputs_sum</span>.<span class="ident">checked_sub</span>(<span class="ident">outputs_sum</span>).<span class="ident">unwrap_or</span>(<span class="number">0</span>),
- };
-
- <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Saving tx {}"</span>, <span class="ident">tx</span>.<span class="ident">txid</span>);
- <span class="ident">updates</span>.<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">tx</span>)<span class="question-mark">?</span>;
- }
-
- <span class="ident">database</span>.<span class="ident">commit_batch</span>(<span class="ident">updates</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-}
-
-<span class="kw">impl</span> <span class="ident">Blockchain</span> <span class="kw">for</span> <span class="ident">CompactFiltersBlockchain</span> {
- <span class="kw">fn</span> <span class="ident">offline</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">CompactFiltersBlockchain</span>(<span class="prelude-val">None</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">is_online</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="self">self</span>.<span class="number">0</span>.<span class="ident">is_some</span>()
- }
-}
-
-<span class="kw">impl</span> <span class="ident">OnlineBlockchain</span> <span class="kw">for</span> <span class="ident">CompactFiltersBlockchain</span> {
- <span class="kw">fn</span> <span class="ident">get_capabilities</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Capability</span><span class="op">></span> {
- <span class="macro">vec</span><span class="macro">!</span>[<span class="ident">Capability</span>::<span class="ident">FullHistory</span>].<span class="ident">into_iter</span>().<span class="ident">collect</span>()
- }
-
- <span class="kw">fn</span> <span class="ident">setup</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span>, <span class="ident">P</span>: <span class="lifetime">'static</span> <span class="op">+</span> <span class="ident">Progress</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">_stop_gap</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>, <span class="comment">// TODO: move to electrum and esplora only</span>
- <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
- <span class="ident">progress_update</span>: <span class="ident">P</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">inner</span> <span class="op">=</span> <span class="self">self</span>.<span class="number">0</span>.<span class="ident">as_ref</span>().<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">OfflineClient</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">first_peer</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">inner</span>.<span class="ident">peers</span>[<span class="number">0</span>];
-
- <span class="kw">let</span> <span class="ident">skip_blocks</span> <span class="op">=</span> <span class="ident">inner</span>.<span class="ident">skip_blocks</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>);
-
- <span class="kw">let</span> <span class="ident">cf_sync</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">CFSync</span>::<span class="ident">new</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">inner</span>.<span class="ident">headers</span>), <span class="ident">skip_blocks</span>, <span class="number">0x00</span>)<span class="question-mark">?</span>);
-
- <span class="kw">let</span> <span class="ident">initial_height</span> <span class="op">=</span> <span class="ident">inner</span>.<span class="ident">headers</span>.<span class="ident">get_height</span>()<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">total_bundles</span> <span class="op">=</span> (<span class="ident">first_peer</span>.<span class="ident">get_version</span>().<span class="ident">start_height</span> <span class="kw">as</span> <span class="ident">usize</span>)
- .<span class="ident">checked_sub</span>(<span class="ident">skip_blocks</span>)
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">/</span> <span class="number">1000</span>)
- .<span class="ident">unwrap_or</span>(<span class="number">0</span>)
- <span class="op">+</span> <span class="number">1</span>;
- <span class="kw">let</span> <span class="ident">expected_bundles_to_sync</span> <span class="op">=</span> <span class="ident">total_bundles</span>
- .<span class="ident">checked_sub</span>(<span class="ident">cf_sync</span>.<span class="ident">pruned_bundles</span>()<span class="question-mark">?</span>)
- .<span class="ident">unwrap_or</span>(<span class="number">0</span>);
-
- <span class="kw">let</span> <span class="ident">headers_cost</span> <span class="op">=</span> (<span class="ident">first_peer</span>.<span class="ident">get_version</span>().<span class="ident">start_height</span> <span class="kw">as</span> <span class="ident">usize</span>)
- .<span class="ident">checked_sub</span>(<span class="ident">initial_height</span>)
- .<span class="ident">unwrap_or</span>(<span class="number">0</span>) <span class="kw">as</span> <span class="ident">f32</span>
- <span class="op">*</span> <span class="ident">SYNC_HEADERS_COST</span>;
- <span class="kw">let</span> <span class="ident">filters_cost</span> <span class="op">=</span> <span class="ident">expected_bundles_to_sync</span> <span class="kw">as</span> <span class="ident">f32</span> <span class="op">*</span> <span class="ident">SYNC_FILTERS_COST</span>;
-
- <span class="kw">let</span> <span class="ident">total_cost</span> <span class="op">=</span> <span class="ident">headers_cost</span> <span class="op">+</span> <span class="ident">filters_cost</span> <span class="op">+</span> <span class="ident">PROCESS_BLOCKS_COST</span>;
-
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">snapshot</span>) <span class="op">=</span> <span class="ident">sync</span>::<span class="ident">sync_headers</span>(
- <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">first_peer</span>),
- <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">inner</span>.<span class="ident">headers</span>),
- <span class="op">|</span><span class="ident">new_height</span><span class="op">|</span> {
- <span class="kw">let</span> <span class="ident">local_headers_cost</span> <span class="op">=</span>
- <span class="ident">new_height</span>.<span class="ident">checked_sub</span>(<span class="ident">initial_height</span>).<span class="ident">unwrap_or</span>(<span class="number">0</span>) <span class="kw">as</span> <span class="ident">f32</span> <span class="op">*</span> <span class="ident">SYNC_HEADERS_COST</span>;
- <span class="ident">progress_update</span>.<span class="ident">update</span>(
- <span class="ident">local_headers_cost</span> <span class="op">/</span> <span class="ident">total_cost</span> <span class="op">*</span> <span class="number">100.0</span>,
- <span class="prelude-val">Some</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"Synced headers to {}"</span>, <span class="ident">new_height</span>)),
- )
- },
- )<span class="question-mark">?</span> {
- <span class="kw">if</span> <span class="ident">snapshot</span>.<span class="ident">work</span>()<span class="question-mark">?</span> <span class="op">></span> <span class="ident">inner</span>.<span class="ident">headers</span>.<span class="ident">work</span>()<span class="question-mark">?</span> {
- <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Applying snapshot with work: {}"</span>, <span class="ident">snapshot</span>.<span class="ident">work</span>()<span class="question-mark">?</span>);
- <span class="ident">inner</span>.<span class="ident">headers</span>.<span class="ident">apply_snapshot</span>(<span class="ident">snapshot</span>)<span class="question-mark">?</span>;
- }
- }
-
- <span class="kw">let</span> <span class="ident">synced_height</span> <span class="op">=</span> <span class="ident">inner</span>.<span class="ident">headers</span>.<span class="ident">get_height</span>()<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">buried_height</span> <span class="op">=</span> <span class="ident">synced_height</span>
- .<span class="ident">checked_sub</span>(<span class="ident">sync</span>::<span class="ident">BURIED_CONFIRMATIONS</span>)
- .<span class="ident">unwrap_or</span>(<span class="number">0</span>);
- <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Synced headers to height: {}"</span>, <span class="ident">synced_height</span>);
-
- <span class="ident">cf_sync</span>.<span class="ident">prepare_sync</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">first_peer</span>))<span class="question-mark">?</span>;
-
- <span class="kw">let</span> <span class="ident">all_scripts</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(
- <span class="ident">database</span>
- .<span class="ident">iter_script_pubkeys</span>(<span class="prelude-val">None</span>)<span class="question-mark">?</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">s</span><span class="op">|</span> <span class="ident">s</span>.<span class="ident">to_bytes</span>())
- .<span class="ident">collect</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span><span class="op">></span>(),
- );
-
- <span class="kw">let</span> <span class="ident">last_synced_block</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Mutex</span>::<span class="ident">new</span>(<span class="ident">synced_height</span>));
- <span class="kw">let</span> <span class="ident">synced_bundles</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">AtomicUsize</span>::<span class="ident">new</span>(<span class="number">0</span>));
- <span class="kw">let</span> <span class="ident">progress_update</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Mutex</span>::<span class="ident">new</span>(<span class="ident">progress_update</span>));
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">threads</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">inner</span>.<span class="ident">peers</span>.<span class="ident">len</span>());
- <span class="kw">for</span> <span class="ident">peer</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">inner</span>.<span class="ident">peers</span> {
- <span class="kw">let</span> <span class="ident">cf_sync</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">cf_sync</span>);
- <span class="kw">let</span> <span class="ident">peer</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">peer</span>);
- <span class="kw">let</span> <span class="ident">headers</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">inner</span>.<span class="ident">headers</span>);
- <span class="kw">let</span> <span class="ident">all_scripts</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">all_scripts</span>);
- <span class="kw">let</span> <span class="ident">last_synced_block</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">last_synced_block</span>);
- <span class="kw">let</span> <span class="ident">progress_update</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">progress_update</span>);
- <span class="kw">let</span> <span class="ident">synced_bundles</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">synced_bundles</span>);
-
- <span class="kw">let</span> <span class="ident">thread</span> <span class="op">=</span> <span class="ident">std</span>::<span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="kw">move</span> <span class="op">|</span><span class="op">|</span> {
- <span class="ident">cf_sync</span>.<span class="ident">capture_thread_for_sync</span>(
- <span class="ident">peer</span>,
- <span class="op">|</span><span class="ident">block_hash</span>, <span class="ident">filter</span><span class="op">|</span> {
- <span class="kw">if</span> <span class="op">!</span><span class="ident">filter</span>
- .<span class="ident">match_any</span>(<span class="ident">block_hash</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">all_scripts</span>.<span class="ident">iter</span>().<span class="ident">map</span>(<span class="ident">AsRef</span>::<span class="ident">as_ref</span>))<span class="question-mark">?</span>
- {
- <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="bool-val">false</span>);
- }
-
- <span class="kw">let</span> <span class="ident">block_height</span> <span class="op">=</span> <span class="ident">headers</span>.<span class="ident">get_height_for</span>(<span class="ident">block_hash</span>)<span class="question-mark">?</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>);
- <span class="kw">let</span> <span class="ident">saved_correct_block</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">headers</span>.<span class="ident">get_full_block</span>(<span class="ident">block_height</span>)<span class="question-mark">?</span> {
- <span class="prelude-val">Some</span>(<span class="ident">block</span>) <span class="kw">if</span> <span class="kw-2">&</span><span class="ident">block</span>.<span class="ident">block_hash</span>() <span class="op">=</span><span class="op">=</span> <span class="ident">block_hash</span> <span class="op">=</span><span class="op">></span> <span class="bool-val">true</span>,
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="bool-val">false</span>,
- };
-
- <span class="kw">if</span> <span class="ident">saved_correct_block</span> {
- <span class="prelude-val">Ok</span>(<span class="bool-val">false</span>)
- } <span class="kw">else</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">last_synced_block</span> <span class="op">=</span> <span class="ident">last_synced_block</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
-
- <span class="comment">// If we download a block older than `last_synced_block`, we update it so that</span>
- <span class="comment">// we know to delete and re-process all txs starting from that height</span>
- <span class="kw">if</span> <span class="ident">block_height</span> <span class="op"><</span> <span class="kw-2">*</span><span class="ident">last_synced_block</span> {
- <span class="kw-2">*</span><span class="ident">last_synced_block</span> <span class="op">=</span> <span class="ident">block_height</span>;
- }
-
- <span class="prelude-val">Ok</span>(<span class="bool-val">true</span>)
- }
- },
- <span class="op">|</span><span class="ident">index</span><span class="op">|</span> {
- <span class="kw">let</span> <span class="ident">synced_bundles</span> <span class="op">=</span> <span class="ident">synced_bundles</span>.<span class="ident">fetch_add</span>(<span class="number">1</span>, <span class="ident">Ordering</span>::<span class="ident">SeqCst</span>);
- <span class="kw">let</span> <span class="ident">local_filters_cost</span> <span class="op">=</span> <span class="ident">synced_bundles</span> <span class="kw">as</span> <span class="ident">f32</span> <span class="op">*</span> <span class="ident">SYNC_FILTERS_COST</span>;
- <span class="ident">progress_update</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>().<span class="ident">update</span>(
- (<span class="ident">headers_cost</span> <span class="op">+</span> <span class="ident">local_filters_cost</span>) <span class="op">/</span> <span class="ident">total_cost</span> <span class="op">*</span> <span class="number">100.0</span>,
- <span class="prelude-val">Some</span>(<span class="macro">format</span><span class="macro">!</span>(
- <span class="string">"Synced filters {} - {}"</span>,
- <span class="ident">index</span> <span class="op">*</span> <span class="number">1000</span> <span class="op">+</span> <span class="number">1</span>,
- (<span class="ident">index</span> <span class="op">+</span> <span class="number">1</span>) <span class="op">*</span> <span class="number">1000</span>
- )),
- )
- },
- )
- });
-
- <span class="ident">threads</span>.<span class="ident">push</span>(<span class="ident">thread</span>);
- }
-
- <span class="kw">for</span> <span class="ident">t</span> <span class="kw">in</span> <span class="ident">threads</span> {
- <span class="ident">t</span>.<span class="ident">join</span>().<span class="ident">unwrap</span>()<span class="question-mark">?</span>;
- }
-
- <span class="ident">progress_update</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>().<span class="ident">update</span>(
- (<span class="ident">headers_cost</span> <span class="op">+</span> <span class="ident">filters_cost</span>) <span class="op">/</span> <span class="ident">total_cost</span> <span class="op">*</span> <span class="number">100.0</span>,
- <span class="prelude-val">Some</span>(<span class="string">"Processing downloaded blocks and mempool"</span>.<span class="ident">into</span>()),
- )<span class="question-mark">?</span>;
-
- <span class="comment">// delete all txs newer than last_synced_block</span>
- <span class="kw">let</span> <span class="ident">last_synced_block</span> <span class="op">=</span> <span class="kw-2">*</span><span class="ident">last_synced_block</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
- <span class="ident">log</span>::<span class="macro">debug</span><span class="macro">!</span>(
- <span class="string">"Dropping transactions newer than `last_synced_block` = {}"</span>,
- <span class="ident">last_synced_block</span>
- );
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">updates</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">begin_batch</span>();
- <span class="kw">for</span> <span class="ident">details</span> <span class="kw">in</span> <span class="ident">database</span>.<span class="ident">iter_txs</span>(<span class="bool-val">false</span>)<span class="question-mark">?</span> {
- <span class="kw">match</span> <span class="ident">details</span>.<span class="ident">height</span> {
- <span class="prelude-val">Some</span>(<span class="ident">height</span>) <span class="kw">if</span> (<span class="ident">height</span> <span class="kw">as</span> <span class="ident">usize</span>) <span class="op"><</span> <span class="ident">last_synced_block</span> <span class="op">=</span><span class="op">></span> <span class="kw">continue</span>,
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="ident">updates</span>.<span class="ident">del_tx</span>(<span class="kw-2">&</span><span class="ident">details</span>.<span class="ident">txid</span>, <span class="bool-val">false</span>)<span class="question-mark">?</span>,
- };
- }
- <span class="ident">database</span>.<span class="ident">commit_batch</span>(<span class="ident">updates</span>)<span class="question-mark">?</span>;
-
- <span class="ident">first_peer</span>.<span class="ident">ask_for_mempool</span>()<span class="question-mark">?</span>;
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">internal_max_deriv</span> <span class="op">=</span> <span class="prelude-val">None</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">external_max_deriv</span> <span class="op">=</span> <span class="prelude-val">None</span>;
-
- <span class="kw">for</span> (<span class="ident">height</span>, <span class="ident">block</span>) <span class="kw">in</span> <span class="ident">inner</span>.<span class="ident">headers</span>.<span class="ident">iter_full_blocks</span>()<span class="question-mark">?</span> {
- <span class="kw">for</span> <span class="ident">tx</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">block</span>.<span class="ident">txdata</span> {
- <span class="ident">inner</span>.<span class="ident">process_tx</span>(
- <span class="ident">database</span>,
- <span class="ident">tx</span>,
- <span class="prelude-val">Some</span>(<span class="ident">height</span> <span class="kw">as</span> <span class="ident">u32</span>),
- <span class="number">0</span>,
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">internal_max_deriv</span>,
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">external_max_deriv</span>,
- )<span class="question-mark">?</span>;
- }
- }
- <span class="kw">for</span> <span class="ident">tx</span> <span class="kw">in</span> <span class="ident">first_peer</span>.<span class="ident">get_mempool</span>().<span class="ident">iter_txs</span>().<span class="ident">iter</span>() {
- <span class="ident">inner</span>.<span class="ident">process_tx</span>(
- <span class="ident">database</span>,
- <span class="ident">tx</span>,
- <span class="prelude-val">None</span>,
- <span class="number">0</span>,
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">internal_max_deriv</span>,
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">external_max_deriv</span>,
- )<span class="question-mark">?</span>;
- }
-
- <span class="kw">let</span> <span class="ident">current_ext</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">get_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>)<span class="question-mark">?</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>);
- <span class="kw">let</span> <span class="ident">first_ext_new</span> <span class="op">=</span> <span class="ident">external_max_deriv</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">+</span> <span class="number">1</span>).<span class="ident">unwrap_or</span>(<span class="number">0</span>);
- <span class="kw">if</span> <span class="ident">first_ext_new</span> <span class="op">></span> <span class="ident">current_ext</span> {
- <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Setting external index to {}"</span>, <span class="ident">first_ext_new</span>);
- <span class="ident">database</span>.<span class="ident">set_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="ident">first_ext_new</span>)<span class="question-mark">?</span>;
- }
-
- <span class="kw">let</span> <span class="ident">current_int</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">get_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>)<span class="question-mark">?</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>);
- <span class="kw">let</span> <span class="ident">first_int_new</span> <span class="op">=</span> <span class="ident">internal_max_deriv</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">+</span> <span class="number">1</span>).<span class="ident">unwrap_or</span>(<span class="number">0</span>);
- <span class="kw">if</span> <span class="ident">first_int_new</span> <span class="op">></span> <span class="ident">current_int</span> {
- <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Setting internal index to {}"</span>, <span class="ident">first_int_new</span>);
- <span class="ident">database</span>.<span class="ident">set_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>, <span class="ident">first_int_new</span>)<span class="question-mark">?</span>;
- }
-
- <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Dropping blocks until {}"</span>, <span class="ident">buried_height</span>);
- <span class="ident">inner</span>.<span class="ident">headers</span>.<span class="ident">delete_blocks_until</span>(<span class="ident">buried_height</span>)<span class="question-mark">?</span>;
-
- <span class="ident">progress_update</span>
- .<span class="ident">lock</span>()
- .<span class="ident">unwrap</span>()
- .<span class="ident">update</span>(<span class="number">100.0</span>, <span class="prelude-val">Some</span>(<span class="string">"Done"</span>.<span class="ident">into</span>()))<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">inner</span> <span class="op">=</span> <span class="self">self</span>.<span class="number">0</span>.<span class="ident">as_ref</span>().<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">OfflineClient</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">inner</span>.<span class="ident">peers</span>[<span class="number">0</span>]
- .<span class="ident">get_mempool</span>()
- .<span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="ident">Inventory</span>::<span class="ident">Transaction</span>(<span class="kw-2">*</span><span class="ident">txid</span>)))
- }
-
- <span class="kw">fn</span> <span class="ident">broadcast</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">inner</span> <span class="op">=</span> <span class="self">self</span>.<span class="number">0</span>.<span class="ident">as_ref</span>().<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">OfflineClient</span>)<span class="question-mark">?</span>;
- <span class="ident">inner</span>.<span class="ident">peers</span>[<span class="number">0</span>].<span class="ident">broadcast_tx</span>(<span class="ident">tx</span>.<span class="ident">clone</span>())<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">fn</span> <span class="ident">get_height</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">inner</span> <span class="op">=</span> <span class="self">self</span>.<span class="number">0</span>.<span class="ident">as_ref</span>().<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">OfflineClient</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">inner</span>.<span class="ident">headers</span>.<span class="ident">get_height</span>()<span class="question-mark">?</span> <span class="kw">as</span> <span class="ident">u32</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">estimate_fee</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">_target</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">FeeRate</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="comment">// TODO</span>
- <span class="prelude-val">Ok</span>(<span class="ident">FeeRate</span>::<span class="ident">default</span>())
- }
-}
-
-<span class="doccomment">/// An error that can occur during sync with a [`CompactFiltersBlockchain`]</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">CompactFiltersError</span> {
- <span class="doccomment">/// A peer sent an invalid or unexpected response</span>
- <span class="ident">InvalidResponse</span>,
- <span class="doccomment">/// The headers returned are invalid</span>
- <span class="ident">InvalidHeaders</span>,
- <span class="doccomment">/// The compact filter headers returned are invalid</span>
- <span class="ident">InvalidFilterHeader</span>,
- <span class="doccomment">/// The compact filter returned is invalid</span>
- <span class="ident">InvalidFilter</span>,
- <span class="doccomment">/// The peer is missing a block in the valid chain</span>
- <span class="ident">MissingBlock</span>,
- <span class="doccomment">/// The data stored in the block filters storage are corrupted</span>
- <span class="ident">DataCorruption</span>,
-
- <span class="doccomment">/// A peer is not connected</span>
- <span class="ident">NotConnected</span>,
- <span class="doccomment">/// A peer took too long to reply to one of our messages</span>
- <span class="ident">Timeout</span>,
-
- <span class="doccomment">/// No peers have been specified</span>
- <span class="ident">NoPeers</span>,
-
- <span class="doccomment">/// Internal database error</span>
- <span class="ident">DB</span>(<span class="ident">rocksdb</span>::<span class="ident">Error</span>),
- <span class="doccomment">/// Internal I/O error</span>
- <span class="ident">IO</span>(<span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">Error</span>),
- <span class="doccomment">/// Invalid BIP158 filter</span>
- <span class="ident">BIP158</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip158</span>::<span class="ident">Error</span>),
- <span class="doccomment">/// Internal system time error</span>
- <span class="ident">Time</span>(<span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">SystemTimeError</span>),
-
- <span class="doccomment">/// Wrapper for [`crate::error::Error`]</span>
- <span class="ident">Global</span>(<span class="ident">Box</span><span class="op"><</span><span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span><span class="op">></span>),
-}
-
-<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">CompactFiltersError</span> {
- <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
- <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"{:?}"</span>, <span class="self">self</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span> <span class="kw">for</span> <span class="ident">CompactFiltersError</span> {}
-
-<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_error</span> {
- ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">from</span>:<span class="ident">ty</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">to</span>:<span class="ident">ident</span> ) <span class="op">=</span><span class="op">></span> {
- <span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">convert</span>::<span class="ident">From</span><span class="op"><</span><span class="macro-nonterminal">$</span><span class="macro-nonterminal">from</span><span class="op">></span> <span class="kw">for</span> <span class="ident">CompactFiltersError</span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">err</span>: <span class="macro-nonterminal">$</span><span class="macro-nonterminal">from</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">CompactFiltersError</span>::<span class="macro-nonterminal">$</span><span class="macro-nonterminal">to</span>(<span class="ident">err</span>)
- }
- }
- };
-}
-
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">rocksdb</span>::<span class="ident">Error</span>, <span class="ident">DB</span>);
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">Error</span>, <span class="ident">IO</span>);
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip158</span>::<span class="ident">Error</span>, <span class="ident">BIP158</span>);
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">SystemTimeError</span>, <span class="ident">Time</span>);
-
-<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span><span class="op">></span> <span class="kw">for</span> <span class="ident">CompactFiltersError</span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">err</span>: <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">CompactFiltersError</span>::<span class="ident">Global</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">err</span>))
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "magical";</script><script src="../../../../main.js"></script><script src="../../../../source-script.js"></script><script src="../../../../source-files.js"></script><script defer src="../../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/blockchain/compact_filters/peer.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>peer.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../../magical/index.html'><div class='logo-container'><img src='../../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-<span id="203">203</span>
-<span id="204">204</span>
-<span id="205">205</span>
-<span id="206">206</span>
-<span id="207">207</span>
-<span id="208">208</span>
-<span id="209">209</span>
-<span id="210">210</span>
-<span id="211">211</span>
-<span id="212">212</span>
-<span id="213">213</span>
-<span id="214">214</span>
-<span id="215">215</span>
-<span id="216">216</span>
-<span id="217">217</span>
-<span id="218">218</span>
-<span id="219">219</span>
-<span id="220">220</span>
-<span id="221">221</span>
-<span id="222">222</span>
-<span id="223">223</span>
-<span id="224">224</span>
-<span id="225">225</span>
-<span id="226">226</span>
-<span id="227">227</span>
-<span id="228">228</span>
-<span id="229">229</span>
-<span id="230">230</span>
-<span id="231">231</span>
-<span id="232">232</span>
-<span id="233">233</span>
-<span id="234">234</span>
-<span id="235">235</span>
-<span id="236">236</span>
-<span id="237">237</span>
-<span id="238">238</span>
-<span id="239">239</span>
-<span id="240">240</span>
-<span id="241">241</span>
-<span id="242">242</span>
-<span id="243">243</span>
-<span id="244">244</span>
-<span id="245">245</span>
-<span id="246">246</span>
-<span id="247">247</span>
-<span id="248">248</span>
-<span id="249">249</span>
-<span id="250">250</span>
-<span id="251">251</span>
-<span id="252">252</span>
-<span id="253">253</span>
-<span id="254">254</span>
-<span id="255">255</span>
-<span id="256">256</span>
-<span id="257">257</span>
-<span id="258">258</span>
-<span id="259">259</span>
-<span id="260">260</span>
-<span id="261">261</span>
-<span id="262">262</span>
-<span id="263">263</span>
-<span id="264">264</span>
-<span id="265">265</span>
-<span id="266">266</span>
-<span id="267">267</span>
-<span id="268">268</span>
-<span id="269">269</span>
-<span id="270">270</span>
-<span id="271">271</span>
-<span id="272">272</span>
-<span id="273">273</span>
-<span id="274">274</span>
-<span id="275">275</span>
-<span id="276">276</span>
-<span id="277">277</span>
-<span id="278">278</span>
-<span id="279">279</span>
-<span id="280">280</span>
-<span id="281">281</span>
-<span id="282">282</span>
-<span id="283">283</span>
-<span id="284">284</span>
-<span id="285">285</span>
-<span id="286">286</span>
-<span id="287">287</span>
-<span id="288">288</span>
-<span id="289">289</span>
-<span id="290">290</span>
-<span id="291">291</span>
-<span id="292">292</span>
-<span id="293">293</span>
-<span id="294">294</span>
-<span id="295">295</span>
-<span id="296">296</span>
-<span id="297">297</span>
-<span id="298">298</span>
-<span id="299">299</span>
-<span id="300">300</span>
-<span id="301">301</span>
-<span id="302">302</span>
-<span id="303">303</span>
-<span id="304">304</span>
-<span id="305">305</span>
-<span id="306">306</span>
-<span id="307">307</span>
-<span id="308">308</span>
-<span id="309">309</span>
-<span id="310">310</span>
-<span id="311">311</span>
-<span id="312">312</span>
-<span id="313">313</span>
-<span id="314">314</span>
-<span id="315">315</span>
-<span id="316">316</span>
-<span id="317">317</span>
-<span id="318">318</span>
-<span id="319">319</span>
-<span id="320">320</span>
-<span id="321">321</span>
-<span id="322">322</span>
-<span id="323">323</span>
-<span id="324">324</span>
-<span id="325">325</span>
-<span id="326">326</span>
-<span id="327">327</span>
-<span id="328">328</span>
-<span id="329">329</span>
-<span id="330">330</span>
-<span id="331">331</span>
-<span id="332">332</span>
-<span id="333">333</span>
-<span id="334">334</span>
-<span id="335">335</span>
-<span id="336">336</span>
-<span id="337">337</span>
-<span id="338">338</span>
-<span id="339">339</span>
-<span id="340">340</span>
-<span id="341">341</span>
-<span id="342">342</span>
-<span id="343">343</span>
-<span id="344">344</span>
-<span id="345">345</span>
-<span id="346">346</span>
-<span id="347">347</span>
-<span id="348">348</span>
-<span id="349">349</span>
-<span id="350">350</span>
-<span id="351">351</span>
-<span id="352">352</span>
-<span id="353">353</span>
-<span id="354">354</span>
-<span id="355">355</span>
-<span id="356">356</span>
-<span id="357">357</span>
-<span id="358">358</span>
-<span id="359">359</span>
-<span id="360">360</span>
-<span id="361">361</span>
-<span id="362">362</span>
-<span id="363">363</span>
-<span id="364">364</span>
-<span id="365">365</span>
-<span id="366">366</span>
-<span id="367">367</span>
-<span id="368">368</span>
-<span id="369">369</span>
-<span id="370">370</span>
-<span id="371">371</span>
-<span id="372">372</span>
-<span id="373">373</span>
-<span id="374">374</span>
-<span id="375">375</span>
-<span id="376">376</span>
-<span id="377">377</span>
-<span id="378">378</span>
-<span id="379">379</span>
-<span id="380">380</span>
-<span id="381">381</span>
-<span id="382">382</span>
-<span id="383">383</span>
-<span id="384">384</span>
-<span id="385">385</span>
-<span id="386">386</span>
-<span id="387">387</span>
-<span id="388">388</span>
-<span id="389">389</span>
-<span id="390">390</span>
-<span id="391">391</span>
-<span id="392">392</span>
-<span id="393">393</span>
-<span id="394">394</span>
-<span id="395">395</span>
-<span id="396">396</span>
-<span id="397">397</span>
-<span id="398">398</span>
-<span id="399">399</span>
-<span id="400">400</span>
-<span id="401">401</span>
-<span id="402">402</span>
-<span id="403">403</span>
-<span id="404">404</span>
-<span id="405">405</span>
-<span id="406">406</span>
-<span id="407">407</span>
-<span id="408">408</span>
-<span id="409">409</span>
-<span id="410">410</span>
-<span id="411">411</span>
-<span id="412">412</span>
-<span id="413">413</span>
-<span id="414">414</span>
-<span id="415">415</span>
-<span id="416">416</span>
-<span id="417">417</span>
-<span id="418">418</span>
-<span id="419">419</span>
-<span id="420">420</span>
-<span id="421">421</span>
-<span id="422">422</span>
-<span id="423">423</span>
-<span id="424">424</span>
-<span id="425">425</span>
-<span id="426">426</span>
-<span id="427">427</span>
-<span id="428">428</span>
-<span id="429">429</span>
-<span id="430">430</span>
-<span id="431">431</span>
-<span id="432">432</span>
-<span id="433">433</span>
-<span id="434">434</span>
-<span id="435">435</span>
-<span id="436">436</span>
-<span id="437">437</span>
-<span id="438">438</span>
-<span id="439">439</span>
-<span id="440">440</span>
-<span id="441">441</span>
-<span id="442">442</span>
-<span id="443">443</span>
-<span id="444">444</span>
-<span id="445">445</span>
-<span id="446">446</span>
-<span id="447">447</span>
-<span id="448">448</span>
-<span id="449">449</span>
-<span id="450">450</span>
-<span id="451">451</span>
-<span id="452">452</span>
-<span id="453">453</span>
-<span id="454">454</span>
-<span id="455">455</span>
-<span id="456">456</span>
-<span id="457">457</span>
-<span id="458">458</span>
-<span id="459">459</span>
-<span id="460">460</span>
-<span id="461">461</span>
-<span id="462">462</span>
-<span id="463">463</span>
-<span id="464">464</span>
-<span id="465">465</span>
-<span id="466">466</span>
-<span id="467">467</span>
-<span id="468">468</span>
-<span id="469">469</span>
-<span id="470">470</span>
-<span id="471">471</span>
-<span id="472">472</span>
-<span id="473">473</span>
-<span id="474">474</span>
-<span id="475">475</span>
-<span id="476">476</span>
-<span id="477">477</span>
-<span id="478">478</span>
-<span id="479">479</span>
-<span id="480">480</span>
-<span id="481">481</span>
-<span id="482">482</span>
-<span id="483">483</span>
-<span id="484">484</span>
-<span id="485">485</span>
-<span id="486">486</span>
-<span id="487">487</span>
-<span id="488">488</span>
-<span id="489">489</span>
-<span id="490">490</span>
-<span id="491">491</span>
-<span id="492">492</span>
-<span id="493">493</span>
-<span id="494">494</span>
-<span id="495">495</span>
-<span id="496">496</span>
-<span id="497">497</span>
-<span id="498">498</span>
-<span id="499">499</span>
-<span id="500">500</span>
-<span id="501">501</span>
-<span id="502">502</span>
-<span id="503">503</span>
-<span id="504">504</span>
-<span id="505">505</span>
-<span id="506">506</span>
-<span id="507">507</span>
-<span id="508">508</span>
-<span id="509">509</span>
-<span id="510">510</span>
-<span id="511">511</span>
-<span id="512">512</span>
-<span id="513">513</span>
-<span id="514">514</span>
-<span id="515">515</span>
-<span id="516">516</span>
-<span id="517">517</span>
-<span id="518">518</span>
-<span id="519">519</span>
-<span id="520">520</span>
-<span id="521">521</span>
-<span id="522">522</span>
-<span id="523">523</span>
-<span id="524">524</span>
-<span id="525">525</span>
-<span id="526">526</span>
-<span id="527">527</span>
-<span id="528">528</span>
-<span id="529">529</span>
-<span id="530">530</span>
-<span id="531">531</span>
-<span id="532">532</span>
-<span id="533">533</span>
-<span id="534">534</span>
-<span id="535">535</span>
-<span id="536">536</span>
-<span id="537">537</span>
-<span id="538">538</span>
-<span id="539">539</span>
-<span id="540">540</span>
-<span id="541">541</span>
-<span id="542">542</span>
-<span id="543">543</span>
-<span id="544">544</span>
-<span id="545">545</span>
-<span id="546">546</span>
-<span id="547">547</span>
-<span id="548">548</span>
-<span id="549">549</span>
-<span id="550">550</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashMap</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">net</span>::{<span class="ident">TcpStream</span>, <span class="ident">ToSocketAddrs</span>};
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::{<span class="ident">Arc</span>, <span class="ident">Condvar</span>, <span class="ident">Mutex</span>, <span class="ident">RwLock</span>};
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">thread</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::{<span class="ident">Duration</span>, <span class="ident">SystemTime</span>, <span class="ident">UNIX_EPOCH</span>};
-
-<span class="kw">use</span> <span class="ident">socks</span>::{<span class="ident">Socks5Stream</span>, <span class="ident">ToTargetAddr</span>};
-
-<span class="kw">use</span> <span class="ident">rand</span>::{<span class="ident">thread_rng</span>, <span class="ident">Rng</span>};
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">Encodable</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hash_types</span>::<span class="ident">BlockHash</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">Hash</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">constants</span>::<span class="ident">ServiceFlags</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">message</span>::{<span class="ident">NetworkMessage</span>, <span class="ident">RawNetworkMessage</span>};
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">message_blockdata</span>::<span class="kw-2">*</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">message_filter</span>::<span class="kw-2">*</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">message_network</span>::<span class="ident">VersionMessage</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">stream_reader</span>::<span class="ident">StreamReader</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">Address</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Block</span>, <span class="ident">Network</span>, <span class="ident">Transaction</span>, <span class="ident">Txid</span>};
-
-<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">CompactFiltersError</span>;
-
-<span class="kw">type</span> <span class="ident">ResponsesMap</span> <span class="op">=</span> <span class="ident">HashMap</span><span class="op"><</span><span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span>, <span class="ident">Arc</span><span class="op"><</span>(<span class="ident">Mutex</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">NetworkMessage</span><span class="op">></span><span class="op">></span>, <span class="ident">Condvar</span>)<span class="op">></span><span class="op">></span>;
-
-<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const</span> <span class="ident">TIMEOUT_SECS</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">30</span>;
-
-<span class="doccomment">/// Container for unconfirmed, but valid Bitcoin transactions</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// It is normally shared between [`Peer`]s with the use of [`Arc`], so that transactions are not</span>
-<span class="doccomment">/// duplicated in memory.</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Default</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Mempool</span> {
- <span class="ident">txs</span>: <span class="ident">RwLock</span><span class="op"><</span><span class="ident">HashMap</span><span class="op"><</span><span class="ident">Txid</span>, <span class="ident">Transaction</span><span class="op">></span><span class="op">></span>,
-}
-
-<span class="kw">impl</span> <span class="ident">Mempool</span> {
- <span class="doccomment">/// Add a transaction to the mempool</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// Note that this doesn't propagate the transaction to other</span>
- <span class="doccomment">/// peers. To do that, [`broadcast`](crate::blockchain::OnlineBlockchain::broadcast) should be used.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">add_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="ident">Transaction</span>) {
- <span class="self">self</span>.<span class="ident">txs</span>.<span class="ident">write</span>().<span class="ident">unwrap</span>().<span class="ident">insert</span>(<span class="ident">tx</span>.<span class="ident">txid</span>(), <span class="ident">tx</span>);
- }
-
- <span class="doccomment">/// Look-up a transaction in the mempool given an [`Inventory`] request</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">inventory</span>: <span class="kw-2">&</span><span class="ident">Inventory</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">inventory</span> {
- <span class="ident">Inventory</span>::<span class="ident">Error</span> <span class="op">|</span> <span class="ident">Inventory</span>::<span class="ident">Block</span>(<span class="kw">_</span>) <span class="op">|</span> <span class="ident">Inventory</span>::<span class="ident">WitnessBlock</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">None</span>,
- <span class="ident">Inventory</span>::<span class="ident">Transaction</span>(<span class="ident">txid</span>) <span class="op">=</span><span class="op">></span> <span class="kw-2">*</span><span class="ident">txid</span>,
- <span class="ident">Inventory</span>::<span class="ident">WitnessTransaction</span>(<span class="ident">wtxid</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Txid</span>::<span class="ident">from_inner</span>(<span class="ident">wtxid</span>.<span class="ident">into_inner</span>()),
- };
- <span class="self">self</span>.<span class="ident">txs</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>().<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">txid</span>).<span class="ident">cloned</span>()
- }
-
- <span class="doccomment">/// Return whether or not the mempool contains a transaction with a given txid</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">has_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="self">self</span>.<span class="ident">txs</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>().<span class="ident">contains_key</span>(<span class="ident">txid</span>)
- }
-
- <span class="doccomment">/// Return the list of transactions contained in the mempool</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">iter_txs</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span> {
- <span class="self">self</span>.<span class="ident">txs</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>().<span class="ident">values</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>()
- }
-}
-
-<span class="doccomment">/// A Bitcoin peer</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Peer</span> {
- <span class="ident">writer</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mutex</span><span class="op"><</span><span class="ident">TcpStream</span><span class="op">></span><span class="op">></span>,
- <span class="ident">responses</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">RwLock</span><span class="op"><</span><span class="ident">ResponsesMap</span><span class="op">></span><span class="op">></span>,
-
- <span class="ident">reader_thread</span>: <span class="ident">thread</span>::<span class="ident">JoinHandle</span><span class="op"><</span>()<span class="op">></span>,
- <span class="ident">connected</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">RwLock</span><span class="op"><</span><span class="ident">bool</span><span class="op">></span><span class="op">></span>,
-
- <span class="ident">mempool</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mempool</span><span class="op">></span>,
-
- <span class="ident">version</span>: <span class="ident">VersionMessage</span>,
- <span class="ident">network</span>: <span class="ident">Network</span>,
-}
-
-<span class="kw">impl</span> <span class="ident">Peer</span> {
- <span class="doccomment">/// Connect to a peer over a plaintext TCP connection</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// This function internally spawns a new thread that will monitor incoming messages from the</span>
- <span class="doccomment">/// peer, and optionally reply to some of them transparently, like [pings](NetworkMessage::Ping)</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">connect</span><span class="op"><</span><span class="ident">A</span>: <span class="ident">ToSocketAddrs</span><span class="op">></span>(
- <span class="ident">address</span>: <span class="ident">A</span>,
- <span class="ident">mempool</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mempool</span><span class="op">></span>,
- <span class="ident">network</span>: <span class="ident">Network</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">stream</span> <span class="op">=</span> <span class="ident">TcpStream</span>::<span class="ident">connect</span>(<span class="ident">address</span>)<span class="question-mark">?</span>;
-
- <span class="ident">Peer</span>::<span class="ident">from_stream</span>(<span class="ident">stream</span>, <span class="ident">mempool</span>, <span class="ident">network</span>)
- }
-
- <span class="doccomment">/// Connect to a peer through a SOCKS5 proxy, optionally by using some credentials, specified</span>
- <span class="doccomment">/// as a tuple of `(username, password)`</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// This function internally spawns a new thread that will monitor incoming messages from the</span>
- <span class="doccomment">/// peer, and optionally reply to some of them transparently, like [pings](NetworkMessage::Ping)</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">connect_proxy</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">ToTargetAddr</span>, <span class="ident">P</span>: <span class="ident">ToSocketAddrs</span><span class="op">></span>(
- <span class="ident">target</span>: <span class="ident">T</span>,
- <span class="ident">proxy</span>: <span class="ident">P</span>,
- <span class="ident">credentials</span>: <span class="prelude-ty">Option</span><span class="op"><</span>(<span class="kw-2">&</span><span class="ident">str</span>, <span class="kw-2">&</span><span class="ident">str</span>)<span class="op">></span>,
- <span class="ident">mempool</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mempool</span><span class="op">></span>,
- <span class="ident">network</span>: <span class="ident">Network</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">socks_stream</span> <span class="op">=</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">username</span>, <span class="ident">password</span>)) <span class="op">=</span> <span class="ident">credentials</span> {
- <span class="ident">Socks5Stream</span>::<span class="ident">connect_with_password</span>(<span class="ident">proxy</span>, <span class="ident">target</span>, <span class="ident">username</span>, <span class="ident">password</span>)<span class="question-mark">?</span>
- } <span class="kw">else</span> {
- <span class="ident">Socks5Stream</span>::<span class="ident">connect</span>(<span class="ident">proxy</span>, <span class="ident">target</span>)<span class="question-mark">?</span>
- };
-
- <span class="ident">Peer</span>::<span class="ident">from_stream</span>(<span class="ident">socks_stream</span>.<span class="ident">into_inner</span>(), <span class="ident">mempool</span>, <span class="ident">network</span>)
- }
-
- <span class="doccomment">/// Create a [`Peer`] from an already connected TcpStream</span>
- <span class="kw">fn</span> <span class="ident">from_stream</span>(
- <span class="ident">stream</span>: <span class="ident">TcpStream</span>,
- <span class="ident">mempool</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mempool</span><span class="op">></span>,
- <span class="ident">network</span>: <span class="ident">Network</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">writer</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Mutex</span>::<span class="ident">new</span>(<span class="ident">stream</span>.<span class="ident">try_clone</span>()<span class="question-mark">?</span>));
- <span class="kw">let</span> <span class="ident">responses</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">RwLock</span><span class="op"><</span><span class="ident">ResponsesMap</span><span class="op">></span><span class="op">></span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">RwLock</span>::<span class="ident">new</span>(<span class="ident">HashMap</span>::<span class="ident">new</span>()));
- <span class="kw">let</span> <span class="ident">connected</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">RwLock</span>::<span class="ident">new</span>(<span class="bool-val">true</span>));
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">locked_writer</span> <span class="op">=</span> <span class="ident">writer</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">reader_thread_responses</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">responses</span>);
- <span class="kw">let</span> <span class="ident">reader_thread_writer</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">writer</span>);
- <span class="kw">let</span> <span class="ident">reader_thread_mempool</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">mempool</span>);
- <span class="kw">let</span> <span class="ident">reader_thread_connected</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">connected</span>);
- <span class="kw">let</span> <span class="ident">reader_thread</span> <span class="op">=</span> <span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="kw">move</span> <span class="op">|</span><span class="op">|</span> {
- <span class="self">Self</span>::<span class="ident">reader_thread</span>(
- <span class="ident">network</span>,
- <span class="ident">stream</span>,
- <span class="ident">reader_thread_responses</span>,
- <span class="ident">reader_thread_writer</span>,
- <span class="ident">reader_thread_mempool</span>,
- <span class="ident">reader_thread_connected</span>,
- )
- });
-
- <span class="kw">let</span> <span class="ident">timestamp</span> <span class="op">=</span> <span class="ident">SystemTime</span>::<span class="ident">now</span>().<span class="ident">duration_since</span>(<span class="ident">UNIX_EPOCH</span>)<span class="question-mark">?</span>.<span class="ident">as_secs</span>() <span class="kw">as</span> <span class="ident">i64</span>;
- <span class="kw">let</span> <span class="ident">nonce</span> <span class="op">=</span> <span class="ident">thread_rng</span>().<span class="ident">gen</span>();
- <span class="kw">let</span> <span class="ident">receiver</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="ident">locked_writer</span>.<span class="ident">peer_addr</span>()<span class="question-mark">?</span>, <span class="ident">ServiceFlags</span>::<span class="ident">NONE</span>);
- <span class="kw">let</span> <span class="ident">sender</span> <span class="op">=</span> <span class="ident">Address</span> {
- <span class="ident">services</span>: <span class="ident">ServiceFlags</span>::<span class="ident">NONE</span>,
- <span class="ident">address</span>: [<span class="number">0u16</span>; <span class="number">8</span>],
- <span class="ident">port</span>: <span class="number">0</span>,
- };
-
- <span class="self">Self</span>::<span class="ident">_send</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">locked_writer</span>,
- <span class="ident">network</span>.<span class="ident">magic</span>(),
- <span class="ident">NetworkMessage</span>::<span class="ident">Version</span>(<span class="ident">VersionMessage</span>::<span class="ident">new</span>(
- <span class="ident">ServiceFlags</span>::<span class="ident">WITNESS</span>,
- <span class="ident">timestamp</span>,
- <span class="ident">receiver</span>,
- <span class="ident">sender</span>,
- <span class="ident">nonce</span>,
- <span class="string">"MagicalBitcoinWallet"</span>.<span class="ident">into</span>(),
- <span class="number">0</span>,
- )),
- )<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">version</span> <span class="op">=</span> <span class="kw">if</span> <span class="kw">let</span> <span class="ident">NetworkMessage</span>::<span class="ident">Version</span>(<span class="ident">version</span>) <span class="op">=</span>
- <span class="self">Self</span>::<span class="ident">_recv</span>(<span class="kw-2">&</span><span class="ident">responses</span>, <span class="string">"version"</span>, <span class="prelude-val">None</span>)<span class="question-mark">?</span>.<span class="ident">unwrap</span>()
- {
- <span class="ident">version</span>
- } <span class="kw">else</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>);
- };
-
- <span class="kw">if</span> <span class="kw">let</span> <span class="ident">NetworkMessage</span>::<span class="ident">Verack</span> <span class="op">=</span> <span class="self">Self</span>::<span class="ident">_recv</span>(<span class="kw-2">&</span><span class="ident">responses</span>, <span class="string">"verack"</span>, <span class="prelude-val">None</span>)<span class="question-mark">?</span>.<span class="ident">unwrap</span>() {
- <span class="self">Self</span>::<span class="ident">_send</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">locked_writer</span>, <span class="ident">network</span>.<span class="ident">magic</span>(), <span class="ident">NetworkMessage</span>::<span class="ident">Verack</span>)<span class="question-mark">?</span>;
- } <span class="kw">else</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>);
- }
-
- <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">locked_writer</span>);
-
- <span class="prelude-val">Ok</span>(<span class="ident">Peer</span> {
- <span class="ident">writer</span>,
- <span class="ident">reader_thread</span>,
- <span class="ident">responses</span>,
- <span class="ident">connected</span>,
- <span class="ident">mempool</span>,
- <span class="ident">network</span>,
- <span class="ident">version</span>,
- })
- }
-
- <span class="doccomment">/// Send a Bitcoin network message</span>
- <span class="kw">fn</span> <span class="ident">_send</span>(
- <span class="ident">writer</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">TcpStream</span>,
- <span class="ident">magic</span>: <span class="ident">u32</span>,
- <span class="ident">payload</span>: <span class="ident">NetworkMessage</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"==> {:?}"</span>, <span class="ident">payload</span>);
-
- <span class="kw">let</span> <span class="ident">raw_message</span> <span class="op">=</span> <span class="ident">RawNetworkMessage</span> { <span class="ident">magic</span>, <span class="ident">payload</span> };
-
- <span class="ident">raw_message</span>
- .<span class="ident">consensus_encode</span>(<span class="ident">writer</span>)
- .<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="doccomment">/// Wait for a specific incoming Bitcoin message, optionally with a timeout</span>
- <span class="kw">fn</span> <span class="ident">_recv</span>(
- <span class="ident">responses</span>: <span class="kw-2">&</span><span class="ident">Arc</span><span class="op"><</span><span class="ident">RwLock</span><span class="op"><</span><span class="ident">ResponsesMap</span><span class="op">></span><span class="op">></span>,
- <span class="ident">wait_for</span>: <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span>,
- <span class="ident">timeout</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Duration</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">NetworkMessage</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">message_resp</span> <span class="op">=</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">lock</span> <span class="op">=</span> <span class="ident">responses</span>.<span class="ident">write</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">message_resp</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">entry</span>(<span class="ident">wait_for</span>).<span class="ident">or_default</span>();
- <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">message_resp</span>)
- };
-
- <span class="kw">let</span> (<span class="ident">lock</span>, <span class="ident">cvar</span>) <span class="op">=</span> <span class="kw-2">&</span><span class="kw-2">*</span><span class="ident">message_resp</span>;
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">messages</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
- <span class="kw">while</span> <span class="ident">messages</span>.<span class="ident">is_empty</span>() {
- <span class="kw">match</span> <span class="ident">timeout</span> {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="ident">messages</span> <span class="op">=</span> <span class="ident">cvar</span>.<span class="ident">wait</span>(<span class="ident">messages</span>).<span class="ident">unwrap</span>(),
- <span class="prelude-val">Some</span>(<span class="ident">t</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">cvar</span>.<span class="ident">wait_timeout</span>(<span class="ident">messages</span>, <span class="ident">t</span>).<span class="ident">unwrap</span>();
- <span class="kw">if</span> <span class="ident">result</span>.<span class="number">1</span>.<span class="ident">timed_out</span>() {
- <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>);
- }
-
- <span class="ident">messages</span> <span class="op">=</span> <span class="ident">result</span>.<span class="number">0</span>;
- }
- }
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">messages</span>.<span class="ident">pop</span>())
- }
-
- <span class="doccomment">/// Return the [`VersionMessage`] sent by the peer</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_version</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="kw-2">&</span><span class="ident">VersionMessage</span> {
- <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">version</span>
- }
-
- <span class="doccomment">/// Return the Bitcoin [`Network`] in use</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_network</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Network</span> {
- <span class="self">self</span>.<span class="ident">network</span>
- }
-
- <span class="doccomment">/// Return the mempool used by this peer</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_mempool</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mempool</span><span class="op">></span> {
- <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">mempool</span>)
- }
-
- <span class="doccomment">/// Return whether or not the peer is still connected</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_connected</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="kw-2">*</span><span class="self">self</span>.<span class="ident">connected</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>()
- }
-
- <span class="doccomment">/// Internal function called once the `reader_thread` is spawned</span>
- <span class="kw">fn</span> <span class="ident">reader_thread</span>(
- <span class="ident">network</span>: <span class="ident">Network</span>,
- <span class="ident">connection</span>: <span class="ident">TcpStream</span>,
- <span class="ident">reader_thread_responses</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">RwLock</span><span class="op"><</span><span class="ident">ResponsesMap</span><span class="op">></span><span class="op">></span>,
- <span class="ident">reader_thread_writer</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mutex</span><span class="op"><</span><span class="ident">TcpStream</span><span class="op">></span><span class="op">></span>,
- <span class="ident">reader_thread_mempool</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mempool</span><span class="op">></span>,
- <span class="ident">reader_thread_connected</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">RwLock</span><span class="op"><</span><span class="ident">bool</span><span class="op">></span><span class="op">></span>,
- ) {
- <span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">check_disconnect</span> {
- (<span class="macro-nonterminal">$</span><span class="macro-nonterminal">call</span>:<span class="ident">expr</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">match</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">call</span> {
- <span class="prelude-val">Ok</span>(<span class="ident">good</span>) <span class="op">=</span><span class="op">></span> <span class="ident">good</span>,
- <span class="prelude-val">Err</span>(<span class="ident">e</span>) <span class="op">=</span><span class="op">></span> {
- <span class="ident">log</span>::<span class="macro">debug</span><span class="macro">!</span>(<span class="string">"Error {:?}"</span>, <span class="ident">e</span>);
- <span class="kw-2">*</span><span class="ident">reader_thread_connected</span>.<span class="ident">write</span>().<span class="ident">unwrap</span>() <span class="op">=</span> <span class="bool-val">false</span>;
-
- <span class="kw">break</span>;
- }
- }
- };
- }
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">reader</span> <span class="op">=</span> <span class="ident">StreamReader</span>::<span class="ident">new</span>(<span class="ident">connection</span>, <span class="prelude-val">None</span>);
- <span class="kw">loop</span> {
- <span class="kw">let</span> <span class="ident">raw_message</span>: <span class="ident">RawNetworkMessage</span> <span class="op">=</span> <span class="macro">check_disconnect</span><span class="macro">!</span>(<span class="ident">reader</span>.<span class="ident">read_next</span>());
-
- <span class="kw">let</span> <span class="ident">in_message</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">raw_message</span>.<span class="ident">magic</span> <span class="op">!</span><span class="op">=</span> <span class="ident">network</span>.<span class="ident">magic</span>() {
- <span class="kw">continue</span>;
- } <span class="kw">else</span> {
- <span class="ident">raw_message</span>.<span class="ident">payload</span>
- };
-
- <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"<== {:?}"</span>, <span class="ident">in_message</span>);
-
- <span class="kw">match</span> <span class="ident">in_message</span> {
- <span class="ident">NetworkMessage</span>::<span class="ident">Ping</span>(<span class="ident">nonce</span>) <span class="op">=</span><span class="op">></span> {
- <span class="macro">check_disconnect</span><span class="macro">!</span>(<span class="self">Self</span>::<span class="ident">_send</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">reader_thread_writer</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>(),
- <span class="ident">network</span>.<span class="ident">magic</span>(),
- <span class="ident">NetworkMessage</span>::<span class="ident">Pong</span>(<span class="ident">nonce</span>),
- ));
-
- <span class="kw">continue</span>;
- }
- <span class="ident">NetworkMessage</span>::<span class="ident">Alert</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="kw">continue</span>,
- <span class="ident">NetworkMessage</span>::<span class="ident">GetData</span>(<span class="kw-2">ref</span> <span class="ident">inv</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> (<span class="ident">found</span>, <span class="ident">not_found</span>): (<span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>) <span class="op">=</span> <span class="ident">inv</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">item</span><span class="op">|</span> (<span class="kw-2">*</span><span class="ident">item</span>, <span class="ident">reader_thread_mempool</span>.<span class="ident">get_tx</span>(<span class="ident">item</span>)))
- .<span class="ident">partition</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">d</span>)<span class="op">|</span> <span class="ident">d</span>.<span class="ident">is_some</span>());
- <span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">found_tx</span>) <span class="kw">in</span> <span class="ident">found</span> {
- <span class="macro">check_disconnect</span><span class="macro">!</span>(<span class="self">Self</span>::<span class="ident">_send</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">reader_thread_writer</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>(),
- <span class="ident">network</span>.<span class="ident">magic</span>(),
- <span class="ident">NetworkMessage</span>::<span class="ident">Tx</span>(<span class="ident">found_tx</span>.<span class="ident">unwrap</span>()),
- ));
- }
-
- <span class="kw">if</span> <span class="op">!</span><span class="ident">not_found</span>.<span class="ident">is_empty</span>() {
- <span class="macro">check_disconnect</span><span class="macro">!</span>(<span class="self">Self</span>::<span class="ident">_send</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">reader_thread_writer</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>(),
- <span class="ident">network</span>.<span class="ident">magic</span>(),
- <span class="ident">NetworkMessage</span>::<span class="ident">NotFound</span>(
- <span class="ident">not_found</span>.<span class="ident">into_iter</span>().<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">i</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">i</span>).<span class="ident">collect</span>(),
- ),
- ));
- }
- }
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> {}
- }
-
- <span class="kw">let</span> <span class="ident">message_resp</span> <span class="op">=</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">lock</span> <span class="op">=</span> <span class="ident">reader_thread_responses</span>.<span class="ident">write</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">message_resp</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">entry</span>(<span class="ident">in_message</span>.<span class="ident">cmd</span>()).<span class="ident">or_default</span>();
- <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">message_resp</span>)
- };
-
- <span class="kw">let</span> (<span class="ident">lock</span>, <span class="ident">cvar</span>) <span class="op">=</span> <span class="kw-2">&</span><span class="kw-2">*</span><span class="ident">message_resp</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">messages</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
- <span class="ident">messages</span>.<span class="ident">push</span>(<span class="ident">in_message</span>);
- <span class="ident">cvar</span>.<span class="ident">notify_all</span>();
- }
- }
-
- <span class="doccomment">/// Send a raw Bitcoin message to the peer</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">send</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">payload</span>: <span class="ident">NetworkMessage</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">writer</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">writer</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
- <span class="self">Self</span>::<span class="ident">_send</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">writer</span>, <span class="self">self</span>.<span class="ident">network</span>.<span class="ident">magic</span>(), <span class="ident">payload</span>)
- }
-
- <span class="doccomment">/// Waits for a specific incoming Bitcoin message, optionally with a timeout</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">recv</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">wait_for</span>: <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span>,
- <span class="ident">timeout</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Duration</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">NetworkMessage</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="self">Self</span>::<span class="ident">_recv</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">responses</span>, <span class="ident">wait_for</span>, <span class="ident">timeout</span>)
- }
-}
-
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">CompactFiltersPeer</span> {
- <span class="kw">fn</span> <span class="ident">get_cf_checkpt</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">filter_type</span>: <span class="ident">u8</span>,
- <span class="ident">stop_hash</span>: <span class="ident">BlockHash</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CFCheckpt</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>;
- <span class="kw">fn</span> <span class="ident">get_cf_headers</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">filter_type</span>: <span class="ident">u8</span>,
- <span class="ident">start_height</span>: <span class="ident">u32</span>,
- <span class="ident">stop_hash</span>: <span class="ident">BlockHash</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CFHeaders</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>;
- <span class="kw">fn</span> <span class="ident">get_cf_filters</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">filter_type</span>: <span class="ident">u8</span>,
- <span class="ident">start_height</span>: <span class="ident">u32</span>,
- <span class="ident">stop_hash</span>: <span class="ident">BlockHash</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span>;
- <span class="kw">fn</span> <span class="ident">pop_cf_filter_resp</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CFilter</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>;
-}
-
-<span class="kw">impl</span> <span class="ident">CompactFiltersPeer</span> <span class="kw">for</span> <span class="ident">Peer</span> {
- <span class="kw">fn</span> <span class="ident">get_cf_checkpt</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">filter_type</span>: <span class="ident">u8</span>,
- <span class="ident">stop_hash</span>: <span class="ident">BlockHash</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CFCheckpt</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="self">self</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">GetCFCheckpt</span>(<span class="ident">GetCFCheckpt</span> {
- <span class="ident">filter_type</span>,
- <span class="ident">stop_hash</span>,
- }))<span class="question-mark">?</span>;
-
- <span class="kw">let</span> <span class="ident">response</span> <span class="op">=</span> <span class="self">self</span>
- .<span class="ident">recv</span>(<span class="string">"cfcheckpt"</span>, <span class="prelude-val">Some</span>(<span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="ident">TIMEOUT_SECS</span>)))<span class="question-mark">?</span>
- .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">Timeout</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">response</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">response</span> {
- <span class="ident">NetworkMessage</span>::<span class="ident">CFCheckpt</span>(<span class="ident">response</span>) <span class="op">=</span><span class="op">></span> <span class="ident">response</span>,
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>),
- };
-
- <span class="kw">if</span> <span class="ident">response</span>.<span class="ident">filter_type</span> <span class="op">!</span><span class="op">=</span> <span class="ident">filter_type</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>);
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">response</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">get_cf_headers</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">filter_type</span>: <span class="ident">u8</span>,
- <span class="ident">start_height</span>: <span class="ident">u32</span>,
- <span class="ident">stop_hash</span>: <span class="ident">BlockHash</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CFHeaders</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="self">self</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">GetCFHeaders</span>(<span class="ident">GetCFHeaders</span> {
- <span class="ident">filter_type</span>,
- <span class="ident">start_height</span>,
- <span class="ident">stop_hash</span>,
- }))<span class="question-mark">?</span>;
-
- <span class="kw">let</span> <span class="ident">response</span> <span class="op">=</span> <span class="self">self</span>
- .<span class="ident">recv</span>(<span class="string">"cfheaders"</span>, <span class="prelude-val">Some</span>(<span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="ident">TIMEOUT_SECS</span>)))<span class="question-mark">?</span>
- .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">Timeout</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">response</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">response</span> {
- <span class="ident">NetworkMessage</span>::<span class="ident">CFHeaders</span>(<span class="ident">response</span>) <span class="op">=</span><span class="op">></span> <span class="ident">response</span>,
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>),
- };
-
- <span class="kw">if</span> <span class="ident">response</span>.<span class="ident">filter_type</span> <span class="op">!</span><span class="op">=</span> <span class="ident">filter_type</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>);
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">response</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">pop_cf_filter_resp</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CFilter</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">response</span> <span class="op">=</span> <span class="self">self</span>
- .<span class="ident">recv</span>(<span class="string">"cfilter"</span>, <span class="prelude-val">Some</span>(<span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="ident">TIMEOUT_SECS</span>)))<span class="question-mark">?</span>
- .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">Timeout</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">response</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">response</span> {
- <span class="ident">NetworkMessage</span>::<span class="ident">CFilter</span>(<span class="ident">response</span>) <span class="op">=</span><span class="op">></span> <span class="ident">response</span>,
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>),
- };
-
- <span class="prelude-val">Ok</span>(<span class="ident">response</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">get_cf_filters</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">filter_type</span>: <span class="ident">u8</span>,
- <span class="ident">start_height</span>: <span class="ident">u32</span>,
- <span class="ident">stop_hash</span>: <span class="ident">BlockHash</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="self">self</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">GetCFilters</span>(<span class="ident">GetCFilters</span> {
- <span class="ident">filter_type</span>,
- <span class="ident">start_height</span>,
- <span class="ident">stop_hash</span>,
- }))<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-}
-
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">InvPeer</span> {
- <span class="kw">fn</span> <span class="ident">get_block</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">block_hash</span>: <span class="ident">BlockHash</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Block</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span>;
- <span class="kw">fn</span> <span class="ident">ask_for_mempool</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span>;
- <span class="kw">fn</span> <span class="ident">broadcast_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span>;
-}
-
-<span class="kw">impl</span> <span class="ident">InvPeer</span> <span class="kw">for</span> <span class="ident">Peer</span> {
- <span class="kw">fn</span> <span class="ident">get_block</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">block_hash</span>: <span class="ident">BlockHash</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Block</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="self">self</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">GetData</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">Inventory</span>::<span class="ident">WitnessBlock</span>(
- <span class="ident">block_hash</span>,
- )]))<span class="question-mark">?</span>;
-
- <span class="kw">match</span> <span class="self">self</span>.<span class="ident">recv</span>(<span class="string">"block"</span>, <span class="prelude-val">Some</span>(<span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="ident">TIMEOUT_SECS</span>)))<span class="question-mark">?</span> {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
- <span class="prelude-val">Some</span>(<span class="ident">NetworkMessage</span>::<span class="ident">Block</span>(<span class="ident">response</span>)) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">response</span>)),
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>),
- }
- }
-
- <span class="kw">fn</span> <span class="ident">ask_for_mempool</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="self">self</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">MemPool</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">inv</span> <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span>.<span class="ident">recv</span>(<span class="string">"inv"</span>, <span class="prelude-val">Some</span>(<span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="number">5</span>)))<span class="question-mark">?</span> {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Ok</span>(()), <span class="comment">// empty mempool</span>
- <span class="prelude-val">Some</span>(<span class="ident">NetworkMessage</span>::<span class="ident">Inv</span>(<span class="ident">inv</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">inv</span>,
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>),
- };
-
- <span class="kw">let</span> <span class="ident">getdata</span> <span class="op">=</span> <span class="ident">inv</span>
- .<span class="ident">iter</span>()
- .<span class="ident">cloned</span>()
- .<span class="ident">filter</span>(<span class="op">|</span><span class="ident">item</span><span class="op">|</span> <span class="kw">match</span> <span class="ident">item</span> {
- <span class="ident">Inventory</span>::<span class="ident">Transaction</span>(<span class="ident">txid</span>) <span class="kw">if</span> <span class="op">!</span><span class="self">self</span>.<span class="ident">mempool</span>.<span class="ident">has_tx</span>(<span class="ident">txid</span>) <span class="op">=</span><span class="op">></span> <span class="bool-val">true</span>,
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="bool-val">false</span>,
- })
- .<span class="ident">collect</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span><span class="op">></span>();
- <span class="kw">let</span> <span class="ident">num_txs</span> <span class="op">=</span> <span class="ident">getdata</span>.<span class="ident">len</span>();
- <span class="self">self</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">GetData</span>(<span class="ident">getdata</span>))<span class="question-mark">?</span>;
-
- <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">num_txs</span> {
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="self">self</span>
- .<span class="ident">recv</span>(<span class="string">"tx"</span>, <span class="prelude-val">Some</span>(<span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="ident">TIMEOUT_SECS</span>)))<span class="question-mark">?</span>
- .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">Timeout</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">tx</span> {
- <span class="ident">NetworkMessage</span>::<span class="ident">Tx</span>(<span class="ident">tx</span>) <span class="op">=</span><span class="op">></span> <span class="ident">tx</span>,
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>),
- };
-
- <span class="self">self</span>.<span class="ident">mempool</span>.<span class="ident">add_tx</span>(<span class="ident">tx</span>);
- }
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">fn</span> <span class="ident">broadcast_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="self">self</span>.<span class="ident">mempool</span>.<span class="ident">add_tx</span>(<span class="ident">tx</span>.<span class="ident">clone</span>());
- <span class="self">self</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">Tx</span>(<span class="ident">tx</span>))<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "magical";</script><script src="../../../../main.js"></script><script src="../../../../source-script.js"></script><script src="../../../../source-files.js"></script><script defer src="../../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/blockchain/compact_filters/store.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>store.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../../magical/index.html'><div class='logo-container'><img src='../../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-<span id="203">203</span>
-<span id="204">204</span>
-<span id="205">205</span>
-<span id="206">206</span>
-<span id="207">207</span>
-<span id="208">208</span>
-<span id="209">209</span>
-<span id="210">210</span>
-<span id="211">211</span>
-<span id="212">212</span>
-<span id="213">213</span>
-<span id="214">214</span>
-<span id="215">215</span>
-<span id="216">216</span>
-<span id="217">217</span>
-<span id="218">218</span>
-<span id="219">219</span>
-<span id="220">220</span>
-<span id="221">221</span>
-<span id="222">222</span>
-<span id="223">223</span>
-<span id="224">224</span>
-<span id="225">225</span>
-<span id="226">226</span>
-<span id="227">227</span>
-<span id="228">228</span>
-<span id="229">229</span>
-<span id="230">230</span>
-<span id="231">231</span>
-<span id="232">232</span>
-<span id="233">233</span>
-<span id="234">234</span>
-<span id="235">235</span>
-<span id="236">236</span>
-<span id="237">237</span>
-<span id="238">238</span>
-<span id="239">239</span>
-<span id="240">240</span>
-<span id="241">241</span>
-<span id="242">242</span>
-<span id="243">243</span>
-<span id="244">244</span>
-<span id="245">245</span>
-<span id="246">246</span>
-<span id="247">247</span>
-<span id="248">248</span>
-<span id="249">249</span>
-<span id="250">250</span>
-<span id="251">251</span>
-<span id="252">252</span>
-<span id="253">253</span>
-<span id="254">254</span>
-<span id="255">255</span>
-<span id="256">256</span>
-<span id="257">257</span>
-<span id="258">258</span>
-<span id="259">259</span>
-<span id="260">260</span>
-<span id="261">261</span>
-<span id="262">262</span>
-<span id="263">263</span>
-<span id="264">264</span>
-<span id="265">265</span>
-<span id="266">266</span>
-<span id="267">267</span>
-<span id="268">268</span>
-<span id="269">269</span>
-<span id="270">270</span>
-<span id="271">271</span>
-<span id="272">272</span>
-<span id="273">273</span>
-<span id="274">274</span>
-<span id="275">275</span>
-<span id="276">276</span>
-<span id="277">277</span>
-<span id="278">278</span>
-<span id="279">279</span>
-<span id="280">280</span>
-<span id="281">281</span>
-<span id="282">282</span>
-<span id="283">283</span>
-<span id="284">284</span>
-<span id="285">285</span>
-<span id="286">286</span>
-<span id="287">287</span>
-<span id="288">288</span>
-<span id="289">289</span>
-<span id="290">290</span>
-<span id="291">291</span>
-<span id="292">292</span>
-<span id="293">293</span>
-<span id="294">294</span>
-<span id="295">295</span>
-<span id="296">296</span>
-<span id="297">297</span>
-<span id="298">298</span>
-<span id="299">299</span>
-<span id="300">300</span>
-<span id="301">301</span>
-<span id="302">302</span>
-<span id="303">303</span>
-<span id="304">304</span>
-<span id="305">305</span>
-<span id="306">306</span>
-<span id="307">307</span>
-<span id="308">308</span>
-<span id="309">309</span>
-<span id="310">310</span>
-<span id="311">311</span>
-<span id="312">312</span>
-<span id="313">313</span>
-<span id="314">314</span>
-<span id="315">315</span>
-<span id="316">316</span>
-<span id="317">317</span>
-<span id="318">318</span>
-<span id="319">319</span>
-<span id="320">320</span>
-<span id="321">321</span>
-<span id="322">322</span>
-<span id="323">323</span>
-<span id="324">324</span>
-<span id="325">325</span>
-<span id="326">326</span>
-<span id="327">327</span>
-<span id="328">328</span>
-<span id="329">329</span>
-<span id="330">330</span>
-<span id="331">331</span>
-<span id="332">332</span>
-<span id="333">333</span>
-<span id="334">334</span>
-<span id="335">335</span>
-<span id="336">336</span>
-<span id="337">337</span>
-<span id="338">338</span>
-<span id="339">339</span>
-<span id="340">340</span>
-<span id="341">341</span>
-<span id="342">342</span>
-<span id="343">343</span>
-<span id="344">344</span>
-<span id="345">345</span>
-<span id="346">346</span>
-<span id="347">347</span>
-<span id="348">348</span>
-<span id="349">349</span>
-<span id="350">350</span>
-<span id="351">351</span>
-<span id="352">352</span>
-<span id="353">353</span>
-<span id="354">354</span>
-<span id="355">355</span>
-<span id="356">356</span>
-<span id="357">357</span>
-<span id="358">358</span>
-<span id="359">359</span>
-<span id="360">360</span>
-<span id="361">361</span>
-<span id="362">362</span>
-<span id="363">363</span>
-<span id="364">364</span>
-<span id="365">365</span>
-<span id="366">366</span>
-<span id="367">367</span>
-<span id="368">368</span>
-<span id="369">369</span>
-<span id="370">370</span>
-<span id="371">371</span>
-<span id="372">372</span>
-<span id="373">373</span>
-<span id="374">374</span>
-<span id="375">375</span>
-<span id="376">376</span>
-<span id="377">377</span>
-<span id="378">378</span>
-<span id="379">379</span>
-<span id="380">380</span>
-<span id="381">381</span>
-<span id="382">382</span>
-<span id="383">383</span>
-<span id="384">384</span>
-<span id="385">385</span>
-<span id="386">386</span>
-<span id="387">387</span>
-<span id="388">388</span>
-<span id="389">389</span>
-<span id="390">390</span>
-<span id="391">391</span>
-<span id="392">392</span>
-<span id="393">393</span>
-<span id="394">394</span>
-<span id="395">395</span>
-<span id="396">396</span>
-<span id="397">397</span>
-<span id="398">398</span>
-<span id="399">399</span>
-<span id="400">400</span>
-<span id="401">401</span>
-<span id="402">402</span>
-<span id="403">403</span>
-<span id="404">404</span>
-<span id="405">405</span>
-<span id="406">406</span>
-<span id="407">407</span>
-<span id="408">408</span>
-<span id="409">409</span>
-<span id="410">410</span>
-<span id="411">411</span>
-<span id="412">412</span>
-<span id="413">413</span>
-<span id="414">414</span>
-<span id="415">415</span>
-<span id="416">416</span>
-<span id="417">417</span>
-<span id="418">418</span>
-<span id="419">419</span>
-<span id="420">420</span>
-<span id="421">421</span>
-<span id="422">422</span>
-<span id="423">423</span>
-<span id="424">424</span>
-<span id="425">425</span>
-<span id="426">426</span>
-<span id="427">427</span>
-<span id="428">428</span>
-<span id="429">429</span>
-<span id="430">430</span>
-<span id="431">431</span>
-<span id="432">432</span>
-<span id="433">433</span>
-<span id="434">434</span>
-<span id="435">435</span>
-<span id="436">436</span>
-<span id="437">437</span>
-<span id="438">438</span>
-<span id="439">439</span>
-<span id="440">440</span>
-<span id="441">441</span>
-<span id="442">442</span>
-<span id="443">443</span>
-<span id="444">444</span>
-<span id="445">445</span>
-<span id="446">446</span>
-<span id="447">447</span>
-<span id="448">448</span>
-<span id="449">449</span>
-<span id="450">450</span>
-<span id="451">451</span>
-<span id="452">452</span>
-<span id="453">453</span>
-<span id="454">454</span>
-<span id="455">455</span>
-<span id="456">456</span>
-<span id="457">457</span>
-<span id="458">458</span>
-<span id="459">459</span>
-<span id="460">460</span>
-<span id="461">461</span>
-<span id="462">462</span>
-<span id="463">463</span>
-<span id="464">464</span>
-<span id="465">465</span>
-<span id="466">466</span>
-<span id="467">467</span>
-<span id="468">468</span>
-<span id="469">469</span>
-<span id="470">470</span>
-<span id="471">471</span>
-<span id="472">472</span>
-<span id="473">473</span>
-<span id="474">474</span>
-<span id="475">475</span>
-<span id="476">476</span>
-<span id="477">477</span>
-<span id="478">478</span>
-<span id="479">479</span>
-<span id="480">480</span>
-<span id="481">481</span>
-<span id="482">482</span>
-<span id="483">483</span>
-<span id="484">484</span>
-<span id="485">485</span>
-<span id="486">486</span>
-<span id="487">487</span>
-<span id="488">488</span>
-<span id="489">489</span>
-<span id="490">490</span>
-<span id="491">491</span>
-<span id="492">492</span>
-<span id="493">493</span>
-<span id="494">494</span>
-<span id="495">495</span>
-<span id="496">496</span>
-<span id="497">497</span>
-<span id="498">498</span>
-<span id="499">499</span>
-<span id="500">500</span>
-<span id="501">501</span>
-<span id="502">502</span>
-<span id="503">503</span>
-<span id="504">504</span>
-<span id="505">505</span>
-<span id="506">506</span>
-<span id="507">507</span>
-<span id="508">508</span>
-<span id="509">509</span>
-<span id="510">510</span>
-<span id="511">511</span>
-<span id="512">512</span>
-<span id="513">513</span>
-<span id="514">514</span>
-<span id="515">515</span>
-<span id="516">516</span>
-<span id="517">517</span>
-<span id="518">518</span>
-<span id="519">519</span>
-<span id="520">520</span>
-<span id="521">521</span>
-<span id="522">522</span>
-<span id="523">523</span>
-<span id="524">524</span>
-<span id="525">525</span>
-<span id="526">526</span>
-<span id="527">527</span>
-<span id="528">528</span>
-<span id="529">529</span>
-<span id="530">530</span>
-<span id="531">531</span>
-<span id="532">532</span>
-<span id="533">533</span>
-<span id="534">534</span>
-<span id="535">535</span>
-<span id="536">536</span>
-<span id="537">537</span>
-<span id="538">538</span>
-<span id="539">539</span>
-<span id="540">540</span>
-<span id="541">541</span>
-<span id="542">542</span>
-<span id="543">543</span>
-<span id="544">544</span>
-<span id="545">545</span>
-<span id="546">546</span>
-<span id="547">547</span>
-<span id="548">548</span>
-<span id="549">549</span>
-<span id="550">550</span>
-<span id="551">551</span>
-<span id="552">552</span>
-<span id="553">553</span>
-<span id="554">554</span>
-<span id="555">555</span>
-<span id="556">556</span>
-<span id="557">557</span>
-<span id="558">558</span>
-<span id="559">559</span>
-<span id="560">560</span>
-<span id="561">561</span>
-<span id="562">562</span>
-<span id="563">563</span>
-<span id="564">564</span>
-<span id="565">565</span>
-<span id="566">566</span>
-<span id="567">567</span>
-<span id="568">568</span>
-<span id="569">569</span>
-<span id="570">570</span>
-<span id="571">571</span>
-<span id="572">572</span>
-<span id="573">573</span>
-<span id="574">574</span>
-<span id="575">575</span>
-<span id="576">576</span>
-<span id="577">577</span>
-<span id="578">578</span>
-<span id="579">579</span>
-<span id="580">580</span>
-<span id="581">581</span>
-<span id="582">582</span>
-<span id="583">583</span>
-<span id="584">584</span>
-<span id="585">585</span>
-<span id="586">586</span>
-<span id="587">587</span>
-<span id="588">588</span>
-<span id="589">589</span>
-<span id="590">590</span>
-<span id="591">591</span>
-<span id="592">592</span>
-<span id="593">593</span>
-<span id="594">594</span>
-<span id="595">595</span>
-<span id="596">596</span>
-<span id="597">597</span>
-<span id="598">598</span>
-<span id="599">599</span>
-<span id="600">600</span>
-<span id="601">601</span>
-<span id="602">602</span>
-<span id="603">603</span>
-<span id="604">604</span>
-<span id="605">605</span>
-<span id="606">606</span>
-<span id="607">607</span>
-<span id="608">608</span>
-<span id="609">609</span>
-<span id="610">610</span>
-<span id="611">611</span>
-<span id="612">612</span>
-<span id="613">613</span>
-<span id="614">614</span>
-<span id="615">615</span>
-<span id="616">616</span>
-<span id="617">617</span>
-<span id="618">618</span>
-<span id="619">619</span>
-<span id="620">620</span>
-<span id="621">621</span>
-<span id="622">622</span>
-<span id="623">623</span>
-<span id="624">624</span>
-<span id="625">625</span>
-<span id="626">626</span>
-<span id="627">627</span>
-<span id="628">628</span>
-<span id="629">629</span>
-<span id="630">630</span>
-<span id="631">631</span>
-<span id="632">632</span>
-<span id="633">633</span>
-<span id="634">634</span>
-<span id="635">635</span>
-<span id="636">636</span>
-<span id="637">637</span>
-<span id="638">638</span>
-<span id="639">639</span>
-<span id="640">640</span>
-<span id="641">641</span>
-<span id="642">642</span>
-<span id="643">643</span>
-<span id="644">644</span>
-<span id="645">645</span>
-<span id="646">646</span>
-<span id="647">647</span>
-<span id="648">648</span>
-<span id="649">649</span>
-<span id="650">650</span>
-<span id="651">651</span>
-<span id="652">652</span>
-<span id="653">653</span>
-<span id="654">654</span>
-<span id="655">655</span>
-<span id="656">656</span>
-<span id="657">657</span>
-<span id="658">658</span>
-<span id="659">659</span>
-<span id="660">660</span>
-<span id="661">661</span>
-<span id="662">662</span>
-<span id="663">663</span>
-<span id="664">664</span>
-<span id="665">665</span>
-<span id="666">666</span>
-<span id="667">667</span>
-<span id="668">668</span>
-<span id="669">669</span>
-<span id="670">670</span>
-<span id="671">671</span>
-<span id="672">672</span>
-<span id="673">673</span>
-<span id="674">674</span>
-<span id="675">675</span>
-<span id="676">676</span>
-<span id="677">677</span>
-<span id="678">678</span>
-<span id="679">679</span>
-<span id="680">680</span>
-<span id="681">681</span>
-<span id="682">682</span>
-<span id="683">683</span>
-<span id="684">684</span>
-<span id="685">685</span>
-<span id="686">686</span>
-<span id="687">687</span>
-<span id="688">688</span>
-<span id="689">689</span>
-<span id="690">690</span>
-<span id="691">691</span>
-<span id="692">692</span>
-<span id="693">693</span>
-<span id="694">694</span>
-<span id="695">695</span>
-<span id="696">696</span>
-<span id="697">697</span>
-<span id="698">698</span>
-<span id="699">699</span>
-<span id="700">700</span>
-<span id="701">701</span>
-<span id="702">702</span>
-<span id="703">703</span>
-<span id="704">704</span>
-<span id="705">705</span>
-<span id="706">706</span>
-<span id="707">707</span>
-<span id="708">708</span>
-<span id="709">709</span>
-<span id="710">710</span>
-<span id="711">711</span>
-<span id="712">712</span>
-<span id="713">713</span>
-<span id="714">714</span>
-<span id="715">715</span>
-<span id="716">716</span>
-<span id="717">717</span>
-<span id="718">718</span>
-<span id="719">719</span>
-<span id="720">720</span>
-<span id="721">721</span>
-<span id="722">722</span>
-<span id="723">723</span>
-<span id="724">724</span>
-<span id="725">725</span>
-<span id="726">726</span>
-<span id="727">727</span>
-<span id="728">728</span>
-<span id="729">729</span>
-<span id="730">730</span>
-<span id="731">731</span>
-<span id="732">732</span>
-<span id="733">733</span>
-<span id="734">734</span>
-<span id="735">735</span>
-<span id="736">736</span>
-<span id="737">737</span>
-<span id="738">738</span>
-<span id="739">739</span>
-<span id="740">740</span>
-<span id="741">741</span>
-<span id="742">742</span>
-<span id="743">743</span>
-<span id="744">744</span>
-<span id="745">745</span>
-<span id="746">746</span>
-<span id="747">747</span>
-<span id="748">748</span>
-<span id="749">749</span>
-<span id="750">750</span>
-<span id="751">751</span>
-<span id="752">752</span>
-<span id="753">753</span>
-<span id="754">754</span>
-<span id="755">755</span>
-<span id="756">756</span>
-<span id="757">757</span>
-<span id="758">758</span>
-<span id="759">759</span>
-<span id="760">760</span>
-<span id="761">761</span>
-<span id="762">762</span>
-<span id="763">763</span>
-<span id="764">764</span>
-<span id="765">765</span>
-<span id="766">766</span>
-<span id="767">767</span>
-<span id="768">768</span>
-<span id="769">769</span>
-<span id="770">770</span>
-<span id="771">771</span>
-<span id="772">772</span>
-<span id="773">773</span>
-<span id="774">774</span>
-<span id="775">775</span>
-<span id="776">776</span>
-<span id="777">777</span>
-<span id="778">778</span>
-<span id="779">779</span>
-<span id="780">780</span>
-<span id="781">781</span>
-<span id="782">782</span>
-<span id="783">783</span>
-<span id="784">784</span>
-<span id="785">785</span>
-<span id="786">786</span>
-<span id="787">787</span>
-<span id="788">788</span>
-<span id="789">789</span>
-<span id="790">790</span>
-<span id="791">791</span>
-<span id="792">792</span>
-<span id="793">793</span>
-<span id="794">794</span>
-<span id="795">795</span>
-<span id="796">796</span>
-<span id="797">797</span>
-<span id="798">798</span>
-<span id="799">799</span>
-<span id="800">800</span>
-<span id="801">801</span>
-<span id="802">802</span>
-<span id="803">803</span>
-<span id="804">804</span>
-<span id="805">805</span>
-<span id="806">806</span>
-<span id="807">807</span>
-<span id="808">808</span>
-<span id="809">809</span>
-<span id="810">810</span>
-<span id="811">811</span>
-<span id="812">812</span>
-<span id="813">813</span>
-<span id="814">814</span>
-<span id="815">815</span>
-<span id="816">816</span>
-<span id="817">817</span>
-<span id="818">818</span>
-<span id="819">819</span>
-<span id="820">820</span>
-<span id="821">821</span>
-<span id="822">822</span>
-<span id="823">823</span>
-<span id="824">824</span>
-<span id="825">825</span>
-<span id="826">826</span>
-<span id="827">827</span>
-<span id="828">828</span>
-<span id="829">829</span>
-<span id="830">830</span>
-<span id="831">831</span>
-<span id="832">832</span>
-<span id="833">833</span>
-<span id="834">834</span>
-<span id="835">835</span>
-<span id="836">836</span>
-<span id="837">837</span>
-<span id="838">838</span>
-<span id="839">839</span>
-<span id="840">840</span>
-<span id="841">841</span>
-<span id="842">842</span>
-<span id="843">843</span>
-<span id="844">844</span>
-<span id="845">845</span>
-<span id="846">846</span>
-<span id="847">847</span>
-<span id="848">848</span>
-<span id="849">849</span>
-<span id="850">850</span>
-<span id="851">851</span>
-<span id="852">852</span>
-<span id="853">853</span>
-<span id="854">854</span>
-<span id="855">855</span>
-<span id="856">856</span>
-<span id="857">857</span>
-<span id="858">858</span>
-<span id="859">859</span>
-<span id="860">860</span>
-<span id="861">861</span>
-<span id="862">862</span>
-<span id="863">863</span>
-<span id="864">864</span>
-<span id="865">865</span>
-<span id="866">866</span>
-<span id="867">867</span>
-<span id="868">868</span>
-<span id="869">869</span>
-<span id="870">870</span>
-<span id="871">871</span>
-<span id="872">872</span>
-<span id="873">873</span>
-<span id="874">874</span>
-<span id="875">875</span>
-<span id="876">876</span>
-<span id="877">877</span>
-<span id="878">878</span>
-<span id="879">879</span>
-<span id="880">880</span>
-<span id="881">881</span>
-<span id="882">882</span>
-<span id="883">883</span>
-<span id="884">884</span>
-<span id="885">885</span>
-<span id="886">886</span>
-<span id="887">887</span>
-<span id="888">888</span>
-<span id="889">889</span>
-<span id="890">890</span>
-<span id="891">891</span>
-<span id="892">892</span>
-<span id="893">893</span>
-<span id="894">894</span>
-<span id="895">895</span>
-<span id="896">896</span>
-<span id="897">897</span>
-<span id="898">898</span>
-<span id="899">899</span>
-<span id="900">900</span>
-<span id="901">901</span>
-<span id="902">902</span>
-<span id="903">903</span>
-<span id="904">904</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">convert</span>::<span class="ident">TryInto</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::{<span class="ident">Read</span>, <span class="ident">Write</span>};
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">marker</span>::<span class="ident">PhantomData</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ops</span>::<span class="ident">Deref</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">RwLock</span>;
-
-<span class="kw">use</span> <span class="ident">rand</span>::<span class="ident">distributions</span>::<span class="ident">Alphanumeric</span>;
-<span class="kw">use</span> <span class="ident">rand</span>::{<span class="ident">thread_rng</span>, <span class="ident">Rng</span>};
-
-<span class="kw">use</span> <span class="ident">rocksdb</span>::{<span class="ident">Direction</span>, <span class="ident">IteratorMode</span>, <span class="ident">ReadOptions</span>, <span class="ident">WriteBatch</span>, <span class="ident">DB</span>};
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::{<span class="ident">deserialize</span>, <span class="ident">encode</span>::<span class="ident">VarInt</span>, <span class="ident">serialize</span>, <span class="ident">Decodable</span>, <span class="ident">Encodable</span>};
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hash_types</span>::<span class="ident">FilterHash</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">FromHex</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::{<span class="ident">sha256d</span>, <span class="ident">Hash</span>};
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip158</span>::<span class="ident">BlockFilter</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">uint</span>::<span class="ident">Uint256</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">Block</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">BlockHash</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">BlockHeader</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">Network</span>;
-
-<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">CompactFiltersError</span>;
-
-<span class="macro">lazy_static</span><span class="macro">!</span> {
- <span class="kw">static</span> <span class="kw-2">ref</span> <span class="ident">MAINNET_GENESIS</span>: <span class="ident">Block</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"0100000000000000000000000000000000000000000000000000000000000000000000003BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A29AB5F49FFFF001D1DAC2B7C0101000000010000000000000000000000000000000000000000000000000000000000000000FFFFFFFF4D04FFFF001D0104455468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73FFFFFFFF0100F2052A01000000434104678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5FAC00000000"</span>).<span class="ident">unwrap</span>()).<span class="ident">unwrap</span>();
- <span class="kw">static</span> <span class="kw-2">ref</span> <span class="ident">TESTNET_GENESIS</span>: <span class="ident">Block</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"0100000000000000000000000000000000000000000000000000000000000000000000003BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4ADAE5494DFFFF001D1AA4AE180101000000010000000000000000000000000000000000000000000000000000000000000000FFFFFFFF4D04FFFF001D0104455468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73FFFFFFFF0100F2052A01000000434104678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5FAC00000000"</span>).<span class="ident">unwrap</span>()).<span class="ident">unwrap</span>();
- <span class="kw">static</span> <span class="kw-2">ref</span> <span class="ident">REGTEST_GENESIS</span>: <span class="ident">Block</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"0100000000000000000000000000000000000000000000000000000000000000000000003BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4ADAE5494DFFFF7F20020000000101000000010000000000000000000000000000000000000000000000000000000000000000FFFFFFFF4D04FFFF001D0104455468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73FFFFFFFF0100F2052A01000000434104678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5FAC00000000"</span>).<span class="ident">unwrap</span>()).<span class="ident">unwrap</span>();
-}
-
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">StoreType</span>: <span class="ident">Default</span> <span class="op">+</span> <span class="ident">fmt</span>::<span class="ident">Debug</span> {}
-
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Default</span>, <span class="ident">Debug</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Full</span>;
-<span class="kw">impl</span> <span class="ident">StoreType</span> <span class="kw">for</span> <span class="ident">Full</span> {}
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Default</span>, <span class="ident">Debug</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Snapshot</span>;
-<span class="kw">impl</span> <span class="ident">StoreType</span> <span class="kw">for</span> <span class="ident">Snapshot</span> {}
-
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">StoreEntry</span> {
- <span class="ident">BlockHeader</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>),
- <span class="ident">Block</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>),
- <span class="ident">BlockHeaderIndex</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">BlockHash</span><span class="op">></span>),
- <span class="ident">CFilterTable</span>((<span class="ident">u8</span>, <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>)),
-}
-
-<span class="kw">impl</span> <span class="ident">StoreEntry</span> {
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_prefix</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span> {
- <span class="kw">match</span> <span class="self">self</span> {
- <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="string">b"z"</span>,
- <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="string">b"x"</span>,
- <span class="ident">StoreEntry</span>::<span class="ident">BlockHeaderIndex</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="string">b"i"</span>,
- <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="string">b"t"</span>,
- }
- .<span class="ident">to_vec</span>()
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_key</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">prefix</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_prefix</span>();
- <span class="kw">match</span> <span class="self">self</span> {
- <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">height</span>)) <span class="op">=</span><span class="op">></span> {
- <span class="ident">prefix</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">height</span>.<span class="ident">to_be_bytes</span>())
- }
- <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="prelude-val">Some</span>(<span class="ident">height</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">prefix</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">height</span>.<span class="ident">to_be_bytes</span>()),
- <span class="ident">StoreEntry</span>::<span class="ident">BlockHeaderIndex</span>(<span class="prelude-val">Some</span>(<span class="ident">hash</span>)) <span class="op">=</span><span class="op">></span> {
- <span class="ident">prefix</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">hash</span>.<span class="ident">into_inner</span>())
- }
- <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="ident">filter_type</span>, <span class="ident">bundle_index</span>)) <span class="op">=</span><span class="op">></span> {
- <span class="ident">prefix</span>.<span class="ident">push</span>(<span class="kw-2">*</span><span class="ident">filter_type</span>);
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">bundle_index</span>) <span class="op">=</span> <span class="ident">bundle_index</span> {
- <span class="ident">prefix</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">bundle_index</span>.<span class="ident">to_be_bytes</span>());
- }
- }
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> {}
- }
-
- <span class="ident">prefix</span>
- }
-}
-
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">SerializeDb</span>: <span class="ident">Sized</span> {
- <span class="kw">fn</span> <span class="ident">serialize</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>;
- <span class="kw">fn</span> <span class="ident">deserialize</span>(<span class="ident">data</span>: <span class="kw-2">&</span>[<span class="ident">u8</span>]) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>;
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">T</span><span class="op">></span> <span class="ident">SerializeDb</span> <span class="kw">for</span> <span class="ident">T</span>
-<span class="kw">where</span>
- <span class="ident">T</span>: <span class="ident">Encodable</span> <span class="op">+</span> <span class="ident">Decodable</span>,
-{
- <span class="kw">fn</span> <span class="ident">serialize</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span> {
- <span class="ident">serialize</span>(<span class="self">self</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">deserialize</span>(<span class="ident">data</span>: <span class="kw-2">&</span>[<span class="ident">u8</span>]) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="ident">deserialize</span>(<span class="ident">data</span>).<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">Encodable</span> <span class="kw">for</span> <span class="ident">FilterHeader</span> {
- <span class="kw">fn</span> <span class="ident">consensus_encode</span><span class="op"><</span><span class="ident">W</span>: <span class="ident">Write</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="kw-2">mut</span> <span class="ident">e</span>: <span class="ident">W</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">usize</span>, <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">written</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">prev_header_hash</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
- <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="self">self</span>.<span class="ident">filter_hash</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
- <span class="prelude-val">Ok</span>(<span class="ident">written</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">Decodable</span> <span class="kw">for</span> <span class="ident">FilterHeader</span> {
- <span class="kw">fn</span> <span class="ident">consensus_decode</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Read</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">d</span>: <span class="ident">D</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">prev_header_hash</span> <span class="op">=</span> <span class="ident">FilterHeaderHash</span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">filter_hash</span> <span class="op">=</span> <span class="ident">FilterHash</span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">FilterHeader</span> {
- <span class="ident">prev_header_hash</span>,
- <span class="ident">filter_hash</span>,
- })
- }
-}
-
-<span class="kw">impl</span> <span class="ident">Encodable</span> <span class="kw">for</span> <span class="ident">BundleStatus</span> {
- <span class="kw">fn</span> <span class="ident">consensus_encode</span><span class="op"><</span><span class="ident">W</span>: <span class="ident">Write</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="kw-2">mut</span> <span class="ident">e</span>: <span class="ident">W</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">usize</span>, <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">written</span> <span class="op">=</span> <span class="number">0</span>;
-
- <span class="kw">match</span> <span class="self">self</span> {
- <span class="ident">BundleStatus</span>::<span class="ident">Init</span> <span class="op">=</span><span class="op">></span> {
- <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="number">0x00u8</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
- }
- <span class="ident">BundleStatus</span>::<span class="ident">CFHeaders</span> { <span class="ident">cf_headers</span> } <span class="op">=</span><span class="op">></span> {
- <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="number">0x01u8</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
- <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="ident">VarInt</span>(<span class="ident">cf_headers</span>.<span class="ident">len</span>() <span class="kw">as</span> <span class="ident">u64</span>).<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
- <span class="kw">for</span> <span class="ident">header</span> <span class="kw">in</span> <span class="ident">cf_headers</span> {
- <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="ident">header</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
- }
- }
- <span class="ident">BundleStatus</span>::<span class="ident">CFilters</span> { <span class="ident">cf_filters</span> } <span class="op">=</span><span class="op">></span> {
- <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="number">0x02u8</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
- <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="ident">VarInt</span>(<span class="ident">cf_filters</span>.<span class="ident">len</span>() <span class="kw">as</span> <span class="ident">u64</span>).<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
- <span class="kw">for</span> <span class="ident">filter</span> <span class="kw">in</span> <span class="ident">cf_filters</span> {
- <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="ident">filter</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
- }
- }
- <span class="ident">BundleStatus</span>::<span class="ident">Processed</span> { <span class="ident">cf_filters</span> } <span class="op">=</span><span class="op">></span> {
- <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="number">0x03u8</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
- <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="ident">VarInt</span>(<span class="ident">cf_filters</span>.<span class="ident">len</span>() <span class="kw">as</span> <span class="ident">u64</span>).<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
- <span class="kw">for</span> <span class="ident">filter</span> <span class="kw">in</span> <span class="ident">cf_filters</span> {
- <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="ident">filter</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
- }
- }
- <span class="ident">BundleStatus</span>::<span class="ident">Pruned</span> <span class="op">=</span><span class="op">></span> {
- <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="number">0x04u8</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
- }
- <span class="ident">BundleStatus</span>::<span class="ident">Tip</span> { <span class="ident">cf_filters</span> } <span class="op">=</span><span class="op">></span> {
- <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="number">0x05u8</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
- <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="ident">VarInt</span>(<span class="ident">cf_filters</span>.<span class="ident">len</span>() <span class="kw">as</span> <span class="ident">u64</span>).<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
- <span class="kw">for</span> <span class="ident">filter</span> <span class="kw">in</span> <span class="ident">cf_filters</span> {
- <span class="ident">written</span> <span class="op">+</span><span class="op">=</span> <span class="ident">filter</span>.<span class="ident">consensus_encode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">e</span>)<span class="question-mark">?</span>;
- }
- }
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">written</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">Decodable</span> <span class="kw">for</span> <span class="ident">BundleStatus</span> {
- <span class="kw">fn</span> <span class="ident">consensus_decode</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Read</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">d</span>: <span class="ident">D</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">byte_type</span> <span class="op">=</span> <span class="ident">u8</span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>;
- <span class="kw">match</span> <span class="ident">byte_type</span> {
- <span class="number">0x00</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">BundleStatus</span>::<span class="ident">Init</span>),
- <span class="number">0x01</span> <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">VarInt</span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">num</span>.<span class="number">0</span> <span class="kw">as</span> <span class="ident">usize</span>;
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cf_headers</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">num</span>);
- <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">num</span> {
- <span class="ident">cf_headers</span>.<span class="ident">push</span>(<span class="ident">FilterHeader</span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>);
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">BundleStatus</span>::<span class="ident">CFHeaders</span> { <span class="ident">cf_headers</span> })
- }
- <span class="number">0x02</span> <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">VarInt</span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">num</span>.<span class="number">0</span> <span class="kw">as</span> <span class="ident">usize</span>;
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cf_filters</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">num</span>);
- <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">num</span> {
- <span class="ident">cf_filters</span>.<span class="ident">push</span>(<span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>);
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">BundleStatus</span>::<span class="ident">CFilters</span> { <span class="ident">cf_filters</span> })
- }
- <span class="number">0x03</span> <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">VarInt</span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">num</span>.<span class="number">0</span> <span class="kw">as</span> <span class="ident">usize</span>;
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cf_filters</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">num</span>);
- <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">num</span> {
- <span class="ident">cf_filters</span>.<span class="ident">push</span>(<span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>);
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">BundleStatus</span>::<span class="ident">Processed</span> { <span class="ident">cf_filters</span> })
- }
- <span class="number">0x04</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">BundleStatus</span>::<span class="ident">Pruned</span>),
- <span class="number">0x05</span> <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">VarInt</span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">num</span>.<span class="number">0</span> <span class="kw">as</span> <span class="ident">usize</span>;
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cf_filters</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">num</span>);
- <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">num</span> {
- <span class="ident">cf_filters</span>.<span class="ident">push</span>(<span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">consensus_decode</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">d</span>)<span class="question-mark">?</span>);
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">BundleStatus</span>::<span class="ident">Tip</span> { <span class="ident">cf_filters</span> })
- }
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span>::<span class="ident">ParseFailed</span>(
- <span class="string">"Invalid byte type"</span>,
- )),
- }
- }
-}
-
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">ChainStore</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">StoreType</span><span class="op">></span> {
- <span class="ident">store</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">RwLock</span><span class="op"><</span><span class="ident">DB</span><span class="op">></span><span class="op">></span>,
- <span class="ident">cf_name</span>: <span class="ident">String</span>,
- <span class="ident">min_height</span>: <span class="ident">usize</span>,
- <span class="ident">network</span>: <span class="ident">Network</span>,
- <span class="ident">phantom</span>: <span class="ident">PhantomData</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>,
-}
-
-<span class="kw">impl</span> <span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Full</span><span class="op">></span> {
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">store</span>: <span class="ident">DB</span>, <span class="ident">network</span>: <span class="ident">Network</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">genesis</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">network</span> {
- <span class="ident">Network</span>::<span class="ident">Bitcoin</span> <span class="op">=</span><span class="op">></span> <span class="ident">MAINNET_GENESIS</span>.<span class="ident">deref</span>(),
- <span class="ident">Network</span>::<span class="ident">Testnet</span> <span class="op">=</span><span class="op">></span> <span class="ident">TESTNET_GENESIS</span>.<span class="ident">deref</span>(),
- <span class="ident">Network</span>::<span class="ident">Regtest</span> <span class="op">=</span><span class="op">></span> <span class="ident">REGTEST_GENESIS</span>.<span class="ident">deref</span>(),
- };
-
- <span class="kw">let</span> <span class="ident">cf_name</span> <span class="op">=</span> <span class="string">"default"</span>.<span class="ident">to_string</span>();
- <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">genesis_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="number">0</span>)).<span class="ident">get_key</span>();
-
- <span class="kw">if</span> <span class="ident">store</span>.<span class="ident">get_pinned_cf</span>(<span class="ident">cf_handle</span>, <span class="kw-2">&</span><span class="ident">genesis_key</span>)<span class="question-mark">?</span>.<span class="ident">is_none</span>() {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">WriteBatch</span>::<span class="ident">default</span>();
- <span class="ident">batch</span>.<span class="ident">put_cf</span>(
- <span class="ident">cf_handle</span>,
- <span class="ident">genesis_key</span>,
- (<span class="ident">genesis</span>.<span class="ident">header</span>, <span class="ident">genesis</span>.<span class="ident">header</span>.<span class="ident">work</span>()).<span class="ident">serialize</span>(),
- );
- <span class="ident">batch</span>.<span class="ident">put_cf</span>(
- <span class="ident">cf_handle</span>,
- <span class="ident">StoreEntry</span>::<span class="ident">BlockHeaderIndex</span>(<span class="prelude-val">Some</span>(<span class="ident">genesis</span>.<span class="ident">block_hash</span>())).<span class="ident">get_key</span>(),
- <span class="kw-2">&</span><span class="number">0usize</span>.<span class="ident">to_be_bytes</span>(),
- );
- <span class="ident">store</span>.<span class="ident">write</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>;
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">ChainStore</span> {
- <span class="ident">store</span>: <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">RwLock</span>::<span class="ident">new</span>(<span class="ident">store</span>)),
- <span class="ident">cf_name</span>,
- <span class="ident">min_height</span>: <span class="number">0</span>,
- <span class="ident">network</span>,
- <span class="ident">phantom</span>: <span class="ident">PhantomData</span>,
- })
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_locators</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span>(<span class="ident">BlockHash</span>, <span class="ident">usize</span>)<span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">step</span> <span class="op">=</span> <span class="number">1</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">index</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_height</span>()<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">answer</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
-
- <span class="kw">let</span> <span class="ident">store_read</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">store_read</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
-
- <span class="kw">loop</span> {
- <span class="kw">if</span> <span class="ident">answer</span>.<span class="ident">len</span>() <span class="op">></span> <span class="number">10</span> {
- <span class="ident">step</span> <span class="kw-2">*</span><span class="op">=</span> <span class="number">2</span>;
- }
-
- <span class="kw">let</span> (<span class="ident">header</span>, <span class="kw">_</span>): (<span class="ident">BlockHeader</span>, <span class="ident">Uint256</span>) <span class="op">=</span> <span class="ident">SerializeDb</span>::<span class="ident">deserialize</span>(
- <span class="kw-2">&</span><span class="ident">store_read</span>
- .<span class="ident">get_pinned_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">index</span>)).<span class="ident">get_key</span>())<span class="question-mark">?</span>
- .<span class="ident">unwrap</span>(),
- )<span class="question-mark">?</span>;
- <span class="ident">answer</span>.<span class="ident">push</span>((<span class="ident">header</span>.<span class="ident">block_hash</span>(), <span class="ident">index</span>));
-
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">new_index</span>) <span class="op">=</span> <span class="ident">index</span>.<span class="ident">checked_sub</span>(<span class="ident">step</span>) {
- <span class="ident">index</span> <span class="op">=</span> <span class="ident">new_index</span>;
- } <span class="kw">else</span> {
- <span class="kw">break</span>;
- }
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">answer</span>)
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">start_snapshot</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">from</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Snapshot</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">new_cf_name</span>: <span class="ident">String</span> <span class="op">=</span> <span class="ident">thread_rng</span>().<span class="ident">sample_iter</span>(<span class="kw-2">&</span><span class="ident">Alphanumeric</span>).<span class="ident">take</span>(<span class="number">16</span>).<span class="ident">collect</span>();
- <span class="kw">let</span> <span class="ident">new_cf_name</span> <span class="op">=</span> <span class="macro">format</span><span class="macro">!</span>(<span class="string">"_headers:{}"</span>, <span class="ident">new_cf_name</span>);
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">write_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">write</span>().<span class="ident">unwrap</span>();
-
- <span class="ident">write_store</span>.<span class="ident">create_cf</span>(<span class="kw-2">&</span><span class="ident">new_cf_name</span>, <span class="kw-2">&</span><span class="ident">Default</span>::<span class="ident">default</span>())<span class="question-mark">?</span>;
-
- <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">write_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">new_cf_handle</span> <span class="op">=</span> <span class="ident">write_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="ident">new_cf_name</span>).<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> (<span class="ident">header</span>, <span class="ident">work</span>): (<span class="ident">BlockHeader</span>, <span class="ident">Uint256</span>) <span class="op">=</span> <span class="ident">SerializeDb</span>::<span class="ident">deserialize</span>(
- <span class="kw-2">&</span><span class="ident">write_store</span>
- .<span class="ident">get_pinned_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">from</span>)).<span class="ident">get_key</span>())<span class="question-mark">?</span>
- .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>,
- )<span class="question-mark">?</span>;
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">WriteBatch</span>::<span class="ident">default</span>();
- <span class="ident">batch</span>.<span class="ident">put_cf</span>(
- <span class="ident">new_cf_handle</span>,
- <span class="ident">StoreEntry</span>::<span class="ident">BlockHeaderIndex</span>(<span class="prelude-val">Some</span>(<span class="ident">header</span>.<span class="ident">block_hash</span>())).<span class="ident">get_key</span>(),
- <span class="kw-2">&</span><span class="ident">from</span>.<span class="ident">to_be_bytes</span>(),
- );
- <span class="ident">batch</span>.<span class="ident">put_cf</span>(
- <span class="ident">new_cf_handle</span>,
- <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">from</span>)).<span class="ident">get_key</span>(),
- (<span class="ident">header</span>, <span class="ident">work</span>).<span class="ident">serialize</span>(),
- );
- <span class="ident">write_store</span>.<span class="ident">write</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>;
-
- <span class="kw">let</span> <span class="ident">store</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">store</span>);
- <span class="prelude-val">Ok</span>(<span class="ident">ChainStore</span> {
- <span class="ident">store</span>,
- <span class="ident">cf_name</span>: <span class="ident">new_cf_name</span>,
- <span class="ident">min_height</span>: <span class="ident">from</span>,
- <span class="ident">network</span>: <span class="self">self</span>.<span class="ident">network</span>,
- <span class="ident">phantom</span>: <span class="ident">PhantomData</span>,
- })
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">recover_snapshot</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">cf_name</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">write_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">write</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">snapshot_cf_handle</span> <span class="op">=</span> <span class="ident">write_store</span>.<span class="ident">cf_handle</span>(<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">prefix</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">None</span>).<span class="ident">get_key</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iterator</span> <span class="op">=</span> <span class="ident">write_store</span>.<span class="ident">prefix_iterator_cf</span>(<span class="ident">snapshot_cf_handle</span>, <span class="ident">prefix</span>);
-
- <span class="kw">let</span> <span class="ident">min_height</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">iterator</span>
- .<span class="ident">next</span>()
- .<span class="ident">and_then</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">k</span>[<span class="number">1</span>..].<span class="ident">try_into</span>().<span class="ident">ok</span>())
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">bytes</span><span class="op">|</span> <span class="ident">usize</span>::<span class="ident">from_be_bytes</span>(<span class="ident">bytes</span>))
- {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> {
- <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">iterator</span>);
- <span class="ident">write_store</span>.<span class="ident">drop_cf</span>(<span class="ident">cf_name</span>).<span class="ident">ok</span>();
-
- <span class="kw">return</span> <span class="prelude-val">Ok</span>(());
- }
- <span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="op">=</span><span class="op">></span> <span class="ident">x</span>,
- };
- <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">iterator</span>);
- <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">write_store</span>);
-
- <span class="kw">let</span> <span class="ident">snapshot</span> <span class="op">=</span> <span class="ident">ChainStore</span> {
- <span class="ident">store</span>: <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">store</span>),
- <span class="ident">cf_name</span>: <span class="ident">cf_name</span>.<span class="ident">into</span>(),
- <span class="ident">min_height</span>,
- <span class="ident">network</span>: <span class="self">self</span>.<span class="ident">network</span>,
- <span class="ident">phantom</span>: <span class="ident">PhantomData</span>,
- };
- <span class="kw">if</span> <span class="ident">snapshot</span>.<span class="ident">work</span>()<span class="question-mark">?</span> <span class="op">></span> <span class="self">self</span>.<span class="ident">work</span>()<span class="question-mark">?</span> {
- <span class="self">self</span>.<span class="ident">apply_snapshot</span>(<span class="ident">snapshot</span>)<span class="question-mark">?</span>;
- }
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">apply_snapshot</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">snaphost</span>: <span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Snapshot</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">WriteBatch</span>::<span class="ident">default</span>();
-
- <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">snapshot_cf_handle</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="ident">snaphost</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">from_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">snaphost</span>.<span class="ident">min_height</span>)).<span class="ident">get_key</span>();
- <span class="kw">let</span> <span class="ident">to_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">usize</span>::<span class="ident">MAX</span>)).<span class="ident">get_key</span>();
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">opts</span> <span class="op">=</span> <span class="ident">ReadOptions</span>::<span class="ident">default</span>();
- <span class="ident">opts</span>.<span class="ident">set_iterate_upper_bound</span>(<span class="ident">to_key</span>.<span class="ident">clone</span>());
-
- <span class="ident">log</span>::<span class="macro">debug</span><span class="macro">!</span>(<span class="string">"Removing items"</span>);
- <span class="ident">batch</span>.<span class="ident">delete_range_cf</span>(<span class="ident">cf_handle</span>, <span class="kw-2">&</span><span class="ident">from_key</span>, <span class="kw-2">&</span><span class="ident">to_key</span>);
- <span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">v</span>) <span class="kw">in</span> <span class="ident">read_store</span>.<span class="ident">iterator_cf_opt</span>(
- <span class="ident">cf_handle</span>,
- <span class="ident">opts</span>,
- <span class="ident">IteratorMode</span>::<span class="ident">From</span>(<span class="kw-2">&</span><span class="ident">from_key</span>, <span class="ident">Direction</span>::<span class="ident">Forward</span>),
- ) {
- <span class="kw">let</span> (<span class="ident">header</span>, <span class="kw">_</span>): (<span class="ident">BlockHeader</span>, <span class="ident">Uint256</span>) <span class="op">=</span> <span class="ident">SerializeDb</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">v</span>)<span class="question-mark">?</span>;
-
- <span class="ident">batch</span>.<span class="ident">delete_cf</span>(
- <span class="ident">cf_handle</span>,
- <span class="ident">StoreEntry</span>::<span class="ident">BlockHeaderIndex</span>(<span class="prelude-val">Some</span>(<span class="ident">header</span>.<span class="ident">block_hash</span>())).<span class="ident">get_key</span>(),
- );
- }
-
- <span class="comment">// Delete full blocks overriden by snapshot</span>
- <span class="kw">let</span> <span class="ident">from_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="prelude-val">Some</span>(<span class="ident">snaphost</span>.<span class="ident">min_height</span>)).<span class="ident">get_key</span>();
- <span class="kw">let</span> <span class="ident">to_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="prelude-val">Some</span>(<span class="ident">usize</span>::<span class="ident">MAX</span>)).<span class="ident">get_key</span>();
- <span class="ident">batch</span>.<span class="ident">delete_range</span>(<span class="kw-2">&</span><span class="ident">from_key</span>, <span class="kw-2">&</span><span class="ident">to_key</span>);
-
- <span class="ident">log</span>::<span class="macro">debug</span><span class="macro">!</span>(<span class="string">"Copying over new items"</span>);
- <span class="kw">for</span> (<span class="ident">k</span>, <span class="ident">v</span>) <span class="kw">in</span> <span class="ident">read_store</span>.<span class="ident">iterator_cf</span>(<span class="ident">snapshot_cf_handle</span>, <span class="ident">IteratorMode</span>::<span class="ident">Start</span>) {
- <span class="ident">batch</span>.<span class="ident">put_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">k</span>, <span class="ident">v</span>);
- }
-
- <span class="ident">read_store</span>.<span class="ident">write</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>;
-
- <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">snapshot_cf_handle</span>);
- <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">cf_handle</span>);
- <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">read_store</span>);
-
- <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">write</span>().<span class="ident">unwrap</span>().<span class="ident">drop_cf</span>(<span class="kw-2">&</span><span class="ident">snaphost</span>.<span class="ident">cf_name</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_height_for</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">block_hash</span>: <span class="kw-2">&</span><span class="ident">BlockHash</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeaderIndex</span>(<span class="prelude-val">Some</span>(<span class="ident">block_hash</span>.<span class="ident">clone</span>())).<span class="ident">get_key</span>();
- <span class="kw">let</span> <span class="ident">data</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">get_pinned_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">key</span>)<span class="question-mark">?</span>;
- <span class="prelude-val">Ok</span>(<span class="ident">data</span>
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">data</span><span class="op">|</span> {
- <span class="prelude-val">Ok</span>::<span class="op"><</span><span class="kw">_</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>(<span class="ident">usize</span>::<span class="ident">from_be_bytes</span>(
- <span class="ident">data</span>.<span class="ident">as_ref</span>()
- .<span class="ident">try_into</span>()
- .<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>,
- ))
- })
- .<span class="ident">transpose</span>()<span class="question-mark">?</span>)
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_block_hash</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">height</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">BlockHash</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">height</span>)).<span class="ident">get_key</span>();
- <span class="kw">let</span> <span class="ident">data</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">get_pinned_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">key</span>)<span class="question-mark">?</span>;
- <span class="prelude-val">Ok</span>(<span class="ident">data</span>
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">data</span><span class="op">|</span> {
- <span class="kw">let</span> (<span class="ident">header</span>, <span class="kw">_</span>): (<span class="ident">BlockHeader</span>, <span class="ident">Uint256</span>) <span class="op">=</span>
- <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">data</span>).<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>;
- <span class="prelude-val">Ok</span>::<span class="op"><</span><span class="kw">_</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>(<span class="ident">header</span>.<span class="ident">block_hash</span>())
- })
- .<span class="ident">transpose</span>()<span class="question-mark">?</span>)
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">save_full_block</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">block</span>: <span class="kw-2">&</span><span class="ident">Block</span>, <span class="ident">height</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="prelude-val">Some</span>(<span class="ident">height</span>)).<span class="ident">get_key</span>();
- <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>().<span class="ident">put</span>(<span class="ident">key</span>, <span class="ident">block</span>.<span class="ident">serialize</span>())<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_full_block</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">height</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Block</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="prelude-val">Some</span>(<span class="ident">height</span>)).<span class="ident">get_key</span>();
- <span class="kw">let</span> <span class="ident">opt_block</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">get_pinned</span>(<span class="ident">key</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">opt_block</span>
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">data</span><span class="op">|</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">data</span>))
- .<span class="ident">transpose</span>()
- .<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>)
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">delete_blocks_until</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">height</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">from_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="prelude-val">Some</span>(<span class="number">0</span>)).<span class="ident">get_key</span>();
- <span class="kw">let</span> <span class="ident">to_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="prelude-val">Some</span>(<span class="ident">height</span>)).<span class="ident">get_key</span>();
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">WriteBatch</span>::<span class="ident">default</span>();
- <span class="ident">batch</span>.<span class="ident">delete_range</span>(<span class="kw-2">&</span><span class="ident">from_key</span>, <span class="kw-2">&</span><span class="ident">to_key</span>);
-
- <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>().<span class="ident">write</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">iter_full_blocks</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span>(<span class="ident">usize</span>, <span class="ident">Block</span>)<span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">prefix</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">Block</span>(<span class="prelude-val">None</span>).<span class="ident">get_key</span>();
-
- <span class="kw">let</span> <span class="ident">iterator</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">prefix_iterator</span>(<span class="kw-2">&</span><span class="ident">prefix</span>);
- <span class="comment">// FIXME: we have to filter manually because rocksdb sometimes returns stuff that doesn't</span>
- <span class="comment">// have the right prefix</span>
- <span class="ident">iterator</span>
- .<span class="ident">filter</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">k</span>.<span class="ident">starts_with</span>(<span class="kw-2">&</span><span class="ident">prefix</span>))
- .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="ident">v</span>)<span class="op">|</span> {
- <span class="kw">let</span> <span class="ident">height</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="ident">usize</span>::<span class="ident">from_be_bytes</span>(
- <span class="ident">k</span>[<span class="number">1</span>..]
- .<span class="ident">try_into</span>()
- .<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>,
- );
- <span class="kw">let</span> <span class="ident">block</span> <span class="op">=</span> <span class="ident">SerializeDb</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">v</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>((<span class="ident">height</span>, <span class="ident">block</span>))
- })
- .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()
- }
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">StoreType</span><span class="op">></span> <span class="ident">ChainStore</span><span class="op"><</span><span class="ident">T</span><span class="op">></span> {
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">work</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Uint256</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">prefix</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">None</span>).<span class="ident">get_key</span>();
- <span class="kw">let</span> <span class="ident">iterator</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">prefix_iterator_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">prefix</span>);
-
- <span class="prelude-val">Ok</span>(<span class="ident">iterator</span>
- .<span class="ident">last</span>()
- .<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">v</span>)<span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> (<span class="kw">_</span>, <span class="ident">work</span>): (<span class="ident">BlockHeader</span>, <span class="ident">Uint256</span>) <span class="op">=</span> <span class="ident">SerializeDb</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">v</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">work</span>)
- })
- .<span class="ident">transpose</span>()<span class="question-mark">?</span>
- .<span class="ident">unwrap_or_default</span>())
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_height</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">usize</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">prefix</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">None</span>).<span class="ident">get_key</span>();
- <span class="kw">let</span> <span class="ident">iterator</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">prefix_iterator_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">prefix</span>);
-
- <span class="prelude-val">Ok</span>(<span class="ident">iterator</span>
- .<span class="ident">last</span>()
- .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">height</span> <span class="op">=</span> <span class="ident">usize</span>::<span class="ident">from_be_bytes</span>(
- <span class="ident">k</span>[<span class="number">1</span>..]
- .<span class="ident">try_into</span>()
- .<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>,
- );
-
- <span class="prelude-val">Ok</span>(<span class="ident">height</span>)
- })
- .<span class="ident">transpose</span>()<span class="question-mark">?</span>
- .<span class="ident">unwrap_or_default</span>())
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_tip_hash</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">BlockHash</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">prefix</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">None</span>).<span class="ident">get_key</span>();
- <span class="kw">let</span> <span class="ident">iterator</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">prefix_iterator_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">prefix</span>);
-
- <span class="prelude-val">Ok</span>(<span class="ident">iterator</span>
- .<span class="ident">last</span>()
- .<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">v</span>)<span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> (<span class="ident">header</span>, <span class="kw">_</span>): (<span class="ident">BlockHeader</span>, <span class="ident">Uint256</span>) <span class="op">=</span> <span class="ident">SerializeDb</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">v</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">header</span>.<span class="ident">block_hash</span>())
- })
- .<span class="ident">transpose</span>()<span class="question-mark">?</span>)
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">apply</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
- <span class="ident">from</span>: <span class="ident">usize</span>,
- <span class="ident">headers</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">BlockHeader</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">BlockHash</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">WriteBatch</span>::<span class="ident">default</span>();
-
- <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">cf_handle</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">cf_handle</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>).<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">last_hash</span>, <span class="kw-2">mut</span> <span class="ident">accumulated_work</span>) <span class="op">=</span> <span class="ident">read_store</span>
- .<span class="ident">get_pinned_cf</span>(<span class="ident">cf_handle</span>, <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">from</span>)).<span class="ident">get_key</span>())<span class="question-mark">?</span>
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">result</span><span class="op">|</span> {
- <span class="kw">let</span> (<span class="ident">header</span>, <span class="ident">work</span>): (<span class="ident">BlockHeader</span>, <span class="ident">Uint256</span>) <span class="op">=</span> <span class="ident">SerializeDb</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">result</span>)<span class="question-mark">?</span>;
- <span class="prelude-val">Ok</span>::<span class="op"><</span><span class="kw">_</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>((<span class="ident">header</span>.<span class="ident">block_hash</span>(), <span class="ident">work</span>))
- })
- .<span class="ident">transpose</span>()<span class="question-mark">?</span>
- .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">DataCorruption</span>)<span class="question-mark">?</span>;
-
- <span class="kw">for</span> (<span class="ident">index</span>, <span class="ident">header</span>) <span class="kw">in</span> <span class="ident">headers</span>.<span class="ident">into_iter</span>().<span class="ident">enumerate</span>() {
- <span class="kw">if</span> <span class="ident">header</span>.<span class="ident">prev_blockhash</span> <span class="op">!</span><span class="op">=</span> <span class="ident">last_hash</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidHeaders</span>);
- }
-
- <span class="ident">last_hash</span> <span class="op">=</span> <span class="ident">header</span>.<span class="ident">block_hash</span>();
- <span class="ident">accumulated_work</span> <span class="op">=</span> <span class="ident">accumulated_work</span> <span class="op">+</span> <span class="ident">header</span>.<span class="ident">work</span>();
-
- <span class="kw">let</span> <span class="ident">height</span> <span class="op">=</span> <span class="ident">from</span> <span class="op">+</span> <span class="ident">index</span> <span class="op">+</span> <span class="number">1</span>;
- <span class="ident">batch</span>.<span class="ident">put_cf</span>(
- <span class="ident">cf_handle</span>,
- <span class="ident">StoreEntry</span>::<span class="ident">BlockHeaderIndex</span>(<span class="prelude-val">Some</span>(<span class="ident">header</span>.<span class="ident">block_hash</span>())).<span class="ident">get_key</span>(),
- <span class="kw-2">&</span>(<span class="ident">height</span>).<span class="ident">to_be_bytes</span>(),
- );
- <span class="ident">batch</span>.<span class="ident">put_cf</span>(
- <span class="ident">cf_handle</span>,
- <span class="ident">StoreEntry</span>::<span class="ident">BlockHeader</span>(<span class="prelude-val">Some</span>(<span class="ident">height</span>)).<span class="ident">get_key</span>(),
- (<span class="ident">header</span>, <span class="ident">accumulated_work</span>).<span class="ident">serialize</span>(),
- );
- }
-
- <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">cf_handle</span>);
- <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">drop</span>(<span class="ident">read_store</span>);
-
- <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">write</span>().<span class="ident">unwrap</span>().<span class="ident">write</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>;
- <span class="prelude-val">Ok</span>(<span class="ident">last_hash</span>)
- }
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">StoreType</span><span class="op">></span> <span class="ident">fmt</span>::<span class="ident">Debug</span> <span class="kw">for</span> <span class="ident">ChainStore</span><span class="op"><</span><span class="ident">T</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
- <span class="ident">f</span>.<span class="ident">debug_struct</span>(<span class="kw-2">&</span><span class="macro">format</span><span class="macro">!</span>(<span class="string">"ChainStore<{:?}>"</span>, <span class="ident">T</span>::<span class="ident">default</span>()))
- .<span class="ident">field</span>(<span class="string">"cf_name"</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cf_name</span>)
- .<span class="ident">field</span>(<span class="string">"min_height"</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">min_height</span>)
- .<span class="ident">field</span>(<span class="string">"network"</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">network</span>)
- .<span class="ident">field</span>(<span class="string">"headers_height"</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">get_height</span>())
- .<span class="ident">field</span>(<span class="string">"tip_hash"</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">get_tip_hash</span>())
- .<span class="ident">finish</span>()
- }
-}
-
-<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">FilterHeaderHash</span> <span class="op">=</span> <span class="ident">FilterHash</span>;
-
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">FilterHeader</span> {
- <span class="ident">prev_header_hash</span>: <span class="ident">FilterHeaderHash</span>,
- <span class="ident">filter_hash</span>: <span class="ident">FilterHash</span>,
-}
-
-<span class="kw">impl</span> <span class="ident">FilterHeader</span> {
- <span class="kw">fn</span> <span class="ident">header_hash</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">FilterHeaderHash</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">hash_data</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">filter_hash</span>.<span class="ident">into_inner</span>().<span class="ident">to_vec</span>();
- <span class="ident">hash_data</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">prev_header_hash</span>);
- <span class="ident">sha256d</span>::<span class="ident">Hash</span>::<span class="ident">hash</span>(<span class="kw-2">&</span><span class="ident">hash_data</span>).<span class="ident">into</span>()
- }
-}
-
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">BundleStatus</span> {
- <span class="ident">Init</span>,
- <span class="ident">CFHeaders</span> { <span class="ident">cf_headers</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">FilterHeader</span><span class="op">></span> },
- <span class="ident">CFilters</span> { <span class="ident">cf_filters</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span><span class="op">></span> },
- <span class="ident">Processed</span> { <span class="ident">cf_filters</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span><span class="op">></span> },
- <span class="ident">Tip</span> { <span class="ident">cf_filters</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span><span class="op">></span> },
- <span class="ident">Pruned</span>,
-}
-
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">CFStore</span> {
- <span class="ident">store</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">RwLock</span><span class="op"><</span><span class="ident">DB</span><span class="op">></span><span class="op">></span>,
- <span class="ident">filter_type</span>: <span class="ident">u8</span>,
-}
-
-<span class="kw">type</span> <span class="ident">BundleEntry</span> <span class="op">=</span> (<span class="ident">BundleStatus</span>, <span class="ident">FilterHeaderHash</span>);
-
-<span class="kw">impl</span> <span class="ident">CFStore</span> {
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(
- <span class="ident">headers_store</span>: <span class="kw-2">&</span><span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Full</span><span class="op">></span>,
- <span class="ident">filter_type</span>: <span class="ident">u8</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">cf_store</span> <span class="op">=</span> <span class="ident">CFStore</span> {
- <span class="ident">store</span>: <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">headers_store</span>.<span class="ident">store</span>),
- <span class="ident">filter_type</span>,
- };
-
- <span class="kw">let</span> <span class="ident">genesis</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">headers_store</span>.<span class="ident">network</span> {
- <span class="ident">Network</span>::<span class="ident">Bitcoin</span> <span class="op">=</span><span class="op">></span> <span class="ident">MAINNET_GENESIS</span>.<span class="ident">deref</span>(),
- <span class="ident">Network</span>::<span class="ident">Testnet</span> <span class="op">=</span><span class="op">></span> <span class="ident">TESTNET_GENESIS</span>.<span class="ident">deref</span>(),
- <span class="ident">Network</span>::<span class="ident">Regtest</span> <span class="op">=</span><span class="op">></span> <span class="ident">REGTEST_GENESIS</span>.<span class="ident">deref</span>(),
- };
-
- <span class="kw">let</span> <span class="ident">filter</span> <span class="op">=</span> <span class="ident">BlockFilter</span>::<span class="ident">new_script_filter</span>(<span class="ident">genesis</span>, <span class="op">|</span><span class="ident">utxo</span><span class="op">|</span> {
- <span class="prelude-val">Err</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip158</span>::<span class="ident">Error</span>::<span class="ident">UtxoMissing</span>(<span class="kw-2">*</span><span class="ident">utxo</span>))
- })<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">first_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="ident">filter_type</span>, <span class="prelude-val">Some</span>(<span class="number">0</span>))).<span class="ident">get_key</span>();
-
- <span class="comment">// Add the genesis' filter</span>
- {
- <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="ident">cf_store</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
- <span class="kw">if</span> <span class="ident">read_store</span>.<span class="ident">get_pinned</span>(<span class="kw-2">&</span><span class="ident">first_key</span>)<span class="question-mark">?</span>.<span class="ident">is_none</span>() {
- <span class="ident">read_store</span>.<span class="ident">put</span>(
- <span class="kw-2">&</span><span class="ident">first_key</span>,
- (<span class="ident">BundleStatus</span>::<span class="ident">Init</span>, <span class="ident">filter</span>.<span class="ident">filter_id</span>(<span class="kw-2">&</span><span class="ident">FilterHash</span>::<span class="ident">default</span>())).<span class="ident">serialize</span>(),
- )<span class="question-mark">?</span>;
- }
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">cf_store</span>)
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_filter_type</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">u8</span> {
- <span class="self">self</span>.<span class="ident">filter_type</span>
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_bundles</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">BundleEntry</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">prefix</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="self">self</span>.<span class="ident">filter_type</span>, <span class="prelude-val">None</span>)).<span class="ident">get_key</span>();
- <span class="kw">let</span> <span class="ident">iterator</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">prefix_iterator</span>(<span class="kw-2">&</span><span class="ident">prefix</span>);
-
- <span class="comment">// FIXME: we have to filter manually because rocksdb sometimes returns stuff that doesn't</span>
- <span class="comment">// have the right prefix</span>
- <span class="ident">iterator</span>
- .<span class="ident">filter</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">k</span>.<span class="ident">starts_with</span>(<span class="kw-2">&</span><span class="ident">prefix</span>))
- .<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">data</span>)<span class="op">|</span> <span class="ident">BundleEntry</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">data</span>))
- .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_checkpoints</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">FilterHash</span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">prefix</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="self">self</span>.<span class="ident">filter_type</span>, <span class="prelude-val">None</span>)).<span class="ident">get_key</span>();
- <span class="kw">let</span> <span class="ident">iterator</span> <span class="op">=</span> <span class="ident">read_store</span>.<span class="ident">prefix_iterator</span>(<span class="kw-2">&</span><span class="ident">prefix</span>);
-
- <span class="comment">// FIXME: we have to filter manually because rocksdb sometimes returns stuff that doesn't</span>
- <span class="comment">// have the right prefix</span>
- <span class="prelude-val">Ok</span>(<span class="ident">iterator</span>
- .<span class="ident">filter</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">k</span>.<span class="ident">starts_with</span>(<span class="kw-2">&</span><span class="ident">prefix</span>))
- .<span class="ident">skip</span>(<span class="number">1</span>)
- .<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">data</span>)<span class="op">|</span> <span class="prelude-val">Ok</span>::<span class="op"><</span><span class="kw">_</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>(<span class="ident">BundleEntry</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">data</span>)<span class="question-mark">?</span>.<span class="number">1</span>))
- .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()<span class="question-mark">?</span>)
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">replace_checkpoints</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">checkpoints</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">FilterHash</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">current_checkpoints</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_checkpoints</span>()<span class="question-mark">?</span>;
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">equal_bundles</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">for</span> (<span class="ident">index</span>, (<span class="ident">our</span>, <span class="ident">their</span>)) <span class="kw">in</span> <span class="ident">current_checkpoints</span>
- .<span class="ident">iter</span>()
- .<span class="ident">zip</span>(<span class="ident">checkpoints</span>.<span class="ident">iter</span>())
- .<span class="ident">enumerate</span>()
- {
- <span class="ident">equal_bundles</span> <span class="op">=</span> <span class="ident">index</span>;
-
- <span class="kw">if</span> <span class="ident">our</span> <span class="op">!</span><span class="op">=</span> <span class="ident">their</span> {
- <span class="kw">break</span>;
- }
- }
-
- <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">WriteBatch</span>::<span class="ident">default</span>();
-
- <span class="kw">for</span> (<span class="ident">index</span>, <span class="ident">filter_hash</span>) <span class="kw">in</span> <span class="ident">checkpoints</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>().<span class="ident">skip</span>(<span class="ident">equal_bundles</span>) {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="self">self</span>.<span class="ident">filter_type</span>, <span class="prelude-val">Some</span>(<span class="ident">index</span> <span class="op">+</span> <span class="number">1</span>))).<span class="ident">get_key</span>(); <span class="comment">// +1 to skip the genesis' filter</span>
-
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">BundleStatus</span>::<span class="ident">Tip</span> { .. }, <span class="kw">_</span>)) <span class="op">=</span> <span class="ident">read_store</span>
- .<span class="ident">get_pinned</span>(<span class="kw-2">&</span><span class="ident">key</span>)<span class="question-mark">?</span>
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">data</span><span class="op">|</span> <span class="ident">BundleEntry</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">data</span>))
- .<span class="ident">transpose</span>()<span class="question-mark">?</span>
- {
- <span class="macro">println</span><span class="macro">!</span>(<span class="string">"Keeping bundle #{} as Tip"</span>, <span class="ident">index</span>);
- } <span class="kw">else</span> {
- <span class="ident">batch</span>.<span class="ident">put</span>(<span class="kw-2">&</span><span class="ident">key</span>, (<span class="ident">BundleStatus</span>::<span class="ident">Init</span>, <span class="kw-2">*</span><span class="ident">filter_hash</span>).<span class="ident">serialize</span>());
- }
- }
-
- <span class="ident">read_store</span>.<span class="ident">write</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">advance_to_cf_headers</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">bundle</span>: <span class="ident">usize</span>,
- <span class="ident">checkpoint_hash</span>: <span class="ident">FilterHeaderHash</span>,
- <span class="ident">filter_headers</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">FilterHash</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">BundleStatus</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">last_hash</span> <span class="op">=</span> <span class="ident">checkpoint_hash</span>;
- <span class="kw">let</span> <span class="ident">cf_headers</span> <span class="op">=</span> <span class="ident">filter_headers</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">filter_hash</span><span class="op">|</span> {
- <span class="kw">let</span> <span class="ident">filter_header</span> <span class="op">=</span> <span class="ident">FilterHeader</span> {
- <span class="ident">prev_header_hash</span>: <span class="ident">last_hash</span>,
- <span class="ident">filter_hash</span>,
- };
- <span class="ident">last_hash</span> <span class="op">=</span> <span class="ident">filter_header</span>.<span class="ident">header_hash</span>();
-
- <span class="ident">filter_header</span>
- })
- .<span class="ident">collect</span>();
-
- <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">next_key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="self">self</span>.<span class="ident">filter_type</span>, <span class="prelude-val">Some</span>(<span class="ident">bundle</span> <span class="op">+</span> <span class="number">1</span>))).<span class="ident">get_key</span>(); <span class="comment">// +1 to skip the genesis' filter</span>
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="kw">_</span>, <span class="ident">next_checkpoint</span>)) <span class="op">=</span> <span class="ident">read_store</span>
- .<span class="ident">get_pinned</span>(<span class="kw-2">&</span><span class="ident">next_key</span>)<span class="question-mark">?</span>
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">data</span><span class="op">|</span> <span class="ident">BundleEntry</span>::<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">data</span>))
- .<span class="ident">transpose</span>()<span class="question-mark">?</span>
- {
- <span class="comment">// check connection with the next bundle if present</span>
- <span class="kw">if</span> <span class="ident">last_hash</span> <span class="op">!</span><span class="op">=</span> <span class="ident">next_checkpoint</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidFilterHeader</span>);
- }
- }
-
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="self">self</span>.<span class="ident">filter_type</span>, <span class="prelude-val">Some</span>(<span class="ident">bundle</span>))).<span class="ident">get_key</span>();
- <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> (<span class="ident">BundleStatus</span>::<span class="ident">CFHeaders</span> { <span class="ident">cf_headers</span> }, <span class="ident">checkpoint_hash</span>);
-
- <span class="ident">read_store</span>.<span class="ident">put</span>(<span class="ident">key</span>, <span class="ident">value</span>.<span class="ident">serialize</span>())<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">value</span>.<span class="number">0</span>)
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">advance_to_cf_filters</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">bundle</span>: <span class="ident">usize</span>,
- <span class="ident">checkpoint_hash</span>: <span class="ident">FilterHeaderHash</span>,
- <span class="ident">headers</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">FilterHeader</span><span class="op">></span>,
- <span class="ident">filters</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">usize</span>, <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>)<span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">BundleStatus</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">cf_filters</span> <span class="op">=</span> <span class="ident">filters</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">zip</span>(<span class="ident">headers</span>.<span class="ident">iter</span>())
- .<span class="ident">map</span>(<span class="op">|</span>((<span class="kw">_</span>, <span class="ident">filter_content</span>), <span class="ident">header</span>)<span class="op">|</span> {
- <span class="kw">if</span> <span class="ident">header</span>.<span class="ident">filter_hash</span> <span class="op">!</span><span class="op">=</span> <span class="ident">sha256d</span>::<span class="ident">Hash</span>::<span class="ident">hash</span>(<span class="kw-2">&</span><span class="ident">filter_content</span>).<span class="ident">into</span>() {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidFilter</span>);
- }
-
- <span class="prelude-val">Ok</span>::<span class="op"><</span><span class="kw">_</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>(<span class="ident">filter_content</span>)
- })
- .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()<span class="question-mark">?</span>;
-
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="self">self</span>.<span class="ident">filter_type</span>, <span class="prelude-val">Some</span>(<span class="ident">bundle</span>))).<span class="ident">get_key</span>();
- <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> (<span class="ident">BundleStatus</span>::<span class="ident">CFilters</span> { <span class="ident">cf_filters</span> }, <span class="ident">checkpoint_hash</span>);
-
- <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
- <span class="ident">read_store</span>.<span class="ident">put</span>(<span class="ident">key</span>, <span class="ident">value</span>.<span class="ident">serialize</span>())<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">value</span>.<span class="number">0</span>)
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">prune_filters</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">bundle</span>: <span class="ident">usize</span>,
- <span class="ident">checkpoint_hash</span>: <span class="ident">FilterHeaderHash</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">BundleStatus</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="self">self</span>.<span class="ident">filter_type</span>, <span class="prelude-val">Some</span>(<span class="ident">bundle</span>))).<span class="ident">get_key</span>();
- <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> (<span class="ident">BundleStatus</span>::<span class="ident">Pruned</span>, <span class="ident">checkpoint_hash</span>);
-
- <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
- <span class="ident">read_store</span>.<span class="ident">put</span>(<span class="ident">key</span>, <span class="ident">value</span>.<span class="ident">serialize</span>())<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">value</span>.<span class="number">0</span>)
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">mark_as_tip</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">bundle</span>: <span class="ident">usize</span>,
- <span class="ident">cf_filters</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span><span class="op">></span>,
- <span class="ident">checkpoint_hash</span>: <span class="ident">FilterHeaderHash</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">BundleStatus</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">StoreEntry</span>::<span class="ident">CFilterTable</span>((<span class="self">self</span>.<span class="ident">filter_type</span>, <span class="prelude-val">Some</span>(<span class="ident">bundle</span>))).<span class="ident">get_key</span>();
- <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> (<span class="ident">BundleStatus</span>::<span class="ident">Tip</span> { <span class="ident">cf_filters</span> }, <span class="ident">checkpoint_hash</span>);
-
- <span class="kw">let</span> <span class="ident">read_store</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">store</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>();
- <span class="ident">read_store</span>.<span class="ident">put</span>(<span class="ident">key</span>, <span class="ident">value</span>.<span class="ident">serialize</span>())<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">value</span>.<span class="number">0</span>)
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "magical";</script><script src="../../../../main.js"></script><script src="../../../../source-script.js"></script><script src="../../../../source-files.js"></script><script defer src="../../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/blockchain/compact_filters/sync.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>sync.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../../magical/index.html'><div class='logo-container'><img src='../../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-<span id="203">203</span>
-<span id="204">204</span>
-<span id="205">205</span>
-<span id="206">206</span>
-<span id="207">207</span>
-<span id="208">208</span>
-<span id="209">209</span>
-<span id="210">210</span>
-<span id="211">211</span>
-<span id="212">212</span>
-<span id="213">213</span>
-<span id="214">214</span>
-<span id="215">215</span>
-<span id="216">216</span>
-<span id="217">217</span>
-<span id="218">218</span>
-<span id="219">219</span>
-<span id="220">220</span>
-<span id="221">221</span>
-<span id="222">222</span>
-<span id="223">223</span>
-<span id="224">224</span>
-<span id="225">225</span>
-<span id="226">226</span>
-<span id="227">227</span>
-<span id="228">228</span>
-<span id="229">229</span>
-<span id="230">230</span>
-<span id="231">231</span>
-<span id="232">232</span>
-<span id="233">233</span>
-<span id="234">234</span>
-<span id="235">235</span>
-<span id="236">236</span>
-<span id="237">237</span>
-<span id="238">238</span>
-<span id="239">239</span>
-<span id="240">240</span>
-<span id="241">241</span>
-<span id="242">242</span>
-<span id="243">243</span>
-<span id="244">244</span>
-<span id="245">245</span>
-<span id="246">246</span>
-<span id="247">247</span>
-<span id="248">248</span>
-<span id="249">249</span>
-<span id="250">250</span>
-<span id="251">251</span>
-<span id="252">252</span>
-<span id="253">253</span>
-<span id="254">254</span>
-<span id="255">255</span>
-<span id="256">256</span>
-<span id="257">257</span>
-<span id="258">258</span>
-<span id="259">259</span>
-<span id="260">260</span>
-<span id="261">261</span>
-<span id="262">262</span>
-<span id="263">263</span>
-<span id="264">264</span>
-<span id="265">265</span>
-<span id="266">266</span>
-<span id="267">267</span>
-<span id="268">268</span>
-<span id="269">269</span>
-<span id="270">270</span>
-<span id="271">271</span>
-<span id="272">272</span>
-<span id="273">273</span>
-<span id="274">274</span>
-<span id="275">275</span>
-<span id="276">276</span>
-<span id="277">277</span>
-<span id="278">278</span>
-<span id="279">279</span>
-<span id="280">280</span>
-<span id="281">281</span>
-<span id="282">282</span>
-<span id="283">283</span>
-<span id="284">284</span>
-<span id="285">285</span>
-<span id="286">286</span>
-<span id="287">287</span>
-<span id="288">288</span>
-<span id="289">289</span>
-<span id="290">290</span>
-<span id="291">291</span>
-<span id="292">292</span>
-<span id="293">293</span>
-<span id="294">294</span>
-<span id="295">295</span>
-<span id="296">296</span>
-<span id="297">297</span>
-<span id="298">298</span>
-<span id="299">299</span>
-<span id="300">300</span>
-<span id="301">301</span>
-<span id="302">302</span>
-<span id="303">303</span>
-<span id="304">304</span>
-<span id="305">305</span>
-<span id="306">306</span>
-<span id="307">307</span>
-<span id="308">308</span>
-<span id="309">309</span>
-<span id="310">310</span>
-<span id="311">311</span>
-<span id="312">312</span>
-<span id="313">313</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::{<span class="ident">BTreeMap</span>, <span class="ident">HashMap</span>, <span class="ident">VecDeque</span>};
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::{<span class="ident">Arc</span>, <span class="ident">Mutex</span>};
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">Duration</span>;
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hash_types</span>::{<span class="ident">BlockHash</span>, <span class="ident">FilterHash</span>};
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">message</span>::<span class="ident">NetworkMessage</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">message_blockdata</span>::<span class="ident">GetHeadersMessage</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip158</span>::<span class="ident">BlockFilter</span>;
-
-<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">peer</span>::<span class="kw-2">*</span>;
-<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">store</span>::<span class="kw-2">*</span>;
-<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">CompactFiltersError</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
-
-<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const</span> <span class="ident">BURIED_CONFIRMATIONS</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">100</span>;
-
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">CFSync</span> {
- <span class="ident">headers_store</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Full</span><span class="op">></span><span class="op">></span>,
- <span class="ident">cf_store</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">CFStore</span><span class="op">></span>,
- <span class="ident">skip_blocks</span>: <span class="ident">usize</span>,
- <span class="ident">bundles</span>: <span class="ident">Mutex</span><span class="op"><</span><span class="ident">VecDeque</span><span class="op"><</span>(<span class="ident">BundleStatus</span>, <span class="ident">FilterHash</span>, <span class="ident">usize</span>)<span class="op">></span><span class="op">></span>,
-}
-
-<span class="kw">impl</span> <span class="ident">CFSync</span> {
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(
- <span class="ident">headers_store</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Full</span><span class="op">></span><span class="op">></span>,
- <span class="ident">skip_blocks</span>: <span class="ident">usize</span>,
- <span class="ident">filter_type</span>: <span class="ident">u8</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">cf_store</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">CFStore</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="ident">headers_store</span>, <span class="ident">filter_type</span>)<span class="question-mark">?</span>);
-
- <span class="prelude-val">Ok</span>(<span class="ident">CFSync</span> {
- <span class="ident">headers_store</span>,
- <span class="ident">cf_store</span>,
- <span class="ident">skip_blocks</span>,
- <span class="ident">bundles</span>: <span class="ident">Mutex</span>::<span class="ident">new</span>(<span class="ident">VecDeque</span>::<span class="ident">new</span>()),
- })
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">pruned_bundles</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">usize</span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="self">self</span>
- .<span class="ident">cf_store</span>
- .<span class="ident">get_bundles</span>()<span class="question-mark">?</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">skip</span>(<span class="self">self</span>.<span class="ident">skip_blocks</span> <span class="op">/</span> <span class="number">1000</span>)
- .<span class="ident">fold</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">acc</span>, (<span class="ident">status</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="kw">match</span> <span class="ident">status</span> {
- <span class="ident">BundleStatus</span>::<span class="ident">Pruned</span> <span class="op">=</span><span class="op">></span> <span class="ident">acc</span> <span class="op">+</span> <span class="number">1</span>,
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="ident">acc</span>,
- }))
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">prepare_sync</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">peer</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Peer</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">bundles_lock</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">bundles</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">resp</span> <span class="op">=</span> <span class="ident">peer</span>.<span class="ident">get_cf_checkpt</span>(
- <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">get_filter_type</span>(),
- <span class="self">self</span>.<span class="ident">headers_store</span>.<span class="ident">get_tip_hash</span>()<span class="question-mark">?</span>.<span class="ident">unwrap</span>(),
- )<span class="question-mark">?</span>;
- <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">replace_checkpoints</span>(<span class="ident">resp</span>.<span class="ident">filter_headers</span>)<span class="question-mark">?</span>;
-
- <span class="ident">bundles_lock</span>.<span class="ident">clear</span>();
- <span class="kw">for</span> (<span class="ident">index</span>, (<span class="ident">status</span>, <span class="ident">checkpoint</span>)) <span class="kw">in</span> <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">get_bundles</span>()<span class="question-mark">?</span>.<span class="ident">into_iter</span>().<span class="ident">enumerate</span>() {
- <span class="ident">bundles_lock</span>.<span class="ident">push_back</span>((<span class="ident">status</span>, <span class="ident">checkpoint</span>, <span class="ident">index</span>));
- }
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">capture_thread_for_sync</span><span class="op"><</span><span class="ident">F</span>, <span class="ident">Q</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">peer</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Peer</span><span class="op">></span>,
- <span class="ident">process</span>: <span class="ident">F</span>,
- <span class="ident">completed_bundle</span>: <span class="ident">Q</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">CompactFiltersError</span><span class="op">></span>
- <span class="kw">where</span>
- <span class="ident">F</span>: <span class="ident">Fn</span>(<span class="kw-2">&</span><span class="ident">BlockHash</span>, <span class="kw-2">&</span><span class="ident">BlockFilter</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">bool</span>, <span class="ident">CompactFiltersError</span><span class="op">></span>,
- <span class="ident">Q</span>: <span class="ident">Fn</span>(<span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>,
- {
- <span class="kw">let</span> <span class="ident">current_height</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">headers_store</span>.<span class="ident">get_height</span>()<span class="question-mark">?</span>; <span class="comment">// TODO: we should update it in case headers_store is also updated</span>
-
- <span class="kw">loop</span> {
- <span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">status</span>, <span class="ident">checkpoint</span>, <span class="ident">index</span>) <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span>.<span class="ident">bundles</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>().<span class="ident">pop_front</span>() {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">break</span>,
- <span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="op">=</span><span class="op">></span> <span class="ident">x</span>,
- };
-
- <span class="ident">log</span>::<span class="macro">debug</span><span class="macro">!</span>(
- <span class="string">"Processing bundle #{} - height {} to {}"</span>,
- <span class="ident">index</span>,
- <span class="ident">index</span> <span class="op">*</span> <span class="number">1000</span> <span class="op">+</span> <span class="number">1</span>,
- (<span class="ident">index</span> <span class="op">+</span> <span class="number">1</span>) <span class="op">*</span> <span class="number">1000</span>
- );
-
- <span class="kw">let</span> <span class="ident">process_received_filters</span> <span class="op">=</span>
- <span class="op">|</span><span class="ident">expected_filters</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">usize</span>, <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">filters_map</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
- <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">expected_filters</span> {
- <span class="kw">let</span> <span class="ident">filter</span> <span class="op">=</span> <span class="ident">peer</span>.<span class="ident">pop_cf_filter_resp</span>()<span class="question-mark">?</span>;
- <span class="kw">if</span> <span class="ident">filter</span>.<span class="ident">filter_type</span> <span class="op">!</span><span class="op">=</span> <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">get_filter_type</span>() {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>);
- }
-
- <span class="kw">match</span> <span class="self">self</span>.<span class="ident">headers_store</span>.<span class="ident">get_height_for</span>(<span class="kw-2">&</span><span class="ident">filter</span>.<span class="ident">block_hash</span>)<span class="question-mark">?</span> {
- <span class="prelude-val">Some</span>(<span class="ident">height</span>) <span class="op">=</span><span class="op">></span> <span class="ident">filters_map</span>.<span class="ident">insert</span>(<span class="ident">height</span>, <span class="ident">filter</span>.<span class="ident">filter</span>),
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidFilter</span>),
- };
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">filters_map</span>)
- };
-
- <span class="kw">let</span> <span class="ident">start_height</span> <span class="op">=</span> <span class="ident">index</span> <span class="op">*</span> <span class="number">1000</span> <span class="op">+</span> <span class="number">1</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">already_processed</span> <span class="op">=</span> <span class="number">0</span>;
-
- <span class="kw">if</span> <span class="ident">start_height</span> <span class="op"><</span> <span class="self">self</span>.<span class="ident">skip_blocks</span> {
- <span class="ident">status</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">prune_filters</span>(<span class="ident">index</span>, <span class="ident">checkpoint</span>)<span class="question-mark">?</span>;
- }
-
- <span class="kw">let</span> <span class="ident">stop_height</span> <span class="op">=</span> <span class="ident">std</span>::<span class="ident">cmp</span>::<span class="ident">min</span>(<span class="ident">current_height</span>, <span class="ident">start_height</span> <span class="op">+</span> <span class="number">999</span>);
- <span class="kw">let</span> <span class="ident">stop_hash</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">headers_store</span>.<span class="ident">get_block_hash</span>(<span class="ident">stop_height</span>)<span class="question-mark">?</span>.<span class="ident">unwrap</span>();
-
- <span class="kw">if</span> <span class="kw">let</span> <span class="ident">BundleStatus</span>::<span class="ident">Init</span> <span class="op">=</span> <span class="ident">status</span> {
- <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"status: Init"</span>);
-
- <span class="kw">let</span> <span class="ident">resp</span> <span class="op">=</span> <span class="ident">peer</span>.<span class="ident">get_cf_headers</span>(<span class="number">0x00</span>, <span class="ident">start_height</span> <span class="kw">as</span> <span class="ident">u32</span>, <span class="ident">stop_hash</span>)<span class="question-mark">?</span>;
-
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">resp</span>.<span class="ident">previous_filter</span> <span class="op">=</span><span class="op">=</span> <span class="ident">checkpoint</span>);
- <span class="ident">status</span> <span class="op">=</span>
- <span class="self">self</span>.<span class="ident">cf_store</span>
- .<span class="ident">advance_to_cf_headers</span>(<span class="ident">index</span>, <span class="ident">checkpoint</span>, <span class="ident">resp</span>.<span class="ident">filter_hashes</span>)<span class="question-mark">?</span>;
- }
- <span class="kw">if</span> <span class="kw">let</span> <span class="ident">BundleStatus</span>::<span class="ident">Tip</span> { <span class="ident">cf_filters</span> } <span class="op">=</span> <span class="ident">status</span> {
- <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"status: Tip (beginning) "</span>);
-
- <span class="ident">already_processed</span> <span class="op">=</span> <span class="ident">cf_filters</span>.<span class="ident">len</span>();
- <span class="kw">let</span> <span class="ident">headers_resp</span> <span class="op">=</span> <span class="ident">peer</span>.<span class="ident">get_cf_headers</span>(<span class="number">0x00</span>, <span class="ident">start_height</span> <span class="kw">as</span> <span class="ident">u32</span>, <span class="ident">stop_hash</span>)<span class="question-mark">?</span>;
-
- <span class="kw">let</span> <span class="ident">cf_headers</span> <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">advance_to_cf_headers</span>(
- <span class="ident">index</span>,
- <span class="ident">checkpoint</span>,
- <span class="ident">headers_resp</span>.<span class="ident">filter_hashes</span>,
- )<span class="question-mark">?</span> {
- <span class="ident">BundleStatus</span>::<span class="ident">CFHeaders</span> { <span class="ident">cf_headers</span> } <span class="op">=</span><span class="op">></span> <span class="ident">cf_headers</span>,
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>),
- };
-
- <span class="ident">peer</span>.<span class="ident">get_cf_filters</span>(
- <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">get_filter_type</span>(),
- (<span class="ident">start_height</span> <span class="op">+</span> <span class="ident">cf_filters</span>.<span class="ident">len</span>()) <span class="kw">as</span> <span class="ident">u32</span>,
- <span class="ident">stop_hash</span>,
- )<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">expected_filters</span> <span class="op">=</span> <span class="ident">stop_height</span> <span class="op">-</span> <span class="ident">start_height</span> <span class="op">+</span> <span class="number">1</span> <span class="op">-</span> <span class="ident">cf_filters</span>.<span class="ident">len</span>();
- <span class="kw">let</span> <span class="ident">filters_map</span> <span class="op">=</span> <span class="ident">process_received_filters</span>(<span class="ident">expected_filters</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">filters</span> <span class="op">=</span> <span class="ident">cf_filters</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">enumerate</span>()
- .<span class="ident">chain</span>(<span class="ident">filters_map</span>.<span class="ident">into_iter</span>())
- .<span class="ident">collect</span>();
- <span class="ident">status</span> <span class="op">=</span> <span class="self">self</span>
- .<span class="ident">cf_store</span>
- .<span class="ident">advance_to_cf_filters</span>(<span class="ident">index</span>, <span class="ident">checkpoint</span>, <span class="ident">cf_headers</span>, <span class="ident">filters</span>)<span class="question-mark">?</span>;
- }
- <span class="kw">if</span> <span class="kw">let</span> <span class="ident">BundleStatus</span>::<span class="ident">CFHeaders</span> { <span class="ident">cf_headers</span> } <span class="op">=</span> <span class="ident">status</span> {
- <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"status: CFHeaders"</span>);
-
- <span class="ident">peer</span>.<span class="ident">get_cf_filters</span>(
- <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">get_filter_type</span>(),
- <span class="ident">start_height</span> <span class="kw">as</span> <span class="ident">u32</span>,
- <span class="ident">stop_hash</span>,
- )<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">expected_filters</span> <span class="op">=</span> <span class="ident">stop_height</span> <span class="op">-</span> <span class="ident">start_height</span> <span class="op">+</span> <span class="number">1</span>;
- <span class="kw">let</span> <span class="ident">filters_map</span> <span class="op">=</span> <span class="ident">process_received_filters</span>(<span class="ident">expected_filters</span>)<span class="question-mark">?</span>;
- <span class="ident">status</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">advance_to_cf_filters</span>(
- <span class="ident">index</span>,
- <span class="ident">checkpoint</span>,
- <span class="ident">cf_headers</span>,
- <span class="ident">filters_map</span>.<span class="ident">into_iter</span>().<span class="ident">collect</span>(),
- )<span class="question-mark">?</span>;
- }
- <span class="kw">if</span> <span class="kw">let</span> <span class="ident">BundleStatus</span>::<span class="ident">CFilters</span> { <span class="ident">cf_filters</span> } <span class="op">=</span> <span class="ident">status</span> {
- <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"status: CFilters"</span>);
-
- <span class="kw">let</span> <span class="ident">last_sync_buried_height</span> <span class="op">=</span> (<span class="ident">start_height</span> <span class="op">+</span> <span class="ident">already_processed</span>)
- .<span class="ident">checked_sub</span>(<span class="ident">BURIED_CONFIRMATIONS</span>)
- .<span class="ident">unwrap_or</span>(<span class="number">0</span>);
-
- <span class="kw">for</span> (<span class="ident">filter_index</span>, <span class="ident">filter</span>) <span class="kw">in</span> <span class="ident">cf_filters</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
- <span class="kw">let</span> <span class="ident">height</span> <span class="op">=</span> <span class="ident">filter_index</span> <span class="op">+</span> <span class="ident">start_height</span>;
-
- <span class="comment">// do not download blocks that were already "buried" since the last sync</span>
- <span class="kw">if</span> <span class="ident">height</span> <span class="op"><</span> <span class="ident">last_sync_buried_height</span> {
- <span class="kw">continue</span>;
- }
-
- <span class="kw">let</span> <span class="ident">block_hash</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">headers_store</span>.<span class="ident">get_block_hash</span>(<span class="ident">height</span>)<span class="question-mark">?</span>.<span class="ident">unwrap</span>();
-
- <span class="comment">// TODO: also download random blocks?</span>
- <span class="kw">if</span> <span class="ident">process</span>(<span class="kw-2">&</span><span class="ident">block_hash</span>, <span class="kw-2">&</span><span class="ident">BlockFilter</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="ident">filter</span>))<span class="question-mark">?</span> {
- <span class="ident">log</span>::<span class="macro">debug</span><span class="macro">!</span>(<span class="string">"Downloading block {}"</span>, <span class="ident">block_hash</span>);
-
- <span class="kw">let</span> <span class="ident">block</span> <span class="op">=</span> <span class="ident">peer</span>
- .<span class="ident">get_block</span>(<span class="ident">block_hash</span>)<span class="question-mark">?</span>
- .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">MissingBlock</span>)<span class="question-mark">?</span>;
- <span class="self">self</span>.<span class="ident">headers_store</span>.<span class="ident">save_full_block</span>(<span class="kw-2">&</span><span class="ident">block</span>, <span class="ident">height</span>)<span class="question-mark">?</span>;
- }
- }
-
- <span class="ident">status</span> <span class="op">=</span> <span class="ident">BundleStatus</span>::<span class="ident">Processed</span> { <span class="ident">cf_filters</span> };
- }
- <span class="kw">if</span> <span class="kw">let</span> <span class="ident">BundleStatus</span>::<span class="ident">Processed</span> { <span class="ident">cf_filters</span> } <span class="op">=</span> <span class="ident">status</span> {
- <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"status: Processed"</span>);
-
- <span class="kw">if</span> <span class="ident">current_height</span> <span class="op">-</span> <span class="ident">stop_height</span> <span class="op">></span> <span class="number">1000</span> {
- <span class="ident">status</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">prune_filters</span>(<span class="ident">index</span>, <span class="ident">checkpoint</span>)<span class="question-mark">?</span>;
- } <span class="kw">else</span> {
- <span class="ident">status</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">cf_store</span>.<span class="ident">mark_as_tip</span>(<span class="ident">index</span>, <span class="ident">cf_filters</span>, <span class="ident">checkpoint</span>)<span class="question-mark">?</span>;
- }
-
- <span class="ident">completed_bundle</span>(<span class="ident">index</span>)<span class="question-mark">?</span>;
- }
- <span class="kw">if</span> <span class="kw">let</span> <span class="ident">BundleStatus</span>::<span class="ident">Pruned</span> <span class="op">=</span> <span class="ident">status</span> {
- <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"status: Pruned"</span>);
- }
- <span class="kw">if</span> <span class="kw">let</span> <span class="ident">BundleStatus</span>::<span class="ident">Tip</span> { .. } <span class="op">=</span> <span class="ident">status</span> {
- <span class="ident">log</span>::<span class="macro">trace</span><span class="macro">!</span>(<span class="string">"status: Tip"</span>);
- }
- }
-
- <span class="prelude-val">Ok</span>(())
- }
-}
-
-<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">sync_headers</span><span class="op"><</span><span class="ident">F</span><span class="op">></span>(
- <span class="ident">peer</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Peer</span><span class="op">></span>,
- <span class="ident">store</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Full</span><span class="op">></span><span class="op">></span>,
- <span class="ident">sync_fn</span>: <span class="ident">F</span>,
-) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">ChainStore</span><span class="op"><</span><span class="ident">Snapshot</span><span class="op">></span><span class="op">></span>, <span class="ident">CompactFiltersError</span><span class="op">></span>
-<span class="kw">where</span>
- <span class="ident">F</span>: <span class="ident">Fn</span>(<span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>,
-{
- <span class="kw">let</span> <span class="ident">locators</span> <span class="op">=</span> <span class="ident">store</span>.<span class="ident">get_locators</span>()<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">locators_vec</span> <span class="op">=</span> <span class="ident">locators</span>.<span class="ident">iter</span>().<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">hash</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">hash</span>).<span class="ident">cloned</span>().<span class="ident">collect</span>();
- <span class="kw">let</span> <span class="ident">locators_map</span>: <span class="ident">HashMap</span><span class="op"><</span><span class="kw">_</span>, <span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">locators</span>.<span class="ident">into_iter</span>().<span class="ident">collect</span>();
-
- <span class="ident">peer</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">GetHeaders</span>(<span class="ident">GetHeadersMessage</span>::<span class="ident">new</span>(
- <span class="ident">locators_vec</span>,
- <span class="ident">Default</span>::<span class="ident">default</span>(),
- )))<span class="question-mark">?</span>;
- <span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">snapshot</span>, <span class="kw-2">mut</span> <span class="ident">last_hash</span>) <span class="op">=</span> <span class="kw">if</span> <span class="kw">let</span> <span class="ident">NetworkMessage</span>::<span class="ident">Headers</span>(<span class="ident">headers</span>) <span class="op">=</span> <span class="ident">peer</span>
- .<span class="ident">recv</span>(<span class="string">"headers"</span>, <span class="prelude-val">Some</span>(<span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="ident">TIMEOUT_SECS</span>)))<span class="question-mark">?</span>
- .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">Timeout</span>)<span class="question-mark">?</span>
- {
- <span class="kw">if</span> <span class="ident">headers</span>.<span class="ident">is_empty</span>() {
- <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>);
- }
-
- <span class="kw">match</span> <span class="ident">locators_map</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">headers</span>[<span class="number">0</span>].<span class="ident">prev_blockhash</span>) {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidHeaders</span>),
- <span class="prelude-val">Some</span>(<span class="ident">from</span>) <span class="op">=</span><span class="op">></span> (
- <span class="ident">store</span>.<span class="ident">start_snapshot</span>(<span class="kw-2">*</span><span class="ident">from</span>)<span class="question-mark">?</span>,
- <span class="ident">headers</span>[<span class="number">0</span>].<span class="ident">prev_blockhash</span>.<span class="ident">clone</span>(),
- ),
- }
- } <span class="kw">else</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>);
- };
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">sync_height</span> <span class="op">=</span> <span class="ident">store</span>.<span class="ident">get_height</span>()<span class="question-mark">?</span>;
- <span class="kw">while</span> <span class="ident">sync_height</span> <span class="op"><</span> <span class="ident">peer</span>.<span class="ident">get_version</span>().<span class="ident">start_height</span> <span class="kw">as</span> <span class="ident">usize</span> {
- <span class="ident">peer</span>.<span class="ident">send</span>(<span class="ident">NetworkMessage</span>::<span class="ident">GetHeaders</span>(<span class="ident">GetHeadersMessage</span>::<span class="ident">new</span>(
- <span class="macro">vec</span><span class="macro">!</span>[<span class="ident">last_hash</span>],
- <span class="ident">Default</span>::<span class="ident">default</span>(),
- )))<span class="question-mark">?</span>;
- <span class="kw">if</span> <span class="kw">let</span> <span class="ident">NetworkMessage</span>::<span class="ident">Headers</span>(<span class="ident">headers</span>) <span class="op">=</span> <span class="ident">peer</span>
- .<span class="ident">recv</span>(<span class="string">"headers"</span>, <span class="prelude-val">Some</span>(<span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="ident">TIMEOUT_SECS</span>)))<span class="question-mark">?</span>
- .<span class="ident">ok_or</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">Timeout</span>)<span class="question-mark">?</span>
- {
- <span class="kw">let</span> <span class="ident">batch_len</span> <span class="op">=</span> <span class="ident">headers</span>.<span class="ident">len</span>();
- <span class="ident">last_hash</span> <span class="op">=</span> <span class="ident">snapshot</span>.<span class="ident">apply</span>(<span class="ident">sync_height</span>, <span class="ident">headers</span>)<span class="question-mark">?</span>;
-
- <span class="ident">sync_height</span> <span class="op">+</span><span class="op">=</span> <span class="ident">batch_len</span>;
- <span class="ident">sync_fn</span>(<span class="ident">sync_height</span>)<span class="question-mark">?</span>;
- } <span class="kw">else</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CompactFiltersError</span>::<span class="ident">InvalidResponse</span>);
- }
- }
-
- <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">snapshot</span>))
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "magical";</script><script src="../../../../main.js"></script><script src="../../../../source-script.js"></script><script src="../../../../source-files.js"></script><script defer src="../../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/blockchain/electrum.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>electrum.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="doccomment">//! Electrum</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! This module defines an [`OnlineBlockchain`] struct that wraps an [`electrum_client::Client`]</span>
-<span class="doccomment">//! and implements the logic required to populate the wallet's [database](crate::database::Database) by</span>
-<span class="doccomment">//! querying the inner client.</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ## Example</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ```no_run</span>
-<span class="doccomment">//! # use magical::blockchain::electrum::ElectrumBlockchain;</span>
-<span class="doccomment">//! let client = electrum_client::Client::new("ssl://electrum.blockstream.info:50002", None)?;</span>
-<span class="doccomment">//! let blockchain = ElectrumBlockchain::from(client);</span>
-<span class="doccomment">//! # Ok::<(), magical::Error>(())</span>
-<span class="doccomment">//! ```</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashSet</span>;
-
-<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_imports</span>)]</span>
-<span class="kw">use</span> <span class="ident">log</span>::{<span class="ident">debug</span>, <span class="ident">error</span>, <span class="ident">info</span>, <span class="ident">trace</span>};
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Script</span>, <span class="ident">Transaction</span>, <span class="ident">Txid</span>};
-
-<span class="kw">use</span> <span class="ident">electrum_client</span>::{<span class="ident">Client</span>, <span class="ident">ElectrumApi</span>};
-
-<span class="kw">use</span> <span class="self">self</span>::<span class="ident">utils</span>::{<span class="ident">ELSGetHistoryRes</span>, <span class="ident">ELSListUnspentRes</span>, <span class="ident">ElectrumLikeSync</span>};
-<span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">BatchDatabase</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">FeeRate</span>;
-
-<span class="doccomment">/// Wrapper over an Electrum Client that implements the required blockchain traits</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// ## Example</span>
-<span class="doccomment">/// See the [`blockchain::electrum`](crate::blockchain::electrum) module for a usage example.</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">ElectrumBlockchain</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Client</span><span class="op">></span>);
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"test-electrum"</span>)]</span>
-<span class="attribute">#[<span class="ident">magical_blockchain_tests</span>(<span class="kw">crate</span>)]</span>
-<span class="kw">fn</span> <span class="ident">local_electrs</span>() <span class="op">-</span><span class="op">></span> <span class="ident">ElectrumBlockchain</span> {
- <span class="ident">ElectrumBlockchain</span>::<span class="ident">from</span>(<span class="ident">Client</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="ident">testutils</span>::<span class="ident">get_electrum_url</span>(), <span class="prelude-val">None</span>).<span class="ident">unwrap</span>())
-}
-
-<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">convert</span>::<span class="ident">From</span><span class="op"><</span><span class="ident">Client</span><span class="op">></span> <span class="kw">for</span> <span class="ident">ElectrumBlockchain</span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">client</span>: <span class="ident">Client</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">ElectrumBlockchain</span>(<span class="prelude-val">Some</span>(<span class="ident">client</span>))
- }
-}
-
-<span class="kw">impl</span> <span class="ident">Blockchain</span> <span class="kw">for</span> <span class="ident">ElectrumBlockchain</span> {
- <span class="kw">fn</span> <span class="ident">offline</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">ElectrumBlockchain</span>(<span class="prelude-val">None</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">is_online</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="self">self</span>.<span class="number">0</span>.<span class="ident">is_some</span>()
- }
-}
-
-<span class="kw">impl</span> <span class="ident">OnlineBlockchain</span> <span class="kw">for</span> <span class="ident">ElectrumBlockchain</span> {
- <span class="kw">fn</span> <span class="ident">get_capabilities</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Capability</span><span class="op">></span> {
- <span class="macro">vec</span><span class="macro">!</span>[
- <span class="ident">Capability</span>::<span class="ident">FullHistory</span>,
- <span class="ident">Capability</span>::<span class="ident">GetAnyTx</span>,
- <span class="ident">Capability</span>::<span class="ident">AccurateFees</span>,
- ]
- .<span class="ident">into_iter</span>()
- .<span class="ident">collect</span>()
- }
-
- <span class="kw">fn</span> <span class="ident">setup</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span>, <span class="ident">P</span>: <span class="ident">Progress</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">stop_gap</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
- <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
- <span class="ident">progress_update</span>: <span class="ident">P</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="self">self</span>.<span class="number">0</span>
- .<span class="ident">as_ref</span>()
- .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">OfflineClient</span>)<span class="question-mark">?</span>
- .<span class="ident">electrum_like_setup</span>(<span class="ident">stop_gap</span>, <span class="ident">database</span>, <span class="ident">progress_update</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="self">self</span>
- .<span class="number">0</span>
- .<span class="ident">as_ref</span>()
- .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">OfflineClient</span>)<span class="question-mark">?</span>
- .<span class="ident">transaction_get</span>(<span class="ident">txid</span>)
- .<span class="ident">map</span>(<span class="prelude-ty">Option</span>::<span class="prelude-val">Some</span>)<span class="question-mark">?</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">broadcast</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="self">self</span>
- .<span class="number">0</span>
- .<span class="ident">as_ref</span>()
- .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">OfflineClient</span>)<span class="question-mark">?</span>
- .<span class="ident">transaction_broadcast</span>(<span class="ident">tx</span>)
- .<span class="ident">map</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> ())<span class="question-mark">?</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">get_height</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="comment">// TODO: unsubscribe when added to the client, or is there a better call to use here?</span>
-
- <span class="prelude-val">Ok</span>(<span class="self">self</span>
- .<span class="number">0</span>
- .<span class="ident">as_ref</span>()
- .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">OfflineClient</span>)<span class="question-mark">?</span>
- .<span class="ident">block_headers_subscribe</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">data</span><span class="op">|</span> <span class="ident">data</span>.<span class="ident">height</span> <span class="kw">as</span> <span class="ident">u32</span>)<span class="question-mark">?</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">estimate_fee</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">target</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">FeeRate</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="ident">FeeRate</span>::<span class="ident">from_btc_per_kvb</span>(
- <span class="self">self</span>.<span class="number">0</span>
- .<span class="ident">as_ref</span>()
- .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">OfflineClient</span>)<span class="question-mark">?</span>
- .<span class="ident">estimate_fee</span>(<span class="ident">target</span>)<span class="question-mark">?</span> <span class="kw">as</span> <span class="ident">f32</span>,
- ))
- }
-}
-
-<span class="kw">impl</span> <span class="ident">ElectrumLikeSync</span> <span class="kw">for</span> <span class="ident">Client</span> {
- <span class="kw">fn</span> <span class="ident">els_batch_script_get_history</span><span class="op"><</span><span class="lifetime">'s</span>, <span class="ident">I</span>: <span class="ident">IntoIterator</span><span class="op"><</span><span class="ident">Item</span> <span class="op">=</span> <span class="kw-2">&</span><span class="lifetime">'s</span> <span class="ident">Script</span><span class="op">></span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">scripts</span>: <span class="ident">I</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSGetHistoryRes</span><span class="op">></span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="self">self</span>.<span class="ident">batch_script_get_history</span>(<span class="ident">scripts</span>)
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">v</span><span class="op">|</span> {
- <span class="ident">v</span>.<span class="ident">into_iter</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">v</span><span class="op">|</span> {
- <span class="ident">v</span>.<span class="ident">into_iter</span>()
- .<span class="ident">map</span>(
- <span class="op">|</span><span class="ident">electrum_client</span>::<span class="ident">GetHistoryRes</span> {
- <span class="ident">height</span>, <span class="ident">tx_hash</span>, ..
- }<span class="op">|</span> <span class="ident">ELSGetHistoryRes</span> {
- <span class="ident">height</span>,
- <span class="ident">tx_hash</span>,
- },
- )
- .<span class="ident">collect</span>()
- })
- .<span class="ident">collect</span>()
- })
- .<span class="ident">map_err</span>(<span class="ident">Error</span>::<span class="ident">Electrum</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">els_batch_script_list_unspent</span><span class="op"><</span><span class="lifetime">'s</span>, <span class="ident">I</span>: <span class="ident">IntoIterator</span><span class="op"><</span><span class="ident">Item</span> <span class="op">=</span> <span class="kw-2">&</span><span class="lifetime">'s</span> <span class="ident">Script</span><span class="op">></span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">scripts</span>: <span class="ident">I</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSListUnspentRes</span><span class="op">></span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="self">self</span>.<span class="ident">batch_script_list_unspent</span>(<span class="ident">scripts</span>)
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">v</span><span class="op">|</span> {
- <span class="ident">v</span>.<span class="ident">into_iter</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">v</span><span class="op">|</span> {
- <span class="ident">v</span>.<span class="ident">into_iter</span>()
- .<span class="ident">map</span>(
- <span class="op">|</span><span class="ident">electrum_client</span>::<span class="ident">ListUnspentRes</span> {
- <span class="ident">height</span>,
- <span class="ident">tx_hash</span>,
- <span class="ident">tx_pos</span>,
- ..
- }<span class="op">|</span> <span class="ident">ELSListUnspentRes</span> {
- <span class="ident">height</span>,
- <span class="ident">tx_hash</span>,
- <span class="ident">tx_pos</span>,
- },
- )
- .<span class="ident">collect</span>()
- })
- .<span class="ident">collect</span>()
- })
- .<span class="ident">map_err</span>(<span class="ident">Error</span>::<span class="ident">Electrum</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">els_transaction_get</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Transaction</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="self">self</span>.<span class="ident">transaction_get</span>(<span class="ident">txid</span>).<span class="ident">map_err</span>(<span class="ident">Error</span>::<span class="ident">Electrum</span>)
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/blockchain/esplora.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>esplora.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-<span id="203">203</span>
-<span id="204">204</span>
-<span id="205">205</span>
-<span id="206">206</span>
-<span id="207">207</span>
-<span id="208">208</span>
-<span id="209">209</span>
-<span id="210">210</span>
-<span id="211">211</span>
-<span id="212">212</span>
-<span id="213">213</span>
-<span id="214">214</span>
-<span id="215">215</span>
-<span id="216">216</span>
-<span id="217">217</span>
-<span id="218">218</span>
-<span id="219">219</span>
-<span id="220">220</span>
-<span id="221">221</span>
-<span id="222">222</span>
-<span id="223">223</span>
-<span id="224">224</span>
-<span id="225">225</span>
-<span id="226">226</span>
-<span id="227">227</span>
-<span id="228">228</span>
-<span id="229">229</span>
-<span id="230">230</span>
-<span id="231">231</span>
-<span id="232">232</span>
-<span id="233">233</span>
-<span id="234">234</span>
-<span id="235">235</span>
-<span id="236">236</span>
-<span id="237">237</span>
-<span id="238">238</span>
-<span id="239">239</span>
-<span id="240">240</span>
-<span id="241">241</span>
-<span id="242">242</span>
-<span id="243">243</span>
-<span id="244">244</span>
-<span id="245">245</span>
-<span id="246">246</span>
-<span id="247">247</span>
-<span id="248">248</span>
-<span id="249">249</span>
-<span id="250">250</span>
-<span id="251">251</span>
-<span id="252">252</span>
-<span id="253">253</span>
-<span id="254">254</span>
-<span id="255">255</span>
-<span id="256">256</span>
-<span id="257">257</span>
-<span id="258">258</span>
-<span id="259">259</span>
-<span id="260">260</span>
-<span id="261">261</span>
-<span id="262">262</span>
-<span id="263">263</span>
-<span id="264">264</span>
-<span id="265">265</span>
-<span id="266">266</span>
-<span id="267">267</span>
-<span id="268">268</span>
-<span id="269">269</span>
-<span id="270">270</span>
-<span id="271">271</span>
-<span id="272">272</span>
-<span id="273">273</span>
-<span id="274">274</span>
-<span id="275">275</span>
-<span id="276">276</span>
-<span id="277">277</span>
-<span id="278">278</span>
-<span id="279">279</span>
-<span id="280">280</span>
-<span id="281">281</span>
-<span id="282">282</span>
-<span id="283">283</span>
-<span id="284">284</span>
-<span id="285">285</span>
-<span id="286">286</span>
-<span id="287">287</span>
-<span id="288">288</span>
-<span id="289">289</span>
-<span id="290">290</span>
-<span id="291">291</span>
-<span id="292">292</span>
-<span id="293">293</span>
-<span id="294">294</span>
-<span id="295">295</span>
-<span id="296">296</span>
-<span id="297">297</span>
-<span id="298">298</span>
-<span id="299">299</span>
-<span id="300">300</span>
-<span id="301">301</span>
-<span id="302">302</span>
-<span id="303">303</span>
-<span id="304">304</span>
-<span id="305">305</span>
-<span id="306">306</span>
-<span id="307">307</span>
-<span id="308">308</span>
-<span id="309">309</span>
-<span id="310">310</span>
-<span id="311">311</span>
-<span id="312">312</span>
-<span id="313">313</span>
-<span id="314">314</span>
-<span id="315">315</span>
-<span id="316">316</span>
-<span id="317">317</span>
-<span id="318">318</span>
-<span id="319">319</span>
-<span id="320">320</span>
-<span id="321">321</span>
-<span id="322">322</span>
-<span id="323">323</span>
-<span id="324">324</span>
-<span id="325">325</span>
-<span id="326">326</span>
-<span id="327">327</span>
-<span id="328">328</span>
-<span id="329">329</span>
-<span id="330">330</span>
-<span id="331">331</span>
-<span id="332">332</span>
-<span id="333">333</span>
-<span id="334">334</span>
-<span id="335">335</span>
-<span id="336">336</span>
-<span id="337">337</span>
-<span id="338">338</span>
-<span id="339">339</span>
-<span id="340">340</span>
-<span id="341">341</span>
-<span id="342">342</span>
-<span id="343">343</span>
-<span id="344">344</span>
-<span id="345">345</span>
-<span id="346">346</span>
-<span id="347">347</span>
-<span id="348">348</span>
-<span id="349">349</span>
-<span id="350">350</span>
-<span id="351">351</span>
-<span id="352">352</span>
-<span id="353">353</span>
-<span id="354">354</span>
-<span id="355">355</span>
-<span id="356">356</span>
-<span id="357">357</span>
-<span id="358">358</span>
-<span id="359">359</span>
-<span id="360">360</span>
-<span id="361">361</span>
-<span id="362">362</span>
-<span id="363">363</span>
-<span id="364">364</span>
-<span id="365">365</span>
-<span id="366">366</span>
-<span id="367">367</span>
-<span id="368">368</span>
-<span id="369">369</span>
-<span id="370">370</span>
-<span id="371">371</span>
-<span id="372">372</span>
-<span id="373">373</span>
-<span id="374">374</span>
-<span id="375">375</span>
-<span id="376">376</span>
-<span id="377">377</span>
-<span id="378">378</span>
-<span id="379">379</span>
-<span id="380">380</span>
-<span id="381">381</span>
-<span id="382">382</span>
-<span id="383">383</span>
-<span id="384">384</span>
-<span id="385">385</span>
-<span id="386">386</span>
-<span id="387">387</span>
-<span id="388">388</span>
-<span id="389">389</span>
-<span id="390">390</span>
-<span id="391">391</span>
-<span id="392">392</span>
-<span id="393">393</span>
-<span id="394">394</span>
-<span id="395">395</span>
-<span id="396">396</span>
-<span id="397">397</span>
-<span id="398">398</span>
-<span id="399">399</span>
-<span id="400">400</span>
-<span id="401">401</span>
-<span id="402">402</span>
-<span id="403">403</span>
-<span id="404">404</span>
-<span id="405">405</span>
-<span id="406">406</span>
-<span id="407">407</span>
-<span id="408">408</span>
-<span id="409">409</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="doccomment">//! Esplora</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! This module defines an [`OnlineBlockchain`] struct that can query an Esplora backend</span>
-<span class="doccomment">//! populate the wallet's [database](crate::database::Database) by</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ## Example</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ```no_run</span>
-<span class="doccomment">//! # use magical::blockchain::esplora::EsploraBlockchain;</span>
-<span class="doccomment">//! let blockchain = EsploraBlockchain::new("https://blockstream.info/testnet/api");</span>
-<span class="doccomment">//! # Ok::<(), magical::Error>(())</span>
-<span class="doccomment">//! ```</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::{<span class="ident">HashMap</span>, <span class="ident">HashSet</span>};
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
-
-<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">stream</span>::{<span class="self">self</span>, <span class="ident">StreamExt</span>, <span class="ident">TryStreamExt</span>};
-
-<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_imports</span>)]</span>
-<span class="kw">use</span> <span class="ident">log</span>::{<span class="ident">debug</span>, <span class="ident">error</span>, <span class="ident">info</span>, <span class="ident">trace</span>};
-
-<span class="kw">use</span> <span class="ident">serde</span>::<span class="ident">Deserialize</span>;
-
-<span class="kw">use</span> <span class="ident">reqwest</span>::{<span class="ident">Client</span>, <span class="ident">StatusCode</span>};
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::{<span class="ident">deserialize</span>, <span class="ident">serialize</span>};
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">ToHex</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::{<span class="ident">sha256</span>, <span class="ident">Hash</span>};
-<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Script</span>, <span class="ident">Transaction</span>, <span class="ident">Txid</span>};
-
-<span class="kw">use</span> <span class="self">self</span>::<span class="ident">utils</span>::{<span class="ident">ELSGetHistoryRes</span>, <span class="ident">ELSListUnspentRes</span>, <span class="ident">ElectrumLikeSync</span>};
-<span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">BatchDatabase</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">FeeRate</span>;
-
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">struct</span> <span class="ident">UrlClient</span> {
- <span class="ident">url</span>: <span class="ident">String</span>,
- <span class="comment">// We use the async client instead of the blocking one because it automatically uses `fetch`</span>
- <span class="comment">// when the target platform is wasm32.</span>
- <span class="ident">client</span>: <span class="ident">Client</span>,
-}
-
-<span class="doccomment">/// Structure that implements the logic to sync with Esplora</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// ## Example</span>
-<span class="doccomment">/// See the [`blockchain::esplora`](crate::blockchain::esplora) module for a usage example.</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">EsploraBlockchain</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">UrlClient</span><span class="op">></span>);
-
-<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">convert</span>::<span class="ident">From</span><span class="op"><</span><span class="ident">UrlClient</span><span class="op">></span> <span class="kw">for</span> <span class="ident">EsploraBlockchain</span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">url_client</span>: <span class="ident">UrlClient</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">EsploraBlockchain</span>(<span class="prelude-val">Some</span>(<span class="ident">url_client</span>))
- }
-}
-
-<span class="kw">impl</span> <span class="ident">EsploraBlockchain</span> {
- <span class="doccomment">/// Create a new instance of the client from a base URL</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">base_url</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">EsploraBlockchain</span>(<span class="prelude-val">Some</span>(<span class="ident">UrlClient</span> {
- <span class="ident">url</span>: <span class="ident">base_url</span>.<span class="ident">to_string</span>(),
- <span class="ident">client</span>: <span class="ident">Client</span>::<span class="ident">new</span>(),
- }))
- }
-}
-
-<span class="kw">impl</span> <span class="ident">Blockchain</span> <span class="kw">for</span> <span class="ident">EsploraBlockchain</span> {
- <span class="kw">fn</span> <span class="ident">offline</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">EsploraBlockchain</span>(<span class="prelude-val">None</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">is_online</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="self">self</span>.<span class="number">0</span>.<span class="ident">is_some</span>()
- }
-}
-
-<span class="attribute">#[<span class="ident">maybe_async</span>]</span>
-<span class="kw">impl</span> <span class="ident">OnlineBlockchain</span> <span class="kw">for</span> <span class="ident">EsploraBlockchain</span> {
- <span class="kw">fn</span> <span class="ident">get_capabilities</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Capability</span><span class="op">></span> {
- <span class="macro">vec</span><span class="macro">!</span>[
- <span class="ident">Capability</span>::<span class="ident">FullHistory</span>,
- <span class="ident">Capability</span>::<span class="ident">GetAnyTx</span>,
- <span class="ident">Capability</span>::<span class="ident">AccurateFees</span>,
- ]
- .<span class="ident">into_iter</span>()
- .<span class="ident">collect</span>()
- }
-
- <span class="kw">fn</span> <span class="ident">setup</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span>, <span class="ident">P</span>: <span class="ident">Progress</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">stop_gap</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
- <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
- <span class="ident">progress_update</span>: <span class="ident">P</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>
- .<span class="number">0</span>
- .<span class="ident">as_ref</span>()
- .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">OfflineClient</span>)<span class="question-mark">?</span>
- .<span class="ident">electrum_like_setup</span>(<span class="ident">stop_gap</span>, <span class="ident">database</span>, <span class="ident">progress_update</span>))
- }
-
- <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="macro">await_or_block</span><span class="macro">!</span>(<span class="self">self</span>
- .<span class="number">0</span>
- .<span class="ident">as_ref</span>()
- .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">OfflineClient</span>)<span class="question-mark">?</span>
- .<span class="ident">_get_tx</span>(<span class="ident">txid</span>))<span class="question-mark">?</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">broadcast</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="macro">await_or_block</span><span class="macro">!</span>(<span class="self">self</span>
- .<span class="number">0</span>
- .<span class="ident">as_ref</span>()
- .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">OfflineClient</span>)<span class="question-mark">?</span>
- .<span class="ident">_broadcast</span>(<span class="ident">tx</span>))<span class="question-mark">?</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">get_height</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="macro">await_or_block</span><span class="macro">!</span>(<span class="self">self</span>
- .<span class="number">0</span>
- .<span class="ident">as_ref</span>()
- .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">OfflineClient</span>)<span class="question-mark">?</span>
- .<span class="ident">_get_height</span>())<span class="question-mark">?</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">estimate_fee</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">target</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">FeeRate</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">estimates</span> <span class="op">=</span> <span class="macro">await_or_block</span><span class="macro">!</span>(<span class="self">self</span>
- .<span class="number">0</span>
- .<span class="ident">as_ref</span>()
- .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">OfflineClient</span>)<span class="question-mark">?</span>
- .<span class="ident">_get_fee_estimates</span>())<span class="question-mark">?</span>;
-
- <span class="kw">let</span> <span class="ident">fee_val</span> <span class="op">=</span> <span class="ident">estimates</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="ident">v</span>)<span class="op">|</span> <span class="prelude-val">Ok</span>::<span class="op"><</span><span class="kw">_</span>, <span class="ident">std</span>::<span class="ident">num</span>::<span class="ident">ParseIntError</span><span class="op">></span>((<span class="ident">k</span>.<span class="ident">parse</span>::<span class="op"><</span><span class="ident">usize</span><span class="op">></span>()<span class="question-mark">?</span>, <span class="ident">v</span>)))
- .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()
- .<span class="ident">map_err</span>(<span class="op">|</span><span class="ident">e</span><span class="op">|</span> <span class="ident">Error</span>::<span class="ident">Generic</span>(<span class="ident">e</span>.<span class="ident">to_string</span>()))<span class="question-mark">?</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">take_while</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">k</span> <span class="op"><</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">target</span>)
- .<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">v</span>)<span class="op">|</span> <span class="ident">v</span>)
- .<span class="ident">last</span>()
- .<span class="ident">unwrap_or</span>(<span class="number">1.0</span>);
-
- <span class="prelude-val">Ok</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="ident">fee_val</span> <span class="kw">as</span> <span class="ident">f32</span>))
- }
-}
-
-<span class="kw">impl</span> <span class="ident">UrlClient</span> {
- <span class="kw">fn</span> <span class="ident">script_to_scripthash</span>(<span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>) <span class="op">-</span><span class="op">></span> <span class="ident">String</span> {
- <span class="ident">sha256</span>::<span class="ident">Hash</span>::<span class="ident">hash</span>(<span class="ident">script</span>.<span class="ident">as_bytes</span>()).<span class="ident">into_inner</span>().<span class="ident">to_hex</span>()
- }
-
- <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">_get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">EsploraError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">resp</span> <span class="op">=</span> <span class="self">self</span>
- .<span class="ident">client</span>
- .<span class="ident">get</span>(<span class="kw-2">&</span><span class="macro">format</span><span class="macro">!</span>(<span class="string">"{}/tx/{}/raw"</span>, <span class="self">self</span>.<span class="ident">url</span>, <span class="ident">txid</span>))
- .<span class="ident">send</span>()
- .<span class="kw">await</span><span class="question-mark">?</span>;
-
- <span class="kw">if</span> <span class="kw">let</span> <span class="ident">StatusCode</span>::<span class="ident">NOT_FOUND</span> <span class="op">=</span> <span class="ident">resp</span>.<span class="ident">status</span>() {
- <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>);
- }
-
- <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">resp</span>.<span class="ident">error_for_status</span>()<span class="question-mark">?</span>.<span class="ident">bytes</span>().<span class="kw">await</span><span class="question-mark">?</span>)<span class="question-mark">?</span>))
- }
-
- <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">_broadcast</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">transaction</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">EsploraError</span><span class="op">></span> {
- <span class="self">self</span>.<span class="ident">client</span>
- .<span class="ident">post</span>(<span class="kw-2">&</span><span class="macro">format</span><span class="macro">!</span>(<span class="string">"{}/tx"</span>, <span class="self">self</span>.<span class="ident">url</span>))
- .<span class="ident">body</span>(<span class="ident">serialize</span>(<span class="ident">transaction</span>).<span class="ident">to_hex</span>())
- .<span class="ident">send</span>()
- .<span class="kw">await</span><span class="question-mark">?</span>
- .<span class="ident">error_for_status</span>()<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">_get_height</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">EsploraError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">req</span> <span class="op">=</span> <span class="self">self</span>
- .<span class="ident">client</span>
- .<span class="ident">get</span>(<span class="kw-2">&</span><span class="macro">format</span><span class="macro">!</span>(<span class="string">"{}/blocks/tip/height"</span>, <span class="self">self</span>.<span class="ident">url</span>))
- .<span class="ident">send</span>()
- .<span class="kw">await</span><span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">req</span>.<span class="ident">error_for_status</span>()<span class="question-mark">?</span>.<span class="ident">text</span>().<span class="kw">await</span><span class="question-mark">?</span>.<span class="ident">parse</span>()<span class="question-mark">?</span>)
- }
-
- <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">_script_get_history</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSGetHistoryRes</span><span class="op">></span>, <span class="ident">EsploraError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
- <span class="kw">let</span> <span class="ident">scripthash</span> <span class="op">=</span> <span class="self">Self</span>::<span class="ident">script_to_scripthash</span>(<span class="ident">script</span>);
-
- <span class="comment">// Add the unconfirmed transactions first</span>
- <span class="ident">result</span>.<span class="ident">extend</span>(
- <span class="self">self</span>.<span class="ident">client</span>
- .<span class="ident">get</span>(<span class="kw-2">&</span><span class="macro">format</span><span class="macro">!</span>(
- <span class="string">"{}/scripthash/{}/txs/mempool"</span>,
- <span class="self">self</span>.<span class="ident">url</span>, <span class="ident">scripthash</span>
- ))
- .<span class="ident">send</span>()
- .<span class="kw">await</span><span class="question-mark">?</span>
- .<span class="ident">error_for_status</span>()<span class="question-mark">?</span>
- .<span class="ident">json</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">EsploraGetHistory</span><span class="op">></span><span class="op">></span>()
- .<span class="kw">await</span><span class="question-mark">?</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">ELSGetHistoryRes</span> {
- <span class="ident">tx_hash</span>: <span class="ident">x</span>.<span class="ident">txid</span>,
- <span class="ident">height</span>: <span class="ident">x</span>.<span class="ident">status</span>.<span class="ident">block_height</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>) <span class="kw">as</span> <span class="ident">i32</span>,
- }),
- );
-
- <span class="macro">debug</span><span class="macro">!</span>(
- <span class="string">"Found {} mempool txs for {} - {:?}"</span>,
- <span class="ident">result</span>.<span class="ident">len</span>(),
- <span class="ident">scripthash</span>,
- <span class="ident">script</span>
- );
-
- <span class="comment">// Then go through all the pages of confirmed transactions</span>
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">last_txid</span> <span class="op">=</span> <span class="ident">String</span>::<span class="ident">new</span>();
- <span class="kw">loop</span> {
- <span class="kw">let</span> <span class="ident">response</span> <span class="op">=</span> <span class="self">self</span>
- .<span class="ident">client</span>
- .<span class="ident">get</span>(<span class="kw-2">&</span><span class="macro">format</span><span class="macro">!</span>(
- <span class="string">"{}/scripthash/{}/txs/chain/{}"</span>,
- <span class="self">self</span>.<span class="ident">url</span>, <span class="ident">scripthash</span>, <span class="ident">last_txid</span>
- ))
- .<span class="ident">send</span>()
- .<span class="kw">await</span><span class="question-mark">?</span>
- .<span class="ident">error_for_status</span>()<span class="question-mark">?</span>
- .<span class="ident">json</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">EsploraGetHistory</span><span class="op">></span><span class="op">></span>()
- .<span class="kw">await</span><span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">len</span> <span class="op">=</span> <span class="ident">response</span>.<span class="ident">len</span>();
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">elem</span>) <span class="op">=</span> <span class="ident">response</span>.<span class="ident">last</span>() {
- <span class="ident">last_txid</span> <span class="op">=</span> <span class="ident">elem</span>.<span class="ident">txid</span>.<span class="ident">to_hex</span>();
- }
-
- <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"... adding {} confirmed transactions"</span>, <span class="ident">len</span>);
-
- <span class="ident">result</span>.<span class="ident">extend</span>(<span class="ident">response</span>.<span class="ident">into_iter</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">ELSGetHistoryRes</span> {
- <span class="ident">tx_hash</span>: <span class="ident">x</span>.<span class="ident">txid</span>,
- <span class="ident">height</span>: <span class="ident">x</span>.<span class="ident">status</span>.<span class="ident">block_height</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>) <span class="kw">as</span> <span class="ident">i32</span>,
- }));
-
- <span class="kw">if</span> <span class="ident">len</span> <span class="op"><</span> <span class="number">25</span> {
- <span class="kw">break</span>;
- }
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">result</span>)
- }
-
- <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">_script_list_unspent</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSListUnspentRes</span><span class="op">></span>, <span class="ident">EsploraError</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="self">self</span>
- .<span class="ident">client</span>
- .<span class="ident">get</span>(<span class="kw-2">&</span><span class="macro">format</span><span class="macro">!</span>(
- <span class="string">"{}/scripthash/{}/utxo"</span>,
- <span class="self">self</span>.<span class="ident">url</span>,
- <span class="self">Self</span>::<span class="ident">script_to_scripthash</span>(<span class="ident">script</span>)
- ))
- .<span class="ident">send</span>()
- .<span class="kw">await</span><span class="question-mark">?</span>
- .<span class="ident">error_for_status</span>()<span class="question-mark">?</span>
- .<span class="ident">json</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">EsploraListUnspent</span><span class="op">></span><span class="op">></span>()
- .<span class="kw">await</span><span class="question-mark">?</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">ELSListUnspentRes</span> {
- <span class="ident">tx_hash</span>: <span class="ident">x</span>.<span class="ident">txid</span>,
- <span class="ident">height</span>: <span class="ident">x</span>.<span class="ident">status</span>.<span class="ident">block_height</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>),
- <span class="ident">tx_pos</span>: <span class="ident">x</span>.<span class="ident">vout</span>,
- })
- .<span class="ident">collect</span>())
- }
-
- <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">_get_fee_estimates</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">HashMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">f64</span><span class="op">></span>, <span class="ident">EsploraError</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="self">self</span>
- .<span class="ident">client</span>
- .<span class="ident">get</span>(<span class="kw-2">&</span><span class="macro">format</span><span class="macro">!</span>(<span class="string">"{}/fee-estimates"</span>, <span class="self">self</span>.<span class="ident">url</span>,))
- .<span class="ident">send</span>()
- .<span class="kw">await</span><span class="question-mark">?</span>
- .<span class="ident">error_for_status</span>()<span class="question-mark">?</span>
- .<span class="ident">json</span>::<span class="op"><</span><span class="ident">HashMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">f64</span><span class="op">></span><span class="op">></span>()
- .<span class="kw">await</span><span class="question-mark">?</span>)
- }
-}
-
-<span class="attribute">#[<span class="ident">maybe_async</span>]</span>
-<span class="kw">impl</span> <span class="ident">ElectrumLikeSync</span> <span class="kw">for</span> <span class="ident">UrlClient</span> {
- <span class="kw">fn</span> <span class="ident">els_batch_script_get_history</span><span class="op"><</span><span class="lifetime">'s</span>, <span class="ident">I</span>: <span class="ident">IntoIterator</span><span class="op"><</span><span class="ident">Item</span> <span class="op">=</span> <span class="kw-2">&</span><span class="lifetime">'s</span> <span class="ident">Script</span><span class="op">></span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">scripts</span>: <span class="ident">I</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSGetHistoryRes</span><span class="op">></span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">future</span> <span class="op">=</span> <span class="kw">async</span> {
- <span class="prelude-val">Ok</span>(<span class="ident">stream</span>::<span class="ident">iter</span>(<span class="ident">scripts</span>)
- .<span class="ident">then</span>(<span class="op">|</span><span class="ident">script</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">_script_get_history</span>(<span class="kw-2">&</span><span class="ident">script</span>))
- .<span class="ident">try_collect</span>()
- .<span class="kw">await</span><span class="question-mark">?</span>)
- };
-
- <span class="macro">await_or_block</span><span class="macro">!</span>(<span class="ident">future</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">els_batch_script_list_unspent</span><span class="op"><</span><span class="lifetime">'s</span>, <span class="ident">I</span>: <span class="ident">IntoIterator</span><span class="op"><</span><span class="ident">Item</span> <span class="op">=</span> <span class="kw-2">&</span><span class="lifetime">'s</span> <span class="ident">Script</span><span class="op">></span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">scripts</span>: <span class="ident">I</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSListUnspentRes</span><span class="op">></span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">future</span> <span class="op">=</span> <span class="kw">async</span> {
- <span class="prelude-val">Ok</span>(<span class="ident">stream</span>::<span class="ident">iter</span>(<span class="ident">scripts</span>)
- .<span class="ident">then</span>(<span class="op">|</span><span class="ident">script</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">_script_list_unspent</span>(<span class="kw-2">&</span><span class="ident">script</span>))
- .<span class="ident">try_collect</span>()
- .<span class="kw">await</span><span class="question-mark">?</span>)
- };
-
- <span class="macro">await_or_block</span><span class="macro">!</span>(<span class="ident">future</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">els_transaction_get</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Transaction</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="macro">await_or_block</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">_get_tx</span>(<span class="ident">txid</span>))<span class="question-mark">?</span>
- .<span class="ident">ok_or_else</span>(<span class="op">|</span><span class="op">|</span> <span class="ident">EsploraError</span>::<span class="ident">TransactionNotFound</span>(<span class="kw-2">*</span><span class="ident">txid</span>))<span class="question-mark">?</span>)
- }
-}
-
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Deserialize</span>)]</span>
-<span class="kw">struct</span> <span class="ident">EsploraGetHistoryStatus</span> {
- <span class="ident">block_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
-}
-
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Deserialize</span>)]</span>
-<span class="kw">struct</span> <span class="ident">EsploraGetHistory</span> {
- <span class="ident">txid</span>: <span class="ident">Txid</span>,
- <span class="ident">status</span>: <span class="ident">EsploraGetHistoryStatus</span>,
-}
-
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Deserialize</span>)]</span>
-<span class="kw">struct</span> <span class="ident">EsploraListUnspent</span> {
- <span class="ident">txid</span>: <span class="ident">Txid</span>,
- <span class="ident">vout</span>: <span class="ident">usize</span>,
- <span class="ident">status</span>: <span class="ident">EsploraGetHistoryStatus</span>,
-}
-
-<span class="doccomment">/// Errors that can happen during a sync with [`EsploraBlockchain`]</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">EsploraError</span> {
- <span class="doccomment">/// Error with the HTTP call</span>
- <span class="ident">Reqwest</span>(<span class="ident">reqwest</span>::<span class="ident">Error</span>),
- <span class="doccomment">/// Invalid number returned</span>
- <span class="ident">Parsing</span>(<span class="ident">std</span>::<span class="ident">num</span>::<span class="ident">ParseIntError</span>),
- <span class="doccomment">/// Invalid Bitcoin data returned</span>
- <span class="ident">BitcoinEncoding</span>(<span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span>),
-
- <span class="doccomment">/// Transaction not found</span>
- <span class="ident">TransactionNotFound</span>(<span class="ident">Txid</span>),
-}
-
-<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">EsploraError</span> {
- <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
- <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"{:?}"</span>, <span class="self">self</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span> <span class="kw">for</span> <span class="ident">EsploraError</span> {}
-
-<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">reqwest</span>::<span class="ident">Error</span><span class="op">></span> <span class="kw">for</span> <span class="ident">EsploraError</span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">other</span>: <span class="ident">reqwest</span>::<span class="ident">Error</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">EsploraError</span>::<span class="ident">Reqwest</span>(<span class="ident">other</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">std</span>::<span class="ident">num</span>::<span class="ident">ParseIntError</span><span class="op">></span> <span class="kw">for</span> <span class="ident">EsploraError</span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">other</span>: <span class="ident">std</span>::<span class="ident">num</span>::<span class="ident">ParseIntError</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">EsploraError</span>::<span class="ident">Parsing</span>(<span class="ident">other</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span><span class="op">></span> <span class="kw">for</span> <span class="ident">EsploraError</span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">other</span>: <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">EsploraError</span>::<span class="ident">BitcoinEncoding</span>(<span class="ident">other</span>)
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/blockchain/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-<span id="203">203</span>
-<span id="204">204</span>
-<span id="205">205</span>
-<span id="206">206</span>
-<span id="207">207</span>
-<span id="208">208</span>
-<span id="209">209</span>
-<span id="210">210</span>
-<span id="211">211</span>
-<span id="212">212</span>
-<span id="213">213</span>
-<span id="214">214</span>
-<span id="215">215</span>
-<span id="216">216</span>
-<span id="217">217</span>
-<span id="218">218</span>
-<span id="219">219</span>
-<span id="220">220</span>
-<span id="221">221</span>
-<span id="222">222</span>
-<span id="223">223</span>
-<span id="224">224</span>
-<span id="225">225</span>
-<span id="226">226</span>
-<span id="227">227</span>
-<span id="228">228</span>
-<span id="229">229</span>
-<span id="230">230</span>
-<span id="231">231</span>
-<span id="232">232</span>
-<span id="233">233</span>
-<span id="234">234</span>
-<span id="235">235</span>
-<span id="236">236</span>
-<span id="237">237</span>
-<span id="238">238</span>
-<span id="239">239</span>
-<span id="240">240</span>
-<span id="241">241</span>
-<span id="242">242</span>
-<span id="243">243</span>
-<span id="244">244</span>
-<span id="245">245</span>
-<span id="246">246</span>
-<span id="247">247</span>
-<span id="248">248</span>
-<span id="249">249</span>
-<span id="250">250</span>
-<span id="251">251</span>
-<span id="252">252</span>
-<span id="253">253</span>
-<span id="254">254</span>
-<span id="255">255</span>
-<span id="256">256</span>
-<span id="257">257</span>
-<span id="258">258</span>
-<span id="259">259</span>
-<span id="260">260</span>
-<span id="261">261</span>
-<span id="262">262</span>
-<span id="263">263</span>
-<span id="264">264</span>
-<span id="265">265</span>
-<span id="266">266</span>
-<span id="267">267</span>
-<span id="268">268</span>
-<span id="269">269</span>
-<span id="270">270</span>
-<span id="271">271</span>
-<span id="272">272</span>
-<span id="273">273</span>
-<span id="274">274</span>
-<span id="275">275</span>
-<span id="276">276</span>
-<span id="277">277</span>
-<span id="278">278</span>
-<span id="279">279</span>
-<span id="280">280</span>
-<span id="281">281</span>
-<span id="282">282</span>
-<span id="283">283</span>
-<span id="284">284</span>
-<span id="285">285</span>
-<span id="286">286</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="doccomment">//! Blockchain backends</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! This module provides the implementation of a few commonly-used backends like</span>
-<span class="doccomment">//! [Electrum](crate::blockchain::electrum), [Esplora](crate::blockchain::esplora) and</span>
-<span class="doccomment">//! [Compact Filters/Neutrino](crate::blockchain::compact_filters), along with two generalized</span>
-<span class="doccomment">//! traits [`Blockchain`] and [`OnlineBlockchain`] that can be implemented to build customized</span>
-<span class="doccomment">//! backends.</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! Types that only implement the [`Blockchain`] trait can be used as backends for [`Wallet`](crate::wallet::Wallet)s, but any</span>
-<span class="doccomment">//! action that requires interacting with the blockchain won't be available ([`Wallet::sync`](crate::wallet::Wallet::sync) and</span>
-<span class="doccomment">//! [`Wallet::broadcast`](crate::wallet::Wallet::broadcast)). This allows the creation of physically air-gapped wallets, that have no</span>
-<span class="doccomment">//! ability to contact the outside world. An example of an offline-only client is [`OfflineBlockchain`].</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! Types that also implement [`OnlineBlockchain`] will make the two aforementioned actions</span>
-<span class="doccomment">//! available.</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashSet</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ops</span>::<span class="ident">Deref</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">mpsc</span>::{<span class="ident">channel</span>, <span class="ident">Receiver</span>, <span class="ident">Sender</span>};
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>;
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Transaction</span>, <span class="ident">Txid</span>};
-
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">BatchDatabase</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">FeeRate</span>;
-
-<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">mod</span> <span class="ident">utils</span>;
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"electrum"</span>)]</span>
-<span class="attribute">#[<span class="ident">cfg_attr</span>(<span class="ident">docsrs</span>, <span class="ident">doc</span>(<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"electrum"</span>)))]</span>
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">electrum</span>;
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"electrum"</span>)]</span>
-<span class="kw">pub</span> <span class="kw">use</span> <span class="self">self</span>::<span class="ident">electrum</span>::<span class="ident">ElectrumBlockchain</span>;
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"esplora"</span>)]</span>
-<span class="attribute">#[<span class="ident">cfg_attr</span>(<span class="ident">docsrs</span>, <span class="ident">doc</span>(<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"esplora"</span>)))]</span>
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">esplora</span>;
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"esplora"</span>)]</span>
-<span class="kw">pub</span> <span class="kw">use</span> <span class="self">self</span>::<span class="ident">esplora</span>::<span class="ident">EsploraBlockchain</span>;
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"compact_filters"</span>)]</span>
-<span class="attribute">#[<span class="ident">cfg_attr</span>(<span class="ident">docsrs</span>, <span class="ident">doc</span>(<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"compact_filters"</span>)))]</span>
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">compact_filters</span>;
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"compact_filters"</span>)]</span>
-<span class="kw">pub</span> <span class="kw">use</span> <span class="self">self</span>::<span class="ident">compact_filters</span>::<span class="ident">CompactFiltersBlockchain</span>;
-
-<span class="doccomment">/// Capabilities that can be supported by an [`OnlineBlockchain`] backend</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">Copy</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>, <span class="ident">Hash</span>)]</span>
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">Capability</span> {
- <span class="doccomment">/// Can recover the full history of a wallet and not only the set of currently spendable UTXOs</span>
- <span class="ident">FullHistory</span>,
- <span class="doccomment">/// Can fetch any historical transaction given its txid</span>
- <span class="ident">GetAnyTx</span>,
- <span class="doccomment">/// Can compute accurate fees for the transactions found during sync</span>
- <span class="ident">AccurateFees</span>,
-}
-
-<span class="doccomment">/// Base trait for a blockchain backend</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// This trait is always required, even for "air-gapped" backends that don't actually make any</span>
-<span class="doccomment">/// external call. Clients that have the ability to make external calls must also implement `OnlineBlockchain`.</span>
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">Blockchain</span> {
- <span class="doccomment">/// Return whether or not the client has the ability to fullfill requests</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// This should always be `false` for offline-only types, and can be true for types that also</span>
- <span class="doccomment">/// implement [`OnlineBlockchain`], if they have the ability to fullfill requests.</span>
- <span class="kw">fn</span> <span class="ident">is_online</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span>;
-
- <span class="doccomment">/// Create a new instance of the client that is offline-only</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// For types that also implement [`OnlineBlockchain`], this means creating an instance that</span>
- <span class="doccomment">/// returns [`Error::OfflineClient`](crate::error::Error::OfflineClient) if any of the "online"</span>
- <span class="doccomment">/// methods are called.</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// This is generally implemented by wrapping the client in an [`Option`] that has [`Option::None`] value</span>
- <span class="doccomment">/// when created with this method, and is [`Option::Some`] if properly instantiated.</span>
- <span class="kw">fn</span> <span class="ident">offline</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span>;
-}
-
-<span class="doccomment">/// Type that only implements [`Blockchain`] and is always offline</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">OfflineBlockchain</span>;
-<span class="kw">impl</span> <span class="ident">Blockchain</span> <span class="kw">for</span> <span class="ident">OfflineBlockchain</span> {
- <span class="kw">fn</span> <span class="ident">offline</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">OfflineBlockchain</span>
- }
-
- <span class="kw">fn</span> <span class="ident">is_online</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="bool-val">false</span>
- }
-}
-
-<span class="doccomment">/// Trait that defines the actions that must be supported by an online [`Blockchain`]</span>
-<span class="attribute">#[<span class="ident">maybe_async</span>]</span>
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">OnlineBlockchain</span>: <span class="ident">Blockchain</span> {
- <span class="doccomment">/// Return the set of [`Capability`] supported by this backend</span>
- <span class="kw">fn</span> <span class="ident">get_capabilities</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Capability</span><span class="op">></span>;
-
- <span class="doccomment">/// Setup the backend and populate the internal database for the first time</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// This method is the equivalent of [`OnlineBlockchain::sync`], but it's guaranteed to only be</span>
- <span class="doccomment">/// called once, at the first [`Wallet::sync`](crate::wallet::Wallet::sync).</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// The rationale behind the distinction between `sync` and `setup` is that some custom backends</span>
- <span class="doccomment">/// might need to perform specific actions only the first time they are synced.</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// For types that do not have that distinction, only this method can be implemented, since</span>
- <span class="doccomment">/// [`OnlineBlockchain::sync`] defaults to calling this internally if not overridden.</span>
- <span class="kw">fn</span> <span class="ident">setup</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span>, <span class="ident">P</span>: <span class="lifetime">'static</span> <span class="op">+</span> <span class="ident">Progress</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">stop_gap</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
- <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
- <span class="ident">progress_update</span>: <span class="ident">P</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Populate the internal database with transactions and UTXOs</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// If not overridden, it defaults to calling [`OnlineBlockchain::setup`] internally.</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// This method should implement the logic required to iterate over the list of the wallet's</span>
- <span class="doccomment">/// script_pubkeys using [`Database::iter_script_pubkeys`] and look for relevant transactions</span>
- <span class="doccomment">/// in the blockchain to populate the database with [`BatchOperations::set_tx`] and</span>
- <span class="doccomment">/// [`BatchOperations::set_utxo`].</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// This method should also take care of removing UTXOs that are seen as spent in the</span>
- <span class="doccomment">/// blockchain, using [`BatchOperations::del_utxo`].</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// The `progress_update` object can be used to give the caller updates about the progress by using</span>
- <span class="doccomment">/// [`Progress::update`].</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// [`Database::iter_script_pubkeys`]: crate::database::Database::iter_script_pubkeys</span>
- <span class="doccomment">/// [`BatchOperations::set_tx`]: crate::database::BatchOperations::set_tx</span>
- <span class="doccomment">/// [`BatchOperations::set_utxo`]: crate::database::BatchOperations::set_utxo</span>
- <span class="doccomment">/// [`BatchOperations::del_utxo`]: crate::database::BatchOperations::del_utxo</span>
- <span class="kw">fn</span> <span class="ident">sync</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span>, <span class="ident">P</span>: <span class="lifetime">'static</span> <span class="op">+</span> <span class="ident">Progress</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">stop_gap</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
- <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
- <span class="ident">progress_update</span>: <span class="ident">P</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">setup</span>(<span class="ident">stop_gap</span>, <span class="ident">database</span>, <span class="ident">progress_update</span>))
- }
-
- <span class="doccomment">/// Fetch a transaction from the blockchain given its txid</span>
- <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Broadcast a transaction</span>
- <span class="kw">fn</span> <span class="ident">broadcast</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
-
- <span class="doccomment">/// Return the current height</span>
- <span class="kw">fn</span> <span class="ident">get_height</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Estimate the fee rate required to confirm a transaction in a given `target` of blocks</span>
- <span class="kw">fn</span> <span class="ident">estimate_fee</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">target</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">FeeRate</span>, <span class="ident">Error</span><span class="op">></span>;
-}
-
-<span class="doccomment">/// Data sent with a progress update over a [`channel`]</span>
-<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">ProgressData</span> <span class="op">=</span> (<span class="ident">f32</span>, <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>);
-
-<span class="doccomment">/// Trait for types that can receive and process progress updates during [`OnlineBlockchain::sync`] and</span>
-<span class="doccomment">/// [`OnlineBlockchain::setup`]</span>
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">Progress</span>: <span class="ident">Send</span> {
- <span class="doccomment">/// Send a new progress update</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// The `progress` value should be in the range 0.0 - 100.0, and the `message` value is an</span>
- <span class="doccomment">/// optional text message that can be displayed to the user.</span>
- <span class="kw">fn</span> <span class="ident">update</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">progress</span>: <span class="ident">f32</span>, <span class="ident">message</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
-}
-
-<span class="doccomment">/// Shortcut to create a [`channel`] (pair of [`Sender`] and [`Receiver`]) that can transport [`ProgressData`]</span>
-<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">progress</span>() <span class="op">-</span><span class="op">></span> (<span class="ident">Sender</span><span class="op"><</span><span class="ident">ProgressData</span><span class="op">></span>, <span class="ident">Receiver</span><span class="op"><</span><span class="ident">ProgressData</span><span class="op">></span>) {
- <span class="ident">channel</span>()
-}
-
-<span class="kw">impl</span> <span class="ident">Progress</span> <span class="kw">for</span> <span class="ident">Sender</span><span class="op"><</span><span class="ident">ProgressData</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">update</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">progress</span>: <span class="ident">f32</span>, <span class="ident">message</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">if</span> <span class="ident">progress</span> <span class="op"><</span> <span class="number">0.0</span> <span class="op">|</span><span class="op">|</span> <span class="ident">progress</span> <span class="op">></span> <span class="number">100.0</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">InvalidProgressValue</span>(<span class="ident">progress</span>));
- }
-
- <span class="self">self</span>.<span class="ident">send</span>((<span class="ident">progress</span>, <span class="ident">message</span>))
- .<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">Error</span>::<span class="ident">ProgressUpdateError</span>)
- }
-}
-
-<span class="doccomment">/// Type that implements [`Progress`] and drops every update received</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">NoopProgress</span>;
-
-<span class="doccomment">/// Create a new instance of [`NoopProgress`]</span>
-<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">noop_progress</span>() <span class="op">-</span><span class="op">></span> <span class="ident">NoopProgress</span> {
- <span class="ident">NoopProgress</span>
-}
-
-<span class="kw">impl</span> <span class="ident">Progress</span> <span class="kw">for</span> <span class="ident">NoopProgress</span> {
- <span class="kw">fn</span> <span class="ident">update</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">_progress</span>: <span class="ident">f32</span>, <span class="ident">_message</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(())
- }
-}
-
-<span class="doccomment">/// Type that implements [`Progress`] and logs at level `INFO` every update received</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">LogProgress</span>;
-
-<span class="doccomment">/// Create a nwe instance of [`LogProgress`]</span>
-<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">log_progress</span>() <span class="op">-</span><span class="op">></span> <span class="ident">LogProgress</span> {
- <span class="ident">LogProgress</span>
-}
-
-<span class="kw">impl</span> <span class="ident">Progress</span> <span class="kw">for</span> <span class="ident">LogProgress</span> {
- <span class="kw">fn</span> <span class="ident">update</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">progress</span>: <span class="ident">f32</span>, <span class="ident">message</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="ident">log</span>::<span class="macro">info</span><span class="macro">!</span>(<span class="string">"Sync {:.3}%: `{}`"</span>, <span class="ident">progress</span>, <span class="ident">message</span>.<span class="ident">unwrap_or</span>(<span class="string">""</span>.<span class="ident">into</span>()));
-
- <span class="prelude-val">Ok</span>(())
- }
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">Blockchain</span><span class="op">></span> <span class="ident">Blockchain</span> <span class="kw">for</span> <span class="ident">Arc</span><span class="op"><</span><span class="ident">T</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">is_online</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="self">self</span>.<span class="ident">deref</span>().<span class="ident">is_online</span>()
- }
-
- <span class="kw">fn</span> <span class="ident">offline</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">T</span>::<span class="ident">offline</span>())
- }
-}
-
-<span class="attribute">#[<span class="ident">maybe_async</span>]</span>
-<span class="kw">impl</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">OnlineBlockchain</span><span class="op">></span> <span class="ident">OnlineBlockchain</span> <span class="kw">for</span> <span class="ident">Arc</span><span class="op"><</span><span class="ident">T</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">get_capabilities</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Capability</span><span class="op">></span> {
- <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">deref</span>().<span class="ident">get_capabilities</span>())
- }
-
- <span class="kw">fn</span> <span class="ident">setup</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span>, <span class="ident">P</span>: <span class="lifetime">'static</span> <span class="op">+</span> <span class="ident">Progress</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">stop_gap</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
- <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
- <span class="ident">progress_update</span>: <span class="ident">P</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">deref</span>().<span class="ident">setup</span>(<span class="ident">stop_gap</span>, <span class="ident">database</span>, <span class="ident">progress_update</span>))
- }
-
- <span class="kw">fn</span> <span class="ident">sync</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span>, <span class="ident">P</span>: <span class="lifetime">'static</span> <span class="op">+</span> <span class="ident">Progress</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">stop_gap</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
- <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
- <span class="ident">progress_update</span>: <span class="ident">P</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">deref</span>().<span class="ident">sync</span>(<span class="ident">stop_gap</span>, <span class="ident">database</span>, <span class="ident">progress_update</span>))
- }
-
- <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">deref</span>().<span class="ident">get_tx</span>(<span class="ident">txid</span>))
- }
- <span class="kw">fn</span> <span class="ident">broadcast</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">deref</span>().<span class="ident">broadcast</span>(<span class="ident">tx</span>))
- }
-
- <span class="kw">fn</span> <span class="ident">get_height</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">deref</span>().<span class="ident">get_height</span>())
- }
- <span class="kw">fn</span> <span class="ident">estimate_fee</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">target</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">FeeRate</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">deref</span>().<span class="ident">estimate_fee</span>(<span class="ident">target</span>))
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/blockchain/utils.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>utils.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-<span id="203">203</span>
-<span id="204">204</span>
-<span id="205">205</span>
-<span id="206">206</span>
-<span id="207">207</span>
-<span id="208">208</span>
-<span id="209">209</span>
-<span id="210">210</span>
-<span id="211">211</span>
-<span id="212">212</span>
-<span id="213">213</span>
-<span id="214">214</span>
-<span id="215">215</span>
-<span id="216">216</span>
-<span id="217">217</span>
-<span id="218">218</span>
-<span id="219">219</span>
-<span id="220">220</span>
-<span id="221">221</span>
-<span id="222">222</span>
-<span id="223">223</span>
-<span id="224">224</span>
-<span id="225">225</span>
-<span id="226">226</span>
-<span id="227">227</span>
-<span id="228">228</span>
-<span id="229">229</span>
-<span id="230">230</span>
-<span id="231">231</span>
-<span id="232">232</span>
-<span id="233">233</span>
-<span id="234">234</span>
-<span id="235">235</span>
-<span id="236">236</span>
-<span id="237">237</span>
-<span id="238">238</span>
-<span id="239">239</span>
-<span id="240">240</span>
-<span id="241">241</span>
-<span id="242">242</span>
-<span id="243">243</span>
-<span id="244">244</span>
-<span id="245">245</span>
-<span id="246">246</span>
-<span id="247">247</span>
-<span id="248">248</span>
-<span id="249">249</span>
-<span id="250">250</span>
-<span id="251">251</span>
-<span id="252">252</span>
-<span id="253">253</span>
-<span id="254">254</span>
-<span id="255">255</span>
-<span id="256">256</span>
-<span id="257">257</span>
-<span id="258">258</span>
-<span id="259">259</span>
-<span id="260">260</span>
-<span id="261">261</span>
-<span id="262">262</span>
-<span id="263">263</span>
-<span id="264">264</span>
-<span id="265">265</span>
-<span id="266">266</span>
-<span id="267">267</span>
-<span id="268">268</span>
-<span id="269">269</span>
-<span id="270">270</span>
-<span id="271">271</span>
-<span id="272">272</span>
-<span id="273">273</span>
-<span id="274">274</span>
-<span id="275">275</span>
-<span id="276">276</span>
-<span id="277">277</span>
-<span id="278">278</span>
-<span id="279">279</span>
-<span id="280">280</span>
-<span id="281">281</span>
-<span id="282">282</span>
-<span id="283">283</span>
-<span id="284">284</span>
-<span id="285">285</span>
-<span id="286">286</span>
-<span id="287">287</span>
-<span id="288">288</span>
-<span id="289">289</span>
-<span id="290">290</span>
-<span id="291">291</span>
-<span id="292">292</span>
-<span id="293">293</span>
-<span id="294">294</span>
-<span id="295">295</span>
-<span id="296">296</span>
-<span id="297">297</span>
-<span id="298">298</span>
-<span id="299">299</span>
-<span id="300">300</span>
-<span id="301">301</span>
-<span id="302">302</span>
-<span id="303">303</span>
-<span id="304">304</span>
-<span id="305">305</span>
-<span id="306">306</span>
-<span id="307">307</span>
-<span id="308">308</span>
-<span id="309">309</span>
-<span id="310">310</span>
-<span id="311">311</span>
-<span id="312">312</span>
-<span id="313">313</span>
-<span id="314">314</span>
-<span id="315">315</span>
-<span id="316">316</span>
-<span id="317">317</span>
-<span id="318">318</span>
-<span id="319">319</span>
-<span id="320">320</span>
-<span id="321">321</span>
-<span id="322">322</span>
-<span id="323">323</span>
-<span id="324">324</span>
-<span id="325">325</span>
-<span id="326">326</span>
-<span id="327">327</span>
-<span id="328">328</span>
-<span id="329">329</span>
-<span id="330">330</span>
-<span id="331">331</span>
-<span id="332">332</span>
-<span id="333">333</span>
-<span id="334">334</span>
-<span id="335">335</span>
-<span id="336">336</span>
-<span id="337">337</span>
-<span id="338">338</span>
-<span id="339">339</span>
-<span id="340">340</span>
-<span id="341">341</span>
-<span id="342">342</span>
-<span id="343">343</span>
-<span id="344">344</span>
-<span id="345">345</span>
-<span id="346">346</span>
-<span id="347">347</span>
-<span id="348">348</span>
-<span id="349">349</span>
-<span id="350">350</span>
-<span id="351">351</span>
-<span id="352">352</span>
-<span id="353">353</span>
-<span id="354">354</span>
-<span id="355">355</span>
-<span id="356">356</span>
-<span id="357">357</span>
-<span id="358">358</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">cmp</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::{<span class="ident">HashSet</span>, <span class="ident">VecDeque</span>};
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">convert</span>::<span class="ident">TryFrom</span>;
-
-<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_imports</span>)]</span>
-<span class="kw">use</span> <span class="ident">log</span>::{<span class="ident">debug</span>, <span class="ident">error</span>, <span class="ident">info</span>, <span class="ident">trace</span>};
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Address</span>, <span class="ident">Network</span>, <span class="ident">OutPoint</span>, <span class="ident">Script</span>, <span class="ident">Transaction</span>, <span class="ident">Txid</span>};
-
-<span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::{<span class="ident">BatchDatabase</span>, <span class="ident">BatchOperations</span>, <span class="ident">DatabaseUtils</span>};
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::{<span class="ident">ScriptType</span>, <span class="ident">TransactionDetails</span>, <span class="ident">UTXO</span>};
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">utils</span>::<span class="ident">ChunksIterator</span>;
-
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">ELSGetHistoryRes</span> {
- <span class="kw">pub</span> <span class="ident">height</span>: <span class="ident">i32</span>,
- <span class="kw">pub</span> <span class="ident">tx_hash</span>: <span class="ident">Txid</span>,
-}
-
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">ELSListUnspentRes</span> {
- <span class="kw">pub</span> <span class="ident">height</span>: <span class="ident">usize</span>,
- <span class="kw">pub</span> <span class="ident">tx_hash</span>: <span class="ident">Txid</span>,
- <span class="kw">pub</span> <span class="ident">tx_pos</span>: <span class="ident">usize</span>,
-}
-
-<span class="doccomment">/// Implements the synchronization logic for an Electrum-like client.</span>
-<span class="attribute">#[<span class="ident">maybe_async</span>]</span>
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">ElectrumLikeSync</span> {
- <span class="kw">fn</span> <span class="ident">els_batch_script_get_history</span><span class="op"><</span><span class="lifetime">'s</span>, <span class="ident">I</span>: <span class="ident">IntoIterator</span><span class="op"><</span><span class="ident">Item</span> <span class="op">=</span> <span class="kw-2">&</span><span class="lifetime">'s</span> <span class="ident">Script</span><span class="op">></span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">scripts</span>: <span class="ident">I</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSGetHistoryRes</span><span class="op">></span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
-
- <span class="kw">fn</span> <span class="ident">els_batch_script_list_unspent</span><span class="op"><</span><span class="lifetime">'s</span>, <span class="ident">I</span>: <span class="ident">IntoIterator</span><span class="op"><</span><span class="ident">Item</span> <span class="op">=</span> <span class="kw-2">&</span><span class="lifetime">'s</span> <span class="ident">Script</span><span class="op">></span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">scripts</span>: <span class="ident">I</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSListUnspentRes</span><span class="op">></span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
-
- <span class="kw">fn</span> <span class="ident">els_transaction_get</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Transaction</span>, <span class="ident">Error</span><span class="op">></span>;
-
- <span class="comment">// Provided methods down here...</span>
-
- <span class="kw">fn</span> <span class="ident">electrum_like_setup</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span>, <span class="ident">P</span>: <span class="ident">Progress</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">stop_gap</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
- <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
- <span class="ident">_progress_update</span>: <span class="ident">P</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="comment">// TODO: progress</span>
-
- <span class="kw">let</span> <span class="ident">stop_gap</span> <span class="op">=</span> <span class="ident">stop_gap</span>.<span class="ident">unwrap_or</span>(<span class="number">20</span>);
- <span class="kw">let</span> <span class="ident">batch_query_size</span> <span class="op">=</span> <span class="number">20</span>;
-
- <span class="comment">// check unconfirmed tx, delete so they are retrieved later</span>
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">del_batch</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">begin_batch</span>();
- <span class="kw">for</span> <span class="ident">tx</span> <span class="kw">in</span> <span class="ident">database</span>.<span class="ident">iter_txs</span>(<span class="bool-val">false</span>)<span class="question-mark">?</span> {
- <span class="kw">if</span> <span class="ident">tx</span>.<span class="ident">height</span>.<span class="ident">is_none</span>() {
- <span class="ident">del_batch</span>.<span class="ident">del_tx</span>(<span class="kw-2">&</span><span class="ident">tx</span>.<span class="ident">txid</span>, <span class="bool-val">false</span>)<span class="question-mark">?</span>;
- }
- }
- <span class="ident">database</span>.<span class="ident">commit_batch</span>(<span class="ident">del_batch</span>)<span class="question-mark">?</span>;
-
- <span class="comment">// maximum derivation index for a change address that we've seen during sync</span>
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">change_max_deriv</span> <span class="op">=</span> <span class="prelude-val">None</span>;
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">already_checked</span>: <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span> <span class="op">=</span> <span class="ident">HashSet</span>::<span class="ident">new</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">to_check_later</span> <span class="op">=</span> <span class="ident">VecDeque</span>::<span class="ident">with_capacity</span>(<span class="ident">batch_query_size</span>);
-
- <span class="comment">// insert the first chunk</span>
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iter_scriptpubkeys</span> <span class="op">=</span> <span class="ident">database</span>
- .<span class="ident">iter_script_pubkeys</span>(<span class="prelude-val">Some</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>))<span class="question-mark">?</span>
- .<span class="ident">into_iter</span>();
- <span class="kw">let</span> <span class="ident">chunk</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span> <span class="op">=</span> <span class="ident">iter_scriptpubkeys</span>.<span class="ident">by_ref</span>().<span class="ident">take</span>(<span class="ident">batch_query_size</span>).<span class="ident">collect</span>();
- <span class="kw">for</span> <span class="ident">item</span> <span class="kw">in</span> <span class="ident">chunk</span>.<span class="ident">into_iter</span>().<span class="ident">rev</span>() {
- <span class="ident">to_check_later</span>.<span class="ident">push_front</span>(<span class="ident">item</span>);
- }
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iterating_external</span> <span class="op">=</span> <span class="bool-val">true</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">index</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">last_found</span> <span class="op">=</span> <span class="prelude-val">None</span>;
- <span class="kw">while</span> <span class="op">!</span><span class="ident">to_check_later</span>.<span class="ident">is_empty</span>() {
- <span class="macro">trace</span><span class="macro">!</span>(<span class="string">"to_check_later size {}"</span>, <span class="ident">to_check_later</span>.<span class="ident">len</span>());
-
- <span class="kw">let</span> <span class="ident">until</span> <span class="op">=</span> <span class="ident">cmp</span>::<span class="ident">min</span>(<span class="ident">to_check_later</span>.<span class="ident">len</span>(), <span class="ident">batch_query_size</span>);
- <span class="kw">let</span> <span class="ident">chunk</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span> <span class="op">=</span> <span class="ident">to_check_later</span>.<span class="ident">drain</span>(..<span class="ident">until</span>).<span class="ident">collect</span>();
- <span class="kw">let</span> <span class="ident">call_result</span> <span class="op">=</span> <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">els_batch_script_get_history</span>(<span class="ident">chunk</span>.<span class="ident">iter</span>()))<span class="question-mark">?</span>;
-
- <span class="kw">for</span> (<span class="ident">script</span>, <span class="ident">history</span>) <span class="kw">in</span> <span class="ident">chunk</span>.<span class="ident">into_iter</span>().<span class="ident">zip</span>(<span class="ident">call_result</span>.<span class="ident">into_iter</span>()) {
- <span class="macro">trace</span><span class="macro">!</span>(<span class="string">"received history for {:?}, size {}"</span>, <span class="ident">script</span>, <span class="ident">history</span>.<span class="ident">len</span>());
-
- <span class="kw">if</span> <span class="op">!</span><span class="ident">history</span>.<span class="ident">is_empty</span>() {
- <span class="ident">last_found</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">index</span>);
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">check_later_scripts</span> <span class="op">=</span> <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">check_history</span>(
- <span class="ident">database</span>,
- <span class="ident">script</span>,
- <span class="ident">history</span>,
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">change_max_deriv</span>
- ))<span class="question-mark">?</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">filter</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">already_checked</span>.<span class="ident">insert</span>(<span class="ident">x</span>.<span class="ident">clone</span>()))
- .<span class="ident">collect</span>();
- <span class="ident">to_check_later</span>.<span class="ident">append</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">check_later_scripts</span>);
- }
-
- <span class="ident">index</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
- }
-
- <span class="kw">match</span> <span class="ident">iterating_external</span> {
- <span class="bool-val">true</span> <span class="kw">if</span> <span class="ident">index</span> <span class="op">-</span> <span class="ident">last_found</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>) <span class="op">></span><span class="op">=</span> <span class="ident">stop_gap</span> <span class="op">=</span><span class="op">></span> <span class="ident">iterating_external</span> <span class="op">=</span> <span class="bool-val">false</span>,
- <span class="bool-val">true</span> <span class="op">=</span><span class="op">></span> {
- <span class="macro">trace</span><span class="macro">!</span>(<span class="string">"pushing one more batch from `iter_scriptpubkeys`. index = {}, last_found = {:?}, stop_gap = {}"</span>, <span class="ident">index</span>, <span class="ident">last_found</span>, <span class="ident">stop_gap</span>);
-
- <span class="kw">let</span> <span class="ident">chunk</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span> <span class="op">=</span>
- <span class="ident">iter_scriptpubkeys</span>.<span class="ident">by_ref</span>().<span class="ident">take</span>(<span class="ident">batch_query_size</span>).<span class="ident">collect</span>();
- <span class="kw">for</span> <span class="ident">item</span> <span class="kw">in</span> <span class="ident">chunk</span>.<span class="ident">into_iter</span>().<span class="ident">rev</span>() {
- <span class="ident">to_check_later</span>.<span class="ident">push_front</span>(<span class="ident">item</span>);
- }
- }
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> {}
- }
- }
-
- <span class="comment">// check utxo</span>
- <span class="comment">// TODO: try to minimize network requests and re-use scripts if possible</span>
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">begin_batch</span>();
- <span class="kw">for</span> <span class="ident">chunk</span> <span class="kw">in</span> <span class="ident">ChunksIterator</span>::<span class="ident">new</span>(<span class="ident">database</span>.<span class="ident">iter_utxos</span>()<span class="question-mark">?</span>.<span class="ident">into_iter</span>(), <span class="ident">batch_query_size</span>) {
- <span class="kw">let</span> <span class="ident">scripts</span>: <span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">chunk</span>.<span class="ident">iter</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="kw-2">&</span><span class="ident">u</span>.<span class="ident">txout</span>.<span class="ident">script_pubkey</span>).<span class="ident">collect</span>();
- <span class="kw">let</span> <span class="ident">call_result</span> <span class="op">=</span> <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">els_batch_script_list_unspent</span>(<span class="ident">scripts</span>))<span class="question-mark">?</span>;
-
- <span class="comment">// check which utxos are actually still unspent</span>
- <span class="kw">for</span> (<span class="ident">utxo</span>, <span class="ident">list_unspent</span>) <span class="kw">in</span> <span class="ident">chunk</span>.<span class="ident">into_iter</span>().<span class="ident">zip</span>(<span class="ident">call_result</span>.<span class="ident">iter</span>()) {
- <span class="macro">debug</span><span class="macro">!</span>(
- <span class="string">"outpoint {:?} is unspent for me, list unspent is {:?}"</span>,
- <span class="ident">utxo</span>.<span class="ident">outpoint</span>, <span class="ident">list_unspent</span>
- );
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">spent</span> <span class="op">=</span> <span class="bool-val">true</span>;
- <span class="kw">for</span> <span class="ident">unspent</span> <span class="kw">in</span> <span class="ident">list_unspent</span> {
- <span class="kw">let</span> <span class="ident">res_outpoint</span> <span class="op">=</span> <span class="ident">OutPoint</span>::<span class="ident">new</span>(<span class="ident">unspent</span>.<span class="ident">tx_hash</span>, <span class="ident">unspent</span>.<span class="ident">tx_pos</span> <span class="kw">as</span> <span class="ident">u32</span>);
- <span class="kw">if</span> <span class="ident">utxo</span>.<span class="ident">outpoint</span> <span class="op">=</span><span class="op">=</span> <span class="ident">res_outpoint</span> {
- <span class="ident">spent</span> <span class="op">=</span> <span class="bool-val">false</span>;
- <span class="kw">break</span>;
- }
- }
- <span class="kw">if</span> <span class="ident">spent</span> {
- <span class="macro">info</span><span class="macro">!</span>(<span class="string">"{} not anymore unspent, removing"</span>, <span class="ident">utxo</span>.<span class="ident">outpoint</span>);
- <span class="ident">batch</span>.<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">utxo</span>.<span class="ident">outpoint</span>)<span class="question-mark">?</span>;
- }
- }
- }
-
- <span class="kw">let</span> <span class="ident">current_ext</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">get_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>)<span class="question-mark">?</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>);
- <span class="kw">let</span> <span class="ident">first_ext_new</span> <span class="op">=</span> <span class="ident">last_found</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">+</span> <span class="number">1</span>).<span class="ident">unwrap_or</span>(<span class="number">0</span>) <span class="kw">as</span> <span class="ident">u32</span>;
- <span class="kw">if</span> <span class="ident">first_ext_new</span> <span class="op">></span> <span class="ident">current_ext</span> {
- <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Setting external index to {}"</span>, <span class="ident">first_ext_new</span>);
- <span class="ident">database</span>.<span class="ident">set_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="ident">first_ext_new</span>)<span class="question-mark">?</span>;
- }
-
- <span class="kw">let</span> <span class="ident">current_int</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">get_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>)<span class="question-mark">?</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>);
- <span class="kw">let</span> <span class="ident">first_int_new</span> <span class="op">=</span> <span class="ident">change_max_deriv</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">+</span> <span class="number">1</span>).<span class="ident">unwrap_or</span>(<span class="number">0</span>);
- <span class="kw">if</span> <span class="ident">first_int_new</span> <span class="op">></span> <span class="ident">current_int</span> {
- <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Setting internal index to {}"</span>, <span class="ident">first_int_new</span>);
- <span class="ident">database</span>.<span class="ident">set_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>, <span class="ident">first_int_new</span>)<span class="question-mark">?</span>;
- }
-
- <span class="ident">database</span>.<span class="ident">commit_batch</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">fn</span> <span class="ident">check_tx_and_descendant</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
- <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>,
- <span class="ident">height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
- <span class="ident">cur_script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
- <span class="ident">change_max_deriv</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="macro">debug</span><span class="macro">!</span>(
- <span class="string">"check_tx_and_descendant of {}, height: {:?}, script: {}"</span>,
- <span class="ident">txid</span>, <span class="ident">height</span>, <span class="ident">cur_script</span>
- );
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">updates</span> <span class="op">=</span> <span class="ident">database</span>.<span class="ident">begin_batch</span>();
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">database</span>.<span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="ident">txid</span>, <span class="bool-val">true</span>)<span class="question-mark">?</span> {
- <span class="prelude-val">Some</span>(<span class="kw-2">mut</span> <span class="ident">saved_tx</span>) <span class="op">=</span><span class="op">></span> {
- <span class="comment">// update the height if it's different (in case of reorg)</span>
- <span class="kw">if</span> <span class="ident">saved_tx</span>.<span class="ident">height</span> <span class="op">!</span><span class="op">=</span> <span class="ident">height</span> {
- <span class="macro">info</span><span class="macro">!</span>(
- <span class="string">"updating height from {:?} to {:?} for tx {}"</span>,
- <span class="ident">saved_tx</span>.<span class="ident">height</span>, <span class="ident">height</span>, <span class="ident">txid</span>
- );
- <span class="ident">saved_tx</span>.<span class="ident">height</span> <span class="op">=</span> <span class="ident">height</span>;
- <span class="ident">updates</span>.<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">saved_tx</span>)<span class="question-mark">?</span>;
- }
-
- <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"already have {} in db, returning the cached version"</span>, <span class="ident">txid</span>);
-
- <span class="comment">// unwrap since we explicitly ask for the raw_tx, if it's not present something</span>
- <span class="comment">// went wrong</span>
- <span class="ident">saved_tx</span>.<span class="ident">transaction</span>.<span class="ident">unwrap</span>()
- }
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">fetched_tx</span> <span class="op">=</span> <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">els_transaction_get</span>(<span class="kw-2">&</span><span class="ident">txid</span>))<span class="question-mark">?</span>;
- <span class="ident">database</span>.<span class="ident">set_raw_tx</span>(<span class="kw-2">&</span><span class="ident">fetched_tx</span>)<span class="question-mark">?</span>;
-
- <span class="ident">fetched_tx</span>
- }
- };
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">incoming</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">outgoing</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">inputs_sum</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">outputs_sum</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
-
- <span class="comment">// look for our own inputs</span>
- <span class="kw">for</span> (<span class="ident">i</span>, <span class="ident">input</span>) <span class="kw">in</span> <span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
- <span class="comment">// the fact that we visit addresses in a BFS fashion starting from the external addresses</span>
- <span class="comment">// should ensure that this query is always consistent (i.e. when we get to call this all</span>
- <span class="comment">// the transactions at a lower depth have already been indexed, so if an outpoint is ours</span>
- <span class="comment">// we are guaranteed to have it in the db).</span>
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">previous_output</span>) <span class="op">=</span> <span class="ident">database</span>.<span class="ident">get_previous_output</span>(<span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">previous_output</span>)<span class="question-mark">?</span> {
- <span class="ident">inputs_sum</span> <span class="op">+</span><span class="op">=</span> <span class="ident">previous_output</span>.<span class="ident">value</span>;
-
- <span class="kw">if</span> <span class="ident">database</span>.<span class="ident">is_mine</span>(<span class="kw-2">&</span><span class="ident">previous_output</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span> {
- <span class="ident">outgoing</span> <span class="op">+</span><span class="op">=</span> <span class="ident">previous_output</span>.<span class="ident">value</span>;
-
- <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"{} input #{} is mine, removing from utxo"</span>, <span class="ident">txid</span>, <span class="ident">i</span>);
- <span class="ident">updates</span>.<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">previous_output</span>)<span class="question-mark">?</span>;
- }
- } <span class="kw">else</span> {
- <span class="comment">// The input is not ours, but we still need to count it for the fees. so fetch the</span>
- <span class="comment">// tx (from the database or from network) and check it</span>
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">database</span>.<span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">previous_output</span>.<span class="ident">txid</span>, <span class="bool-val">true</span>)<span class="question-mark">?</span> {
- <span class="prelude-val">Some</span>(<span class="ident">saved_tx</span>) <span class="op">=</span><span class="op">></span> <span class="ident">saved_tx</span>.<span class="ident">transaction</span>.<span class="ident">unwrap</span>(),
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">fetched_tx</span> <span class="op">=</span>
- <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">els_transaction_get</span>(<span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">previous_output</span>.<span class="ident">txid</span>))<span class="question-mark">?</span>;
- <span class="ident">database</span>.<span class="ident">set_raw_tx</span>(<span class="kw-2">&</span><span class="ident">fetched_tx</span>)<span class="question-mark">?</span>;
-
- <span class="ident">fetched_tx</span>
- }
- };
-
- <span class="ident">inputs_sum</span> <span class="op">+</span><span class="op">=</span> <span class="ident">tx</span>.<span class="ident">output</span>[<span class="ident">input</span>.<span class="ident">previous_output</span>.<span class="ident">vout</span> <span class="kw">as</span> <span class="ident">usize</span>].<span class="ident">value</span>;
- }
- }
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">to_check_later</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
- <span class="kw">for</span> (<span class="ident">i</span>, <span class="ident">output</span>) <span class="kw">in</span> <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
- <span class="comment">// to compute the fees later</span>
- <span class="ident">outputs_sum</span> <span class="op">+</span><span class="op">=</span> <span class="ident">output</span>.<span class="ident">value</span>;
-
- <span class="comment">// this output is ours, we have a path to derive it</span>
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">script_type</span>, <span class="ident">child</span>)) <span class="op">=</span>
- <span class="ident">database</span>.<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">output</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span>
- {
- <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"{} output #{} is mine, adding utxo"</span>, <span class="ident">txid</span>, <span class="ident">i</span>);
- <span class="ident">updates</span>.<span class="ident">set_utxo</span>(<span class="kw-2">&</span><span class="ident">UTXO</span> {
- <span class="ident">outpoint</span>: <span class="ident">OutPoint</span>::<span class="ident">new</span>(<span class="ident">tx</span>.<span class="ident">txid</span>(), <span class="ident">i</span> <span class="kw">as</span> <span class="ident">u32</span>),
- <span class="ident">txout</span>: <span class="ident">output</span>.<span class="ident">clone</span>(),
- <span class="ident">is_internal</span>: <span class="ident">script_type</span>.<span class="ident">is_internal</span>(),
- })<span class="question-mark">?</span>;
- <span class="ident">incoming</span> <span class="op">+</span><span class="op">=</span> <span class="ident">output</span>.<span class="ident">value</span>;
-
- <span class="kw">if</span> <span class="ident">output</span>.<span class="ident">script_pubkey</span> <span class="op">!</span><span class="op">=</span> <span class="kw-2">*</span><span class="ident">cur_script</span> {
- <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"{} output #{} script {} was not current script, adding script to be checked later"</span>, <span class="ident">txid</span>, <span class="ident">i</span>, <span class="ident">output</span>.<span class="ident">script_pubkey</span>);
- <span class="ident">to_check_later</span>.<span class="ident">push</span>(<span class="ident">output</span>.<span class="ident">script_pubkey</span>.<span class="ident">clone</span>())
- }
-
- <span class="comment">// derive as many change addrs as external addresses that we've seen</span>
- <span class="kw">if</span> <span class="ident">script_type</span> <span class="op">=</span><span class="op">=</span> <span class="ident">ScriptType</span>::<span class="ident">Internal</span>
- <span class="kw-2">&</span><span class="op">&</span> (<span class="ident">change_max_deriv</span>.<span class="ident">is_none</span>() <span class="op">|</span><span class="op">|</span> <span class="ident">child</span> <span class="op">></span> <span class="ident">change_max_deriv</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>))
- {
- <span class="kw-2">*</span><span class="ident">change_max_deriv</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">child</span>);
- }
- }
- }
-
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">TransactionDetails</span> {
- <span class="ident">txid</span>: <span class="ident">tx</span>.<span class="ident">txid</span>(),
- <span class="ident">transaction</span>: <span class="prelude-val">Some</span>(<span class="ident">tx</span>),
- <span class="ident">received</span>: <span class="ident">incoming</span>,
- <span class="ident">sent</span>: <span class="ident">outgoing</span>,
- <span class="ident">height</span>,
- <span class="ident">timestamp</span>: <span class="number">0</span>,
- <span class="ident">fees</span>: <span class="ident">inputs_sum</span> <span class="op">-</span> <span class="ident">outputs_sum</span>,
- };
- <span class="macro">info</span><span class="macro">!</span>(<span class="string">"Saving tx {}"</span>, <span class="ident">txid</span>);
- <span class="ident">updates</span>.<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">tx</span>)<span class="question-mark">?</span>;
-
- <span class="ident">database</span>.<span class="ident">commit_batch</span>(<span class="ident">updates</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">to_check_later</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">check_history</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
- <span class="ident">script_pubkey</span>: <span class="ident">Script</span>,
- <span class="ident">txs</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">ELSGetHistoryRes</span><span class="op">></span>,
- <span class="ident">change_max_deriv</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">to_check_later</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
-
- <span class="macro">debug</span><span class="macro">!</span>(
- <span class="string">"history of {} script {} has {} tx"</span>,
- <span class="ident">Address</span>::<span class="ident">from_script</span>(<span class="kw-2">&</span><span class="ident">script_pubkey</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>).<span class="ident">unwrap</span>(),
- <span class="ident">script_pubkey</span>,
- <span class="ident">txs</span>.<span class="ident">len</span>()
- );
-
- <span class="kw">for</span> <span class="ident">tx</span> <span class="kw">in</span> <span class="ident">txs</span> {
- <span class="kw">let</span> <span class="ident">height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">tx</span>.<span class="ident">height</span> {
- <span class="number">0</span> <span class="op">|</span> <span class="op">-</span><span class="number">1</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
- <span class="ident">x</span> <span class="op">=</span><span class="op">></span> <span class="ident">u32</span>::<span class="ident">try_from</span>(<span class="ident">x</span>).<span class="ident">ok</span>(),
- };
-
- <span class="ident">to_check_later</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">check_tx_and_descendant</span>(
- <span class="ident">database</span>,
- <span class="kw-2">&</span><span class="ident">tx</span>.<span class="ident">tx_hash</span>,
- <span class="ident">height</span>,
- <span class="kw-2">&</span><span class="ident">script_pubkey</span>,
- <span class="ident">change_max_deriv</span>,
- ))<span class="question-mark">?</span>);
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">to_check_later</span>)
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/database/keyvalue.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>keyvalue.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-<span id="203">203</span>
-<span id="204">204</span>
-<span id="205">205</span>
-<span id="206">206</span>
-<span id="207">207</span>
-<span id="208">208</span>
-<span id="209">209</span>
-<span id="210">210</span>
-<span id="211">211</span>
-<span id="212">212</span>
-<span id="213">213</span>
-<span id="214">214</span>
-<span id="215">215</span>
-<span id="216">216</span>
-<span id="217">217</span>
-<span id="218">218</span>
-<span id="219">219</span>
-<span id="220">220</span>
-<span id="221">221</span>
-<span id="222">222</span>
-<span id="223">223</span>
-<span id="224">224</span>
-<span id="225">225</span>
-<span id="226">226</span>
-<span id="227">227</span>
-<span id="228">228</span>
-<span id="229">229</span>
-<span id="230">230</span>
-<span id="231">231</span>
-<span id="232">232</span>
-<span id="233">233</span>
-<span id="234">234</span>
-<span id="235">235</span>
-<span id="236">236</span>
-<span id="237">237</span>
-<span id="238">238</span>
-<span id="239">239</span>
-<span id="240">240</span>
-<span id="241">241</span>
-<span id="242">242</span>
-<span id="243">243</span>
-<span id="244">244</span>
-<span id="245">245</span>
-<span id="246">246</span>
-<span id="247">247</span>
-<span id="248">248</span>
-<span id="249">249</span>
-<span id="250">250</span>
-<span id="251">251</span>
-<span id="252">252</span>
-<span id="253">253</span>
-<span id="254">254</span>
-<span id="255">255</span>
-<span id="256">256</span>
-<span id="257">257</span>
-<span id="258">258</span>
-<span id="259">259</span>
-<span id="260">260</span>
-<span id="261">261</span>
-<span id="262">262</span>
-<span id="263">263</span>
-<span id="264">264</span>
-<span id="265">265</span>
-<span id="266">266</span>
-<span id="267">267</span>
-<span id="268">268</span>
-<span id="269">269</span>
-<span id="270">270</span>
-<span id="271">271</span>
-<span id="272">272</span>
-<span id="273">273</span>
-<span id="274">274</span>
-<span id="275">275</span>
-<span id="276">276</span>
-<span id="277">277</span>
-<span id="278">278</span>
-<span id="279">279</span>
-<span id="280">280</span>
-<span id="281">281</span>
-<span id="282">282</span>
-<span id="283">283</span>
-<span id="284">284</span>
-<span id="285">285</span>
-<span id="286">286</span>
-<span id="287">287</span>
-<span id="288">288</span>
-<span id="289">289</span>
-<span id="290">290</span>
-<span id="291">291</span>
-<span id="292">292</span>
-<span id="293">293</span>
-<span id="294">294</span>
-<span id="295">295</span>
-<span id="296">296</span>
-<span id="297">297</span>
-<span id="298">298</span>
-<span id="299">299</span>
-<span id="300">300</span>
-<span id="301">301</span>
-<span id="302">302</span>
-<span id="303">303</span>
-<span id="304">304</span>
-<span id="305">305</span>
-<span id="306">306</span>
-<span id="307">307</span>
-<span id="308">308</span>
-<span id="309">309</span>
-<span id="310">310</span>
-<span id="311">311</span>
-<span id="312">312</span>
-<span id="313">313</span>
-<span id="314">314</span>
-<span id="315">315</span>
-<span id="316">316</span>
-<span id="317">317</span>
-<span id="318">318</span>
-<span id="319">319</span>
-<span id="320">320</span>
-<span id="321">321</span>
-<span id="322">322</span>
-<span id="323">323</span>
-<span id="324">324</span>
-<span id="325">325</span>
-<span id="326">326</span>
-<span id="327">327</span>
-<span id="328">328</span>
-<span id="329">329</span>
-<span id="330">330</span>
-<span id="331">331</span>
-<span id="332">332</span>
-<span id="333">333</span>
-<span id="334">334</span>
-<span id="335">335</span>
-<span id="336">336</span>
-<span id="337">337</span>
-<span id="338">338</span>
-<span id="339">339</span>
-<span id="340">340</span>
-<span id="341">341</span>
-<span id="342">342</span>
-<span id="343">343</span>
-<span id="344">344</span>
-<span id="345">345</span>
-<span id="346">346</span>
-<span id="347">347</span>
-<span id="348">348</span>
-<span id="349">349</span>
-<span id="350">350</span>
-<span id="351">351</span>
-<span id="352">352</span>
-<span id="353">353</span>
-<span id="354">354</span>
-<span id="355">355</span>
-<span id="356">356</span>
-<span id="357">357</span>
-<span id="358">358</span>
-<span id="359">359</span>
-<span id="360">360</span>
-<span id="361">361</span>
-<span id="362">362</span>
-<span id="363">363</span>
-<span id="364">364</span>
-<span id="365">365</span>
-<span id="366">366</span>
-<span id="367">367</span>
-<span id="368">368</span>
-<span id="369">369</span>
-<span id="370">370</span>
-<span id="371">371</span>
-<span id="372">372</span>
-<span id="373">373</span>
-<span id="374">374</span>
-<span id="375">375</span>
-<span id="376">376</span>
-<span id="377">377</span>
-<span id="378">378</span>
-<span id="379">379</span>
-<span id="380">380</span>
-<span id="381">381</span>
-<span id="382">382</span>
-<span id="383">383</span>
-<span id="384">384</span>
-<span id="385">385</span>
-<span id="386">386</span>
-<span id="387">387</span>
-<span id="388">388</span>
-<span id="389">389</span>
-<span id="390">390</span>
-<span id="391">391</span>
-<span id="392">392</span>
-<span id="393">393</span>
-<span id="394">394</span>
-<span id="395">395</span>
-<span id="396">396</span>
-<span id="397">397</span>
-<span id="398">398</span>
-<span id="399">399</span>
-<span id="400">400</span>
-<span id="401">401</span>
-<span id="402">402</span>
-<span id="403">403</span>
-<span id="404">404</span>
-<span id="405">405</span>
-<span id="406">406</span>
-<span id="407">407</span>
-<span id="408">408</span>
-<span id="409">409</span>
-<span id="410">410</span>
-<span id="411">411</span>
-<span id="412">412</span>
-<span id="413">413</span>
-<span id="414">414</span>
-<span id="415">415</span>
-<span id="416">416</span>
-<span id="417">417</span>
-<span id="418">418</span>
-<span id="419">419</span>
-<span id="420">420</span>
-<span id="421">421</span>
-<span id="422">422</span>
-<span id="423">423</span>
-<span id="424">424</span>
-<span id="425">425</span>
-<span id="426">426</span>
-<span id="427">427</span>
-<span id="428">428</span>
-<span id="429">429</span>
-<span id="430">430</span>
-<span id="431">431</span>
-<span id="432">432</span>
-<span id="433">433</span>
-<span id="434">434</span>
-<span id="435">435</span>
-<span id="436">436</span>
-<span id="437">437</span>
-<span id="438">438</span>
-<span id="439">439</span>
-<span id="440">440</span>
-<span id="441">441</span>
-<span id="442">442</span>
-<span id="443">443</span>
-<span id="444">444</span>
-<span id="445">445</span>
-<span id="446">446</span>
-<span id="447">447</span>
-<span id="448">448</span>
-<span id="449">449</span>
-<span id="450">450</span>
-<span id="451">451</span>
-<span id="452">452</span>
-<span id="453">453</span>
-<span id="454">454</span>
-<span id="455">455</span>
-<span id="456">456</span>
-<span id="457">457</span>
-<span id="458">458</span>
-<span id="459">459</span>
-<span id="460">460</span>
-<span id="461">461</span>
-<span id="462">462</span>
-<span id="463">463</span>
-<span id="464">464</span>
-<span id="465">465</span>
-<span id="466">466</span>
-<span id="467">467</span>
-<span id="468">468</span>
-<span id="469">469</span>
-<span id="470">470</span>
-<span id="471">471</span>
-<span id="472">472</span>
-<span id="473">473</span>
-<span id="474">474</span>
-<span id="475">475</span>
-<span id="476">476</span>
-<span id="477">477</span>
-<span id="478">478</span>
-<span id="479">479</span>
-<span id="480">480</span>
-<span id="481">481</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">convert</span>::<span class="ident">TryInto</span>;
-
-<span class="kw">use</span> <span class="ident">sled</span>::{<span class="ident">Batch</span>, <span class="ident">Tree</span>};
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::{<span class="ident">deserialize</span>, <span class="ident">serialize</span>};
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hash_types</span>::<span class="ident">Txid</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">OutPoint</span>, <span class="ident">Script</span>, <span class="ident">Transaction</span>};
-
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">memory</span>::<span class="ident">MapKey</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::{<span class="ident">BatchDatabase</span>, <span class="ident">BatchOperations</span>, <span class="ident">Database</span>};
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="kw-2">*</span>;
-
-<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_batch_operations</span> {
- ( { $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">after_insert</span>:<span class="ident">tt</span>)<span class="op">*</span> }, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">process_delete</span>:<span class="ident">ident</span> ) <span class="op">=</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">set_script_pubkey</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>, <span class="ident">path</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="prelude-val">Some</span>(<span class="ident">script_type</span>), <span class="prelude-val">Some</span>(<span class="ident">path</span>))).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">serialize</span>(<span class="ident">script</span>))$(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">after_insert</span>)<span class="kw-2">*</span>;
-
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Script</span>(<span class="prelude-val">Some</span>(<span class="ident">script</span>)).<span class="ident">as_map_key</span>();
- <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="macro">json</span><span class="macro">!</span>({
- <span class="string">"t"</span>: <span class="ident">script_type</span>,
- <span class="string">"p"</span>: <span class="ident">path</span>,
- });
- <span class="self">self</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">serde_json</span>::<span class="ident">to_vec</span>(<span class="kw-2">&</span><span class="ident">value</span>)<span class="question-mark">?</span>)$(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">after_insert</span>)<span class="kw-2">*</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">fn</span> <span class="ident">set_utxo</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">utxo</span>: <span class="kw-2">&</span><span class="ident">UTXO</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="ident">utxo</span>.<span class="ident">outpoint</span>)).<span class="ident">as_map_key</span>();
- <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="macro">json</span><span class="macro">!</span>({
- <span class="string">"t"</span>: <span class="ident">utxo</span>.<span class="ident">txout</span>,
- <span class="string">"i"</span>: <span class="ident">utxo</span>.<span class="ident">is_internal</span>,
- });
- <span class="self">self</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">serde_json</span>::<span class="ident">to_vec</span>(<span class="kw-2">&</span><span class="ident">value</span>)<span class="question-mark">?</span>)$(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">after_insert</span>)<span class="kw-2">*</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">fn</span> <span class="ident">set_raw_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">transaction</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="ident">transaction</span>.<span class="ident">txid</span>())).<span class="ident">as_map_key</span>();
- <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="ident">serialize</span>(<span class="ident">transaction</span>);
- <span class="self">self</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">value</span>)$(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">after_insert</span>)<span class="kw-2">*</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">fn</span> <span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">transaction</span>: <span class="kw-2">&</span><span class="ident">TransactionDetails</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="ident">transaction</span>.<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
-
- <span class="comment">// remove the raw tx from the serialized version</span>
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">value</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">to_value</span>(<span class="ident">transaction</span>)<span class="question-mark">?</span>;
- <span class="ident">value</span>[<span class="string">"transaction"</span>] <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">Value</span>::<span class="ident">Null</span>;
- <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">to_vec</span>(<span class="kw-2">&</span><span class="ident">value</span>)<span class="question-mark">?</span>;
-
- <span class="self">self</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">value</span>)$(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">after_insert</span>)<span class="kw-2">*</span>;
-
- <span class="comment">// insert the raw_tx if present</span>
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">tx</span>) <span class="op">=</span> <span class="ident">transaction</span>.<span class="ident">transaction</span> {
- <span class="self">self</span>.<span class="ident">set_raw_tx</span>(<span class="ident">tx</span>)<span class="question-mark">?</span>;
- }
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">fn</span> <span class="ident">set_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>, <span class="ident">value</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="kw-2">&</span><span class="ident">value</span>.<span class="ident">to_be_bytes</span>())$(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">after_insert</span>)<span class="kw-2">*</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">fn</span> <span class="ident">del_script_pubkey_from_path</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>, <span class="ident">path</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="prelude-val">Some</span>(<span class="ident">script_type</span>), <span class="prelude-val">Some</span>(<span class="ident">path</span>))).<span class="ident">as_map_key</span>();
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">remove</span>(<span class="ident">key</span>);
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">process_delete</span><span class="op">!</span>(<span class="ident">res</span>);
-
- <span class="prelude-val">Ok</span>(<span class="ident">res</span>.<span class="ident">map_or</span>(<span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>), <span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="prelude-val">Some</span>(<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">x</span>)).<span class="ident">transpose</span>())<span class="question-mark">?</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">del_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span>(<span class="ident">ScriptType</span>, <span class="ident">u32</span>)<span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Script</span>(<span class="prelude-val">Some</span>(<span class="ident">script</span>)).<span class="ident">as_map_key</span>();
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">remove</span>(<span class="ident">key</span>);
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">process_delete</span><span class="op">!</span>(<span class="ident">res</span>);
-
- <span class="kw">match</span> <span class="ident">res</span> {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
- <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">serde_json</span>::<span class="ident">Value</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">b</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">st</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"t"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"p"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>((<span class="ident">st</span>, <span class="ident">path</span>)))
- }
- }
- }
-
- <span class="kw">fn</span> <span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">outpoint</span>: <span class="kw-2">&</span><span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">Some</span>(<span class="ident">outpoint</span>)).<span class="ident">as_map_key</span>();
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">remove</span>(<span class="ident">key</span>);
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">process_delete</span><span class="op">!</span>(<span class="ident">res</span>);
-
- <span class="kw">match</span> <span class="ident">res</span> {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
- <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">serde_json</span>::<span class="ident">Value</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">b</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">txout</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"t"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">is_internal</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"i"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">UTXO</span> { <span class="ident">outpoint</span>: <span class="ident">outpoint</span>.<span class="ident">clone</span>(), <span class="ident">txout</span>, <span class="ident">is_internal</span> }))
- }
- }
- }
-
- <span class="kw">fn</span> <span class="ident">del_raw_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">Some</span>(<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">remove</span>(<span class="ident">key</span>);
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">process_delete</span><span class="op">!</span>(<span class="ident">res</span>);
-
- <span class="prelude-val">Ok</span>(<span class="ident">res</span>.<span class="ident">map_or</span>(<span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>), <span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="prelude-val">Some</span>(<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">x</span>)).<span class="ident">transpose</span>())<span class="question-mark">?</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">del_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>, <span class="ident">include_raw</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">raw_tx</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">include_raw</span> {
- <span class="self">self</span>.<span class="ident">del_raw_tx</span>(<span class="ident">txid</span>)<span class="question-mark">?</span>
- } <span class="kw">else</span> {
- <span class="prelude-val">None</span>
- };
-
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">Some</span>(<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">remove</span>(<span class="ident">key</span>);
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">process_delete</span><span class="op">!</span>(<span class="ident">res</span>);
-
- <span class="kw">match</span> <span class="ident">res</span> {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
- <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">TransactionDetails</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">b</span>)<span class="question-mark">?</span>;
- <span class="ident">val</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="ident">raw_tx</span>;
-
- <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">val</span>))
- }
- }
- }
-
- <span class="kw">fn</span> <span class="ident">del_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">remove</span>(<span class="ident">key</span>);
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">process_delete</span><span class="op">!</span>(<span class="ident">res</span>);
-
- <span class="kw">match</span> <span class="ident">res</span> {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
- <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">array</span>: [<span class="ident">u8</span>; <span class="number">4</span>] <span class="op">=</span> <span class="ident">b</span>.<span class="ident">as_ref</span>().<span class="ident">try_into</span>().<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">Error</span>::<span class="ident">InvalidU32Bytes</span>(<span class="ident">b</span>.<span class="ident">to_vec</span>()))<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">val</span> <span class="op">=</span> <span class="ident">u32</span>::<span class="ident">from_be_bytes</span>(<span class="ident">array</span>);
- <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">val</span>))
- }
- }
- }
- }
-}
-
-<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">process_delete_tree</span> {
- (<span class="macro-nonterminal">$</span><span class="macro-nonterminal">res</span>:<span class="ident">expr</span>) <span class="op">=</span><span class="op">></span> {
- <span class="macro-nonterminal">$</span><span class="macro-nonterminal">res</span><span class="question-mark">?</span>
- };
-}
-<span class="kw">impl</span> <span class="ident">BatchOperations</span> <span class="kw">for</span> <span class="ident">Tree</span> {
- <span class="macro">impl_batch_operations</span><span class="macro">!</span>({<span class="question-mark">?</span>}, <span class="ident">process_delete_tree</span>);
-}
-
-<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">process_delete_batch</span> {
- (<span class="macro-nonterminal">$</span><span class="macro-nonterminal">res</span>:<span class="ident">expr</span>) <span class="op">=</span><span class="op">></span> {
- <span class="prelude-val">None</span> <span class="kw">as</span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">sled</span>::<span class="ident">IVec</span><span class="op">></span>
- };
-}
-<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_variables</span>)]</span>
-<span class="kw">impl</span> <span class="ident">BatchOperations</span> <span class="kw">for</span> <span class="ident">Batch</span> {
- <span class="macro">impl_batch_operations</span><span class="macro">!</span>({}, <span class="ident">process_delete_batch</span>);
-}
-
-<span class="kw">impl</span> <span class="ident">Database</span> <span class="kw">for</span> <span class="ident">Tree</span> {
- <span class="kw">fn</span> <span class="ident">check_descriptor_checksum</span><span class="op"><</span><span class="ident">B</span>: <span class="ident">AsRef</span><span class="op"><</span>[<span class="ident">u8</span>]<span class="op">></span><span class="op">></span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
- <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
- <span class="ident">bytes</span>: <span class="ident">B</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">DescriptorChecksum</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
-
- <span class="kw">let</span> <span class="ident">prev</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key</span>)<span class="question-mark">?</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span>.<span class="ident">to_vec</span>());
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">val</span>) <span class="op">=</span> <span class="ident">prev</span> {
- <span class="kw">if</span> <span class="ident">val</span> <span class="op">=</span><span class="op">=</span> <span class="ident">bytes</span>.<span class="ident">as_ref</span>() {
- <span class="prelude-val">Ok</span>(())
- } <span class="kw">else</span> {
- <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">ChecksumMismatch</span>)
- }
- } <span class="kw">else</span> {
- <span class="self">self</span>.<span class="ident">insert</span>(<span class="kw-2">&</span><span class="ident">key</span>, <span class="ident">bytes</span>.<span class="ident">as_ref</span>())<span class="question-mark">?</span>;
- <span class="prelude-val">Ok</span>(())
- }
- }
-
- <span class="kw">fn</span> <span class="ident">iter_script_pubkeys</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script_type</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">ScriptType</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="ident">script_type</span>, <span class="prelude-val">None</span>)).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">scan_prefix</span>(<span class="ident">key</span>)
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> (<span class="kw">_</span>, <span class="ident">v</span>) <span class="op">=</span> <span class="ident">x</span><span class="question-mark">?</span>;
- <span class="prelude-val">Ok</span>(<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">v</span>)<span class="question-mark">?</span>)
- })
- .<span class="ident">collect</span>()
- }
-
- <span class="kw">fn</span> <span class="ident">iter_utxos</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">None</span>).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">scan_prefix</span>(<span class="ident">key</span>)
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> (<span class="ident">k</span>, <span class="ident">v</span>) <span class="op">=</span> <span class="ident">x</span><span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">outpoint</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">k</span>[<span class="number">1</span>..])<span class="question-mark">?</span>;
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">serde_json</span>::<span class="ident">Value</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">v</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">txout</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"t"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">is_internal</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"i"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">UTXO</span> {
- <span class="ident">outpoint</span>,
- <span class="ident">txout</span>,
- <span class="ident">is_internal</span>,
- })
- })
- .<span class="ident">collect</span>()
- }
-
- <span class="kw">fn</span> <span class="ident">iter_raw_txs</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">None</span>).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">scan_prefix</span>(<span class="ident">key</span>)
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> (<span class="kw">_</span>, <span class="ident">v</span>) <span class="op">=</span> <span class="ident">x</span><span class="question-mark">?</span>;
- <span class="prelude-val">Ok</span>(<span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">v</span>)<span class="question-mark">?</span>)
- })
- .<span class="ident">collect</span>()
- }
-
- <span class="kw">fn</span> <span class="ident">iter_txs</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">include_raw</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">None</span>).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">scan_prefix</span>(<span class="ident">key</span>)
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> (<span class="ident">k</span>, <span class="ident">v</span>) <span class="op">=</span> <span class="ident">x</span><span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">txdetails</span>: <span class="ident">TransactionDetails</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">v</span>)<span class="question-mark">?</span>;
- <span class="kw">if</span> <span class="ident">include_raw</span> {
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">k</span>[<span class="number">1</span>..])<span class="question-mark">?</span>;
- <span class="ident">txdetails</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="ident">txid</span>)<span class="question-mark">?</span>;
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">txdetails</span>)
- })
- .<span class="ident">collect</span>()
- }
-
- <span class="kw">fn</span> <span class="ident">get_script_pubkey_from_path</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
- <span class="ident">path</span>: <span class="ident">u32</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="prelude-val">Some</span>(<span class="ident">script_type</span>), <span class="prelude-val">Some</span>(<span class="ident">path</span>))).<span class="ident">as_map_key</span>();
- <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">get</span>(<span class="ident">key</span>)<span class="question-mark">?</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">b</span>)).<span class="ident">transpose</span>()<span class="question-mark">?</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">get_path_from_script_pubkey</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span>(<span class="ident">ScriptType</span>, <span class="ident">u32</span>)<span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Script</span>(<span class="prelude-val">Some</span>(<span class="ident">script</span>)).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">get</span>(<span class="ident">key</span>)<span class="question-mark">?</span>
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">serde_json</span>::<span class="ident">Value</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">b</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">st</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"t"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"p"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>((<span class="ident">st</span>, <span class="ident">path</span>))
- })
- .<span class="ident">transpose</span>()
- }
-
- <span class="kw">fn</span> <span class="ident">get_utxo</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">outpoint</span>: <span class="kw-2">&</span><span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">Some</span>(<span class="ident">outpoint</span>)).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">get</span>(<span class="ident">key</span>)<span class="question-mark">?</span>
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">serde_json</span>::<span class="ident">Value</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">b</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">txout</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"t"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">is_internal</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"i"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">UTXO</span> {
- <span class="ident">outpoint</span>: <span class="ident">outpoint</span>.<span class="ident">clone</span>(),
- <span class="ident">txout</span>,
- <span class="ident">is_internal</span>,
- })
- })
- .<span class="ident">transpose</span>()
- }
-
- <span class="kw">fn</span> <span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">Some</span>(<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
- <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">get</span>(<span class="ident">key</span>)<span class="question-mark">?</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">b</span>)).<span class="ident">transpose</span>()<span class="question-mark">?</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>, <span class="ident">include_raw</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">Some</span>(<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">get</span>(<span class="ident">key</span>)<span class="question-mark">?</span>
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">txdetails</span>: <span class="ident">TransactionDetails</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">b</span>)<span class="question-mark">?</span>;
- <span class="kw">if</span> <span class="ident">include_raw</span> {
- <span class="ident">txdetails</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="ident">txid</span>)<span class="question-mark">?</span>;
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">txdetails</span>)
- })
- .<span class="ident">transpose</span>()
- }
-
- <span class="kw">fn</span> <span class="ident">get_last_index</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">get</span>(<span class="ident">key</span>)<span class="question-mark">?</span>
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">array</span>: [<span class="ident">u8</span>; <span class="number">4</span>] <span class="op">=</span> <span class="ident">b</span>
- .<span class="ident">as_ref</span>()
- .<span class="ident">try_into</span>()
- .<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">Error</span>::<span class="ident">InvalidU32Bytes</span>(<span class="ident">b</span>.<span class="ident">to_vec</span>()))<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">val</span> <span class="op">=</span> <span class="ident">u32</span>::<span class="ident">from_be_bytes</span>(<span class="ident">array</span>);
- <span class="prelude-val">Ok</span>(<span class="ident">val</span>)
- })
- .<span class="ident">transpose</span>()
- }
-
- <span class="comment">// inserts 0 if not present</span>
- <span class="kw">fn</span> <span class="ident">increment_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">update_and_fetch</span>(<span class="ident">key</span>, <span class="op">|</span><span class="ident">prev</span><span class="op">|</span> {
- <span class="kw">let</span> <span class="ident">new</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">prev</span> {
- <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">array</span>: [<span class="ident">u8</span>; <span class="number">4</span>] <span class="op">=</span> <span class="ident">b</span>.<span class="ident">try_into</span>().<span class="ident">unwrap_or</span>([<span class="number">0</span>; <span class="number">4</span>]);
- <span class="kw">let</span> <span class="ident">val</span> <span class="op">=</span> <span class="ident">u32</span>::<span class="ident">from_be_bytes</span>(<span class="ident">array</span>);
-
- <span class="ident">val</span> <span class="op">+</span> <span class="number">1</span>
- }
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="number">0</span>,
- };
-
- <span class="prelude-val">Some</span>(<span class="ident">new</span>.<span class="ident">to_be_bytes</span>().<span class="ident">to_vec</span>())
- })<span class="question-mark">?</span>
- .<span class="ident">map_or</span>(<span class="prelude-val">Ok</span>(<span class="number">0</span>), <span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">array</span>: [<span class="ident">u8</span>; <span class="number">4</span>] <span class="op">=</span> <span class="ident">b</span>
- .<span class="ident">as_ref</span>()
- .<span class="ident">try_into</span>()
- .<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">Error</span>::<span class="ident">InvalidU32Bytes</span>(<span class="ident">b</span>.<span class="ident">to_vec</span>()))<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">val</span> <span class="op">=</span> <span class="ident">u32</span>::<span class="ident">from_be_bytes</span>(<span class="ident">array</span>);
- <span class="prelude-val">Ok</span>(<span class="ident">val</span>)
- })
- }
-}
-
-<span class="kw">impl</span> <span class="ident">BatchDatabase</span> <span class="kw">for</span> <span class="ident">Tree</span> {
- <span class="kw">type</span> <span class="ident">Batch</span> <span class="op">=</span> <span class="ident">sled</span>::<span class="ident">Batch</span>;
-
- <span class="kw">fn</span> <span class="ident">begin_batch</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span>::<span class="ident">Batch</span> {
- <span class="ident">sled</span>::<span class="ident">Batch</span>::<span class="ident">default</span>()
- }
-
- <span class="kw">fn</span> <span class="ident">commit_batch</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">batch</span>: <span class="self">Self</span>::<span class="ident">Batch</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">apply_batch</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>)
- }
-}
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="kw">mod</span> <span class="ident">test</span> {
- <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::{<span class="ident">Arc</span>, <span class="ident">Condvar</span>, <span class="ident">Mutex</span>, <span class="ident">Once</span>};
- <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::{<span class="ident">SystemTime</span>, <span class="ident">UNIX_EPOCH</span>};
-
- <span class="kw">use</span> <span class="ident">sled</span>::{<span class="ident">Db</span>, <span class="ident">Tree</span>};
-
- <span class="kw">static</span> <span class="kw-2">mut</span> <span class="ident">COUNT</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">0</span>;
-
- <span class="macro">lazy_static</span><span class="macro">!</span> {
- <span class="kw">static</span> <span class="kw-2">ref</span> <span class="ident">DB</span>: <span class="ident">Arc</span><span class="op"><</span>(<span class="ident">Mutex</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Db</span><span class="op">></span><span class="op">></span>, <span class="ident">Condvar</span>)<span class="op">></span> <span class="op">=</span>
- <span class="ident">Arc</span>::<span class="ident">new</span>((<span class="ident">Mutex</span>::<span class="ident">new</span>(<span class="prelude-val">None</span>), <span class="ident">Condvar</span>::<span class="ident">new</span>()));
- <span class="kw">static</span> <span class="kw-2">ref</span> <span class="ident">INIT</span>: <span class="ident">Once</span> <span class="op">=</span> <span class="ident">Once</span>::<span class="ident">new</span>();
- }
-
- <span class="kw">fn</span> <span class="ident">get_tree</span>() <span class="op">-</span><span class="op">></span> <span class="ident">Tree</span> {
- <span class="kw">unsafe</span> {
- <span class="kw">let</span> <span class="ident">cloned</span> <span class="op">=</span> <span class="ident">DB</span>.<span class="ident">clone</span>();
- <span class="kw">let</span> (<span class="ident">mutex</span>, <span class="ident">cvar</span>) <span class="op">=</span> <span class="kw-2">&</span><span class="kw-2">*</span><span class="ident">cloned</span>;
-
- <span class="ident">INIT</span>.<span class="ident">call_once</span>(<span class="op">|</span><span class="op">|</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">db</span> <span class="op">=</span> <span class="ident">mutex</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">time</span> <span class="op">=</span> <span class="ident">SystemTime</span>::<span class="ident">now</span>().<span class="ident">duration_since</span>(<span class="ident">UNIX_EPOCH</span>).<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">dir</span> <span class="op">=</span> <span class="ident">std</span>::<span class="ident">env</span>::<span class="ident">temp_dir</span>();
- <span class="ident">dir</span>.<span class="ident">push</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"mbw_{}"</span>, <span class="ident">time</span>.<span class="ident">as_nanos</span>()));
-
- <span class="kw-2">*</span><span class="ident">db</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">sled</span>::<span class="ident">open</span>(<span class="ident">dir</span>).<span class="ident">unwrap</span>());
- <span class="ident">cvar</span>.<span class="ident">notify_all</span>();
- });
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">db</span> <span class="op">=</span> <span class="ident">mutex</span>.<span class="ident">lock</span>().<span class="ident">unwrap</span>();
- <span class="kw">while</span> <span class="op">!</span><span class="ident">db</span>.<span class="ident">is_some</span>() {
- <span class="ident">db</span> <span class="op">=</span> <span class="ident">cvar</span>.<span class="ident">wait</span>(<span class="ident">db</span>).<span class="ident">unwrap</span>();
- }
-
- <span class="ident">COUNT</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
-
- <span class="ident">db</span>.<span class="ident">as_ref</span>()
- .<span class="ident">unwrap</span>()
- .<span class="ident">open_tree</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"tree_{}"</span>, <span class="ident">COUNT</span>))
- .<span class="ident">unwrap</span>()
- }
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_script_pubkey</span>() {
- <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_script_pubkey</span>(<span class="ident">get_tree</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_batch_script_pubkey</span>() {
- <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_batch_script_pubkey</span>(<span class="ident">get_tree</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_iter_script_pubkey</span>() {
- <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_iter_script_pubkey</span>(<span class="ident">get_tree</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_del_script_pubkey</span>() {
- <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_del_script_pubkey</span>(<span class="ident">get_tree</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_utxo</span>() {
- <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_utxo</span>(<span class="ident">get_tree</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_raw_tx</span>() {
- <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_raw_tx</span>(<span class="ident">get_tree</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_tx</span>() {
- <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_tx</span>(<span class="ident">get_tree</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_last_index</span>() {
- <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_last_index</span>(<span class="ident">get_tree</span>());
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/database/memory.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>memory.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-<span id="203">203</span>
-<span id="204">204</span>
-<span id="205">205</span>
-<span id="206">206</span>
-<span id="207">207</span>
-<span id="208">208</span>
-<span id="209">209</span>
-<span id="210">210</span>
-<span id="211">211</span>
-<span id="212">212</span>
-<span id="213">213</span>
-<span id="214">214</span>
-<span id="215">215</span>
-<span id="216">216</span>
-<span id="217">217</span>
-<span id="218">218</span>
-<span id="219">219</span>
-<span id="220">220</span>
-<span id="221">221</span>
-<span id="222">222</span>
-<span id="223">223</span>
-<span id="224">224</span>
-<span id="225">225</span>
-<span id="226">226</span>
-<span id="227">227</span>
-<span id="228">228</span>
-<span id="229">229</span>
-<span id="230">230</span>
-<span id="231">231</span>
-<span id="232">232</span>
-<span id="233">233</span>
-<span id="234">234</span>
-<span id="235">235</span>
-<span id="236">236</span>
-<span id="237">237</span>
-<span id="238">238</span>
-<span id="239">239</span>
-<span id="240">240</span>
-<span id="241">241</span>
-<span id="242">242</span>
-<span id="243">243</span>
-<span id="244">244</span>
-<span id="245">245</span>
-<span id="246">246</span>
-<span id="247">247</span>
-<span id="248">248</span>
-<span id="249">249</span>
-<span id="250">250</span>
-<span id="251">251</span>
-<span id="252">252</span>
-<span id="253">253</span>
-<span id="254">254</span>
-<span id="255">255</span>
-<span id="256">256</span>
-<span id="257">257</span>
-<span id="258">258</span>
-<span id="259">259</span>
-<span id="260">260</span>
-<span id="261">261</span>
-<span id="262">262</span>
-<span id="263">263</span>
-<span id="264">264</span>
-<span id="265">265</span>
-<span id="266">266</span>
-<span id="267">267</span>
-<span id="268">268</span>
-<span id="269">269</span>
-<span id="270">270</span>
-<span id="271">271</span>
-<span id="272">272</span>
-<span id="273">273</span>
-<span id="274">274</span>
-<span id="275">275</span>
-<span id="276">276</span>
-<span id="277">277</span>
-<span id="278">278</span>
-<span id="279">279</span>
-<span id="280">280</span>
-<span id="281">281</span>
-<span id="282">282</span>
-<span id="283">283</span>
-<span id="284">284</span>
-<span id="285">285</span>
-<span id="286">286</span>
-<span id="287">287</span>
-<span id="288">288</span>
-<span id="289">289</span>
-<span id="290">290</span>
-<span id="291">291</span>
-<span id="292">292</span>
-<span id="293">293</span>
-<span id="294">294</span>
-<span id="295">295</span>
-<span id="296">296</span>
-<span id="297">297</span>
-<span id="298">298</span>
-<span id="299">299</span>
-<span id="300">300</span>
-<span id="301">301</span>
-<span id="302">302</span>
-<span id="303">303</span>
-<span id="304">304</span>
-<span id="305">305</span>
-<span id="306">306</span>
-<span id="307">307</span>
-<span id="308">308</span>
-<span id="309">309</span>
-<span id="310">310</span>
-<span id="311">311</span>
-<span id="312">312</span>
-<span id="313">313</span>
-<span id="314">314</span>
-<span id="315">315</span>
-<span id="316">316</span>
-<span id="317">317</span>
-<span id="318">318</span>
-<span id="319">319</span>
-<span id="320">320</span>
-<span id="321">321</span>
-<span id="322">322</span>
-<span id="323">323</span>
-<span id="324">324</span>
-<span id="325">325</span>
-<span id="326">326</span>
-<span id="327">327</span>
-<span id="328">328</span>
-<span id="329">329</span>
-<span id="330">330</span>
-<span id="331">331</span>
-<span id="332">332</span>
-<span id="333">333</span>
-<span id="334">334</span>
-<span id="335">335</span>
-<span id="336">336</span>
-<span id="337">337</span>
-<span id="338">338</span>
-<span id="339">339</span>
-<span id="340">340</span>
-<span id="341">341</span>
-<span id="342">342</span>
-<span id="343">343</span>
-<span id="344">344</span>
-<span id="345">345</span>
-<span id="346">346</span>
-<span id="347">347</span>
-<span id="348">348</span>
-<span id="349">349</span>
-<span id="350">350</span>
-<span id="351">351</span>
-<span id="352">352</span>
-<span id="353">353</span>
-<span id="354">354</span>
-<span id="355">355</span>
-<span id="356">356</span>
-<span id="357">357</span>
-<span id="358">358</span>
-<span id="359">359</span>
-<span id="360">360</span>
-<span id="361">361</span>
-<span id="362">362</span>
-<span id="363">363</span>
-<span id="364">364</span>
-<span id="365">365</span>
-<span id="366">366</span>
-<span id="367">367</span>
-<span id="368">368</span>
-<span id="369">369</span>
-<span id="370">370</span>
-<span id="371">371</span>
-<span id="372">372</span>
-<span id="373">373</span>
-<span id="374">374</span>
-<span id="375">375</span>
-<span id="376">376</span>
-<span id="377">377</span>
-<span id="378">378</span>
-<span id="379">379</span>
-<span id="380">380</span>
-<span id="381">381</span>
-<span id="382">382</span>
-<span id="383">383</span>
-<span id="384">384</span>
-<span id="385">385</span>
-<span id="386">386</span>
-<span id="387">387</span>
-<span id="388">388</span>
-<span id="389">389</span>
-<span id="390">390</span>
-<span id="391">391</span>
-<span id="392">392</span>
-<span id="393">393</span>
-<span id="394">394</span>
-<span id="395">395</span>
-<span id="396">396</span>
-<span id="397">397</span>
-<span id="398">398</span>
-<span id="399">399</span>
-<span id="400">400</span>
-<span id="401">401</span>
-<span id="402">402</span>
-<span id="403">403</span>
-<span id="404">404</span>
-<span id="405">405</span>
-<span id="406">406</span>
-<span id="407">407</span>
-<span id="408">408</span>
-<span id="409">409</span>
-<span id="410">410</span>
-<span id="411">411</span>
-<span id="412">412</span>
-<span id="413">413</span>
-<span id="414">414</span>
-<span id="415">415</span>
-<span id="416">416</span>
-<span id="417">417</span>
-<span id="418">418</span>
-<span id="419">419</span>
-<span id="420">420</span>
-<span id="421">421</span>
-<span id="422">422</span>
-<span id="423">423</span>
-<span id="424">424</span>
-<span id="425">425</span>
-<span id="426">426</span>
-<span id="427">427</span>
-<span id="428">428</span>
-<span id="429">429</span>
-<span id="430">430</span>
-<span id="431">431</span>
-<span id="432">432</span>
-<span id="433">433</span>
-<span id="434">434</span>
-<span id="435">435</span>
-<span id="436">436</span>
-<span id="437">437</span>
-<span id="438">438</span>
-<span id="439">439</span>
-<span id="440">440</span>
-<span id="441">441</span>
-<span id="442">442</span>
-<span id="443">443</span>
-<span id="444">444</span>
-<span id="445">445</span>
-<span id="446">446</span>
-<span id="447">447</span>
-<span id="448">448</span>
-<span id="449">449</span>
-<span id="450">450</span>
-<span id="451">451</span>
-<span id="452">452</span>
-<span id="453">453</span>
-<span id="454">454</span>
-<span id="455">455</span>
-<span id="456">456</span>
-<span id="457">457</span>
-<span id="458">458</span>
-<span id="459">459</span>
-<span id="460">460</span>
-<span id="461">461</span>
-<span id="462">462</span>
-<span id="463">463</span>
-<span id="464">464</span>
-<span id="465">465</span>
-<span id="466">466</span>
-<span id="467">467</span>
-<span id="468">468</span>
-<span id="469">469</span>
-<span id="470">470</span>
-<span id="471">471</span>
-<span id="472">472</span>
-<span id="473">473</span>
-<span id="474">474</span>
-<span id="475">475</span>
-<span id="476">476</span>
-<span id="477">477</span>
-<span id="478">478</span>
-<span id="479">479</span>
-<span id="480">480</span>
-<span id="481">481</span>
-<span id="482">482</span>
-<span id="483">483</span>
-<span id="484">484</span>
-<span id="485">485</span>
-<span id="486">486</span>
-<span id="487">487</span>
-<span id="488">488</span>
-<span id="489">489</span>
-<span id="490">490</span>
-<span id="491">491</span>
-<span id="492">492</span>
-<span id="493">493</span>
-<span id="494">494</span>
-<span id="495">495</span>
-<span id="496">496</span>
-<span id="497">497</span>
-<span id="498">498</span>
-<span id="499">499</span>
-<span id="500">500</span>
-<span id="501">501</span>
-<span id="502">502</span>
-<span id="503">503</span>
-<span id="504">504</span>
-<span id="505">505</span>
-<span id="506">506</span>
-<span id="507">507</span>
-<span id="508">508</span>
-<span id="509">509</span>
-<span id="510">510</span>
-<span id="511">511</span>
-<span id="512">512</span>
-<span id="513">513</span>
-<span id="514">514</span>
-<span id="515">515</span>
-<span id="516">516</span>
-<span id="517">517</span>
-<span id="518">518</span>
-<span id="519">519</span>
-<span id="520">520</span>
-<span id="521">521</span>
-<span id="522">522</span>
-<span id="523">523</span>
-<span id="524">524</span>
-<span id="525">525</span>
-<span id="526">526</span>
-<span id="527">527</span>
-<span id="528">528</span>
-<span id="529">529</span>
-<span id="530">530</span>
-<span id="531">531</span>
-<span id="532">532</span>
-<span id="533">533</span>
-<span id="534">534</span>
-<span id="535">535</span>
-<span id="536">536</span>
-<span id="537">537</span>
-<span id="538">538</span>
-<span id="539">539</span>
-<span id="540">540</span>
-<span id="541">541</span>
-<span id="542">542</span>
-<span id="543">543</span>
-<span id="544">544</span>
-<span id="545">545</span>
-<span id="546">546</span>
-<span id="547">547</span>
-<span id="548">548</span>
-<span id="549">549</span>
-<span id="550">550</span>
-<span id="551">551</span>
-<span id="552">552</span>
-<span id="553">553</span>
-<span id="554">554</span>
-<span id="555">555</span>
-<span id="556">556</span>
-<span id="557">557</span>
-<span id="558">558</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="doccomment">//! In-memory ephemeral database</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! This module defines an in-memory database type called [`MemoryDatabase`] that is based on a</span>
-<span class="doccomment">//! [`BTreeMap`].</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ops</span>::<span class="ident">Bound</span>::{<span class="ident">Excluded</span>, <span class="ident">Included</span>};
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::{<span class="ident">deserialize</span>, <span class="ident">serialize</span>};
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hash_types</span>::<span class="ident">Txid</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">OutPoint</span>, <span class="ident">Script</span>, <span class="ident">Transaction</span>};
-
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::{<span class="ident">BatchDatabase</span>, <span class="ident">BatchOperations</span>, <span class="ident">Database</span>};
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="kw-2">*</span>;
-
-<span class="comment">// path -> script p{i,e}<path> -> script</span>
-<span class="comment">// script -> path s<script> -> {i,e}<path></span>
-<span class="comment">// outpoint u<outpoint> -> txout</span>
-<span class="comment">// rawtx r<txid> -> tx</span>
-<span class="comment">// transactions t<txid> -> tx details</span>
-<span class="comment">// deriv indexes c{i,e} -> u32</span>
-<span class="comment">// descriptor checksum d{i,e} -> vec<u8></span>
-
-<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">enum</span> <span class="ident">MapKey</span><span class="op"><</span><span class="lifetime">'a</span><span class="op">></span> {
- <span class="ident">Path</span>((<span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">ScriptType</span><span class="op">></span>, <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>)),
- <span class="ident">Script</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">Script</span><span class="op">></span>),
- <span class="ident">UTXO</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">OutPoint</span><span class="op">></span>),
- <span class="ident">RawTx</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">Txid</span><span class="op">></span>),
- <span class="ident">Transaction</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">Txid</span><span class="op">></span>),
- <span class="ident">LastIndex</span>(<span class="ident">ScriptType</span>),
- <span class="ident">DescriptorChecksum</span>(<span class="ident">ScriptType</span>),
-}
-
-<span class="kw">impl</span> <span class="ident">MapKey</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span> {
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">as_prefix</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span> {
- <span class="kw">match</span> <span class="self">self</span> {
- <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="ident">st</span>, <span class="kw">_</span>)) <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">v</span> <span class="op">=</span> <span class="string">b"p"</span>.<span class="ident">to_vec</span>();
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">st</span>) <span class="op">=</span> <span class="ident">st</span> {
- <span class="ident">v</span>.<span class="ident">push</span>(<span class="ident">st</span>.<span class="ident">as_byte</span>());
- }
- <span class="ident">v</span>
- }
- <span class="ident">MapKey</span>::<span class="ident">Script</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="string">b"s"</span>.<span class="ident">to_vec</span>(),
- <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="string">b"u"</span>.<span class="ident">to_vec</span>(),
- <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="string">b"r"</span>.<span class="ident">to_vec</span>(),
- <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="string">b"t"</span>.<span class="ident">to_vec</span>(),
- <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">st</span>) <span class="op">=</span><span class="op">></span> [<span class="string">b"c"</span>, <span class="ident">st</span>.<span class="ident">as_ref</span>()].<span class="ident">concat</span>(),
- <span class="ident">MapKey</span>::<span class="ident">DescriptorChecksum</span>(<span class="ident">st</span>) <span class="op">=</span><span class="op">></span> [<span class="string">b"d"</span>, <span class="ident">st</span>.<span class="ident">as_ref</span>()].<span class="ident">concat</span>(),
- }
- }
-
- <span class="kw">fn</span> <span class="ident">serialize_content</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span> {
- <span class="kw">match</span> <span class="self">self</span> {
- <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="kw">_</span>, <span class="prelude-val">Some</span>(<span class="ident">child</span>))) <span class="op">=</span><span class="op">></span> <span class="ident">u32</span>::<span class="ident">from</span>(<span class="kw-2">*</span><span class="ident">child</span>).<span class="ident">to_be_bytes</span>().<span class="ident">to_vec</span>(),
- <span class="ident">MapKey</span>::<span class="ident">Script</span>(<span class="prelude-val">Some</span>(<span class="ident">s</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">serialize</span>(<span class="kw-2">*</span><span class="ident">s</span>),
- <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">Some</span>(<span class="ident">s</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">serialize</span>(<span class="kw-2">*</span><span class="ident">s</span>),
- <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">Some</span>(<span class="ident">s</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">serialize</span>(<span class="kw-2">*</span><span class="ident">s</span>),
- <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">Some</span>(<span class="ident">s</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">serialize</span>(<span class="kw-2">*</span><span class="ident">s</span>),
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="macro">vec</span><span class="macro">!</span>[],
- }
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">as_map_key</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">v</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">as_prefix</span>();
- <span class="ident">v</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">serialize_content</span>());
-
- <span class="ident">v</span>
- }
-}
-
-<span class="kw">fn</span> <span class="ident">after</span>(<span class="ident">key</span>: <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">key</span>.<span class="ident">clone</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">idx</span> <span class="op">=</span> <span class="ident">key</span>.<span class="ident">len</span>();
- <span class="kw">while</span> <span class="ident">idx</span> <span class="op">></span> <span class="number">0</span> {
- <span class="kw">if</span> <span class="ident">key</span>[<span class="ident">idx</span> <span class="op">-</span> <span class="number">1</span>] <span class="op">=</span><span class="op">=</span> <span class="number">0xFF</span> {
- <span class="ident">idx</span> <span class="op">-</span><span class="op">=</span> <span class="number">1</span>;
- <span class="kw">continue</span>;
- } <span class="kw">else</span> {
- <span class="ident">key</span>[<span class="ident">idx</span> <span class="op">-</span> <span class="number">1</span>] <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
- <span class="kw">break</span>;
- }
- }
-
- <span class="ident">key</span>
-}
-
-<span class="doccomment">/// In-memory ephemeral database</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// This database can be used as a temporary storage for wallets that are not kept permanently on</span>
-<span class="doccomment">/// a device, or on platforms that don't provide a filesystem, like `wasm32`.</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// Once it's dropped its content will be lost.</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// If you are looking for a permanent storage solution, you can try with the default key-value</span>
-<span class="doccomment">/// database called [`sled`]. See the [`database`] module documentation for more defailts.</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// [`database`]: crate::database</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Default</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">MemoryDatabase</span> {
- <span class="ident">map</span>: <span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>, <span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">std</span>::<span class="ident">any</span>::<span class="ident">Any</span><span class="op">></span><span class="op">></span>,
- <span class="ident">deleted_keys</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span><span class="op">></span>,
-}
-
-<span class="kw">impl</span> <span class="ident">MemoryDatabase</span> {
- <span class="doccomment">/// Create a new empty database</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">MemoryDatabase</span> {
- <span class="ident">map</span>: <span class="ident">BTreeMap</span>::<span class="ident">new</span>(),
- <span class="ident">deleted_keys</span>: <span class="ident">Vec</span>::<span class="ident">new</span>(),
- }
- }
-}
-
-<span class="kw">impl</span> <span class="ident">BatchOperations</span> <span class="kw">for</span> <span class="ident">MemoryDatabase</span> {
- <span class="kw">fn</span> <span class="ident">set_script_pubkey</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
- <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
- <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
- <span class="ident">path</span>: <span class="ident">u32</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="prelude-val">Some</span>(<span class="ident">script_type</span>), <span class="prelude-val">Some</span>(<span class="ident">path</span>))).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">script</span>.<span class="ident">clone</span>()));
-
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Script</span>(<span class="prelude-val">Some</span>(<span class="ident">script</span>)).<span class="ident">as_map_key</span>();
- <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="macro">json</span><span class="macro">!</span>({
- <span class="string">"t"</span>: <span class="ident">script_type</span>,
- <span class="string">"p"</span>: <span class="ident">path</span>,
- });
- <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">value</span>));
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">fn</span> <span class="ident">set_utxo</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">utxo</span>: <span class="kw-2">&</span><span class="ident">UTXO</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="ident">utxo</span>.<span class="ident">outpoint</span>)).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">map</span>
- .<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">Box</span>::<span class="ident">new</span>((<span class="ident">utxo</span>.<span class="ident">txout</span>.<span class="ident">clone</span>(), <span class="ident">utxo</span>.<span class="ident">is_internal</span>)));
-
- <span class="prelude-val">Ok</span>(())
- }
- <span class="kw">fn</span> <span class="ident">set_raw_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">transaction</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="ident">transaction</span>.<span class="ident">txid</span>())).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">transaction</span>.<span class="ident">clone</span>()));
-
- <span class="prelude-val">Ok</span>(())
- }
- <span class="kw">fn</span> <span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">transaction</span>: <span class="kw-2">&</span><span class="ident">TransactionDetails</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="ident">transaction</span>.<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
-
- <span class="comment">// insert the raw_tx if present</span>
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">tx</span>) <span class="op">=</span> <span class="ident">transaction</span>.<span class="ident">transaction</span> {
- <span class="self">self</span>.<span class="ident">set_raw_tx</span>(<span class="ident">tx</span>)<span class="question-mark">?</span>;
- }
-
- <span class="comment">// remove the raw tx from the serialized version</span>
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">transaction</span> <span class="op">=</span> <span class="ident">transaction</span>.<span class="ident">clone</span>();
- <span class="ident">transaction</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">None</span>;
-
- <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">transaction</span>));
-
- <span class="prelude-val">Ok</span>(())
- }
- <span class="kw">fn</span> <span class="ident">set_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>, <span class="ident">value</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">value</span>));
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">fn</span> <span class="ident">del_script_pubkey_from_path</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
- <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
- <span class="ident">path</span>: <span class="ident">u32</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="prelude-val">Some</span>(<span class="ident">script_type</span>), <span class="prelude-val">Some</span>(<span class="ident">path</span>))).<span class="ident">as_map_key</span>();
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">key</span>);
- <span class="self">self</span>.<span class="ident">deleted_keys</span>.<span class="ident">push</span>(<span class="ident">key</span>);
-
- <span class="prelude-val">Ok</span>(<span class="ident">res</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>()))
- }
- <span class="kw">fn</span> <span class="ident">del_path_from_script_pubkey</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
- <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span>(<span class="ident">ScriptType</span>, <span class="ident">u32</span>)<span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Script</span>(<span class="prelude-val">Some</span>(<span class="ident">script</span>)).<span class="ident">as_map_key</span>();
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">key</span>);
- <span class="self">self</span>.<span class="ident">deleted_keys</span>.<span class="ident">push</span>(<span class="ident">key</span>);
-
- <span class="kw">match</span> <span class="ident">res</span> {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
- <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">serde_json</span>::<span class="ident">Value</span> <span class="op">=</span> <span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">st</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"t"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"p"</span>].<span class="ident">take</span>())<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>((<span class="ident">st</span>, <span class="ident">path</span>)))
- }
- }
- }
- <span class="kw">fn</span> <span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">outpoint</span>: <span class="kw-2">&</span><span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">Some</span>(<span class="ident">outpoint</span>)).<span class="ident">as_map_key</span>();
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">key</span>);
- <span class="self">self</span>.<span class="ident">deleted_keys</span>.<span class="ident">push</span>(<span class="ident">key</span>);
-
- <span class="kw">match</span> <span class="ident">res</span> {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
- <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> (<span class="ident">txout</span>, <span class="ident">is_internal</span>) <span class="op">=</span> <span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>();
- <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">UTXO</span> {
- <span class="ident">outpoint</span>: <span class="ident">outpoint</span>.<span class="ident">clone</span>(),
- <span class="ident">txout</span>,
- <span class="ident">is_internal</span>,
- }))
- }
- }
- }
- <span class="kw">fn</span> <span class="ident">del_raw_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">Some</span>(<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">key</span>);
- <span class="self">self</span>.<span class="ident">deleted_keys</span>.<span class="ident">push</span>(<span class="ident">key</span>);
-
- <span class="prelude-val">Ok</span>(<span class="ident">res</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>()))
- }
- <span class="kw">fn</span> <span class="ident">del_tx</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
- <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>,
- <span class="ident">include_raw</span>: <span class="ident">bool</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">raw_tx</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">include_raw</span> {
- <span class="self">self</span>.<span class="ident">del_raw_tx</span>(<span class="ident">txid</span>)<span class="question-mark">?</span>
- } <span class="kw">else</span> {
- <span class="prelude-val">None</span>
- };
-
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">Some</span>(<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">key</span>);
- <span class="self">self</span>.<span class="ident">deleted_keys</span>.<span class="ident">push</span>(<span class="ident">key</span>);
-
- <span class="kw">match</span> <span class="ident">res</span> {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
- <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">TransactionDetails</span> <span class="op">=</span> <span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>();
- <span class="ident">val</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="ident">raw_tx</span>;
-
- <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">val</span>))
- }
- }
- }
- <span class="kw">fn</span> <span class="ident">del_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">key</span>);
- <span class="self">self</span>.<span class="ident">deleted_keys</span>.<span class="ident">push</span>(<span class="ident">key</span>);
-
- <span class="kw">match</span> <span class="ident">res</span> {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
- <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="kw-2">*</span><span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">unwrap</span>())),
- }
- }
-}
-
-<span class="kw">impl</span> <span class="ident">Database</span> <span class="kw">for</span> <span class="ident">MemoryDatabase</span> {
- <span class="kw">fn</span> <span class="ident">check_descriptor_checksum</span><span class="op"><</span><span class="ident">B</span>: <span class="ident">AsRef</span><span class="op"><</span>[<span class="ident">u8</span>]<span class="op">></span><span class="op">></span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
- <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
- <span class="ident">bytes</span>: <span class="ident">B</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">DescriptorChecksum</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
-
- <span class="kw">let</span> <span class="ident">prev</span> <span class="op">=</span> <span class="self">self</span>
- .<span class="ident">map</span>
- .<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key</span>)
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span>.<span class="ident">downcast_ref</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span><span class="op">></span>().<span class="ident">unwrap</span>());
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">val</span>) <span class="op">=</span> <span class="ident">prev</span> {
- <span class="kw">if</span> <span class="ident">val</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">bytes</span>.<span class="ident">as_ref</span>().<span class="ident">to_vec</span>() {
- <span class="prelude-val">Ok</span>(())
- } <span class="kw">else</span> {
- <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">ChecksumMismatch</span>)
- }
- } <span class="kw">else</span> {
- <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">bytes</span>.<span class="ident">as_ref</span>().<span class="ident">to_vec</span>()));
- <span class="prelude-val">Ok</span>(())
- }
- }
-
- <span class="kw">fn</span> <span class="ident">iter_script_pubkeys</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script_type</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">ScriptType</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="ident">script_type</span>, <span class="prelude-val">None</span>)).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">map</span>
- .<span class="ident">range</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>, <span class="kw">_</span><span class="op">></span>((<span class="ident">Included</span>(<span class="kw-2">&</span><span class="ident">key</span>), <span class="ident">Excluded</span>(<span class="kw-2">&</span><span class="ident">after</span>(<span class="kw-2">&</span><span class="ident">key</span>))))
- .<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">v</span>)<span class="op">|</span> <span class="prelude-val">Ok</span>(<span class="ident">v</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>()))
- .<span class="ident">collect</span>()
- }
-
- <span class="kw">fn</span> <span class="ident">iter_utxos</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">None</span>).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">map</span>
- .<span class="ident">range</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>, <span class="kw">_</span><span class="op">></span>((<span class="ident">Included</span>(<span class="kw-2">&</span><span class="ident">key</span>), <span class="ident">Excluded</span>(<span class="kw-2">&</span><span class="ident">after</span>(<span class="kw-2">&</span><span class="ident">key</span>))))
- .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="ident">v</span>)<span class="op">|</span> {
- <span class="kw">let</span> <span class="ident">outpoint</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">k</span>[<span class="number">1</span>..]).<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">txout</span>, <span class="ident">is_internal</span>) <span class="op">=</span> <span class="ident">v</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>();
- <span class="prelude-val">Ok</span>(<span class="ident">UTXO</span> {
- <span class="ident">outpoint</span>,
- <span class="ident">txout</span>,
- <span class="ident">is_internal</span>,
- })
- })
- .<span class="ident">collect</span>()
- }
-
- <span class="kw">fn</span> <span class="ident">iter_raw_txs</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">None</span>).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">map</span>
- .<span class="ident">range</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>, <span class="kw">_</span><span class="op">></span>((<span class="ident">Included</span>(<span class="kw-2">&</span><span class="ident">key</span>), <span class="ident">Excluded</span>(<span class="kw-2">&</span><span class="ident">after</span>(<span class="kw-2">&</span><span class="ident">key</span>))))
- .<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">v</span>)<span class="op">|</span> <span class="prelude-val">Ok</span>(<span class="ident">v</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>()))
- .<span class="ident">collect</span>()
- }
-
- <span class="kw">fn</span> <span class="ident">iter_txs</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">include_raw</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">None</span>).<span class="ident">as_map_key</span>();
- <span class="self">self</span>.<span class="ident">map</span>
- .<span class="ident">range</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>, <span class="kw">_</span><span class="op">></span>((<span class="ident">Included</span>(<span class="kw-2">&</span><span class="ident">key</span>), <span class="ident">Excluded</span>(<span class="kw-2">&</span><span class="ident">after</span>(<span class="kw-2">&</span><span class="ident">key</span>))))
- .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">k</span>, <span class="ident">v</span>)<span class="op">|</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">txdetails</span>: <span class="ident">TransactionDetails</span> <span class="op">=</span> <span class="ident">v</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>();
- <span class="kw">if</span> <span class="ident">include_raw</span> {
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">k</span>[<span class="number">1</span>..])<span class="question-mark">?</span>;
- <span class="ident">txdetails</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="ident">txid</span>)<span class="question-mark">?</span>;
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">txdetails</span>)
- })
- .<span class="ident">collect</span>()
- }
-
- <span class="kw">fn</span> <span class="ident">get_script_pubkey_from_path</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
- <span class="ident">path</span>: <span class="ident">u32</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Path</span>((<span class="prelude-val">Some</span>(<span class="ident">script_type</span>), <span class="prelude-val">Some</span>(<span class="ident">path</span>))).<span class="ident">as_map_key</span>();
- <span class="prelude-val">Ok</span>(<span class="self">self</span>
- .<span class="ident">map</span>
- .<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key</span>)
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>()))
- }
-
- <span class="kw">fn</span> <span class="ident">get_path_from_script_pubkey</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span>(<span class="ident">ScriptType</span>, <span class="ident">u32</span>)<span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Script</span>(<span class="prelude-val">Some</span>(<span class="ident">script</span>)).<span class="ident">as_map_key</span>();
- <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">map</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key</span>).<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">val</span>: <span class="ident">serde_json</span>::<span class="ident">Value</span> <span class="op">=</span> <span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">st</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"t"</span>].<span class="ident">take</span>()).<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_value</span>(<span class="ident">val</span>[<span class="string">"p"</span>].<span class="ident">take</span>()).<span class="ident">unwrap</span>();
-
- (<span class="ident">st</span>, <span class="ident">path</span>)
- }))
- }
-
- <span class="kw">fn</span> <span class="ident">get_utxo</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">outpoint</span>: <span class="kw-2">&</span><span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">UTXO</span>(<span class="prelude-val">Some</span>(<span class="ident">outpoint</span>)).<span class="ident">as_map_key</span>();
- <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">map</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key</span>).<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> {
- <span class="kw">let</span> (<span class="ident">txout</span>, <span class="ident">is_internal</span>) <span class="op">=</span> <span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>();
- <span class="ident">UTXO</span> {
- <span class="ident">outpoint</span>: <span class="ident">outpoint</span>.<span class="ident">clone</span>(),
- <span class="ident">txout</span>,
- <span class="ident">is_internal</span>,
- }
- }))
- }
-
- <span class="kw">fn</span> <span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">RawTx</span>(<span class="prelude-val">Some</span>(<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
- <span class="prelude-val">Ok</span>(<span class="self">self</span>
- .<span class="ident">map</span>
- .<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key</span>)
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>()))
- }
-
- <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>, <span class="ident">include_raw</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">Transaction</span>(<span class="prelude-val">Some</span>(<span class="ident">txid</span>)).<span class="ident">as_map_key</span>();
- <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">map</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key</span>).<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">txdetails</span>: <span class="ident">TransactionDetails</span> <span class="op">=</span> <span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">cloned</span>().<span class="ident">unwrap</span>();
- <span class="kw">if</span> <span class="ident">include_raw</span> {
- <span class="ident">txdetails</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="ident">txid</span>).<span class="ident">unwrap</span>();
- }
-
- <span class="ident">txdetails</span>
- }))
- }
-
- <span class="kw">fn</span> <span class="ident">get_last_index</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
- <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">map</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key</span>).<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="kw-2">*</span><span class="ident">b</span>.<span class="ident">downcast_ref</span>().<span class="ident">unwrap</span>()))
- }
-
- <span class="comment">// inserts 0 if not present</span>
- <span class="kw">fn</span> <span class="ident">increment_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MapKey</span>::<span class="ident">LastIndex</span>(<span class="ident">script_type</span>).<span class="ident">as_map_key</span>();
- <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="self">self</span>
- .<span class="ident">map</span>
- .<span class="ident">entry</span>(<span class="ident">key</span>.<span class="ident">clone</span>())
- .<span class="ident">and_modify</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="kw-2">*</span><span class="ident">x</span>.<span class="ident">downcast_mut</span>::<span class="op"><</span><span class="ident">u32</span><span class="op">></span>().<span class="ident">unwrap</span>() <span class="op">+</span><span class="op">=</span> <span class="number">1</span>)
- .<span class="ident">or_insert</span>(<span class="ident">Box</span>::<span class="op"><</span><span class="ident">u32</span><span class="op">></span>::<span class="ident">new</span>(<span class="number">0</span>))
- .<span class="ident">downcast_mut</span>()
- .<span class="ident">unwrap</span>();
-
- <span class="prelude-val">Ok</span>(<span class="kw-2">*</span><span class="ident">value</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">BatchDatabase</span> <span class="kw">for</span> <span class="ident">MemoryDatabase</span> {
- <span class="kw">type</span> <span class="ident">Batch</span> <span class="op">=</span> <span class="self">Self</span>;
-
- <span class="kw">fn</span> <span class="ident">begin_batch</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span>::<span class="ident">Batch</span> {
- <span class="ident">MemoryDatabase</span>::<span class="ident">new</span>()
- }
-
- <span class="kw">fn</span> <span class="ident">commit_batch</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="kw-2">mut</span> <span class="ident">batch</span>: <span class="self">Self</span>::<span class="ident">Batch</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">for</span> <span class="ident">key</span> <span class="kw">in</span> <span class="ident">batch</span>.<span class="ident">deleted_keys</span> {
- <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">key</span>);
- }
-
- <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">map</span>.<span class="ident">append</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">batch</span>.<span class="ident">map</span>))
- }
-}
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="kw">impl</span> <span class="ident">MemoryDatabase</span> {
- <span class="comment">// Artificially insert a tx in the database, as if we had found it with a `sync`</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">received_tx</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
- <span class="ident">tx_meta</span>: <span class="ident">testutils</span>::<span class="ident">TestIncomingTx</span>,
- <span class="ident">current_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="ident">bitcoin</span>::<span class="ident">Txid</span> {
- <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
-
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">Transaction</span> {
- <span class="ident">version</span>: <span class="number">1</span>,
- <span class="ident">lock_time</span>: <span class="number">0</span>,
- <span class="ident">input</span>: <span class="macro">vec</span><span class="macro">!</span>[],
- <span class="ident">output</span>: <span class="ident">tx_meta</span>
- .<span class="ident">output</span>
- .<span class="ident">iter</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">out_meta</span><span class="op">|</span> <span class="ident">bitcoin</span>::<span class="ident">TxOut</span> {
- <span class="ident">value</span>: <span class="ident">out_meta</span>.<span class="ident">value</span>,
- <span class="ident">script_pubkey</span>: <span class="ident">bitcoin</span>::<span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="kw-2">&</span><span class="ident">out_meta</span>.<span class="ident">to_address</span>)
- .<span class="ident">unwrap</span>()
- .<span class="ident">script_pubkey</span>(),
- })
- .<span class="ident">collect</span>(),
- };
-
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
- <span class="kw">let</span> <span class="ident">height</span> <span class="op">=</span> <span class="ident">tx_meta</span>
- .<span class="ident">min_confirmations</span>
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">conf</span><span class="op">|</span> <span class="ident">current_height</span>.<span class="ident">unwrap</span>().<span class="ident">checked_sub</span>(<span class="ident">conf</span> <span class="kw">as</span> <span class="ident">u32</span>).<span class="ident">unwrap</span>());
-
- <span class="kw">let</span> <span class="ident">tx_details</span> <span class="op">=</span> <span class="ident">TransactionDetails</span> {
- <span class="ident">transaction</span>: <span class="prelude-val">Some</span>(<span class="ident">tx</span>.<span class="ident">clone</span>()),
- <span class="ident">txid</span>,
- <span class="ident">timestamp</span>: <span class="number">0</span>,
- <span class="ident">height</span>,
- <span class="ident">received</span>: <span class="number">0</span>,
- <span class="ident">sent</span>: <span class="number">0</span>,
- <span class="ident">fees</span>: <span class="number">0</span>,
- };
-
- <span class="self">self</span>.<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">tx_details</span>).<span class="ident">unwrap</span>();
- <span class="kw">for</span> (<span class="ident">vout</span>, <span class="ident">out</span>) <span class="kw">in</span> <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
- <span class="self">self</span>.<span class="ident">set_utxo</span>(<span class="kw-2">&</span><span class="ident">UTXO</span> {
- <span class="ident">txout</span>: <span class="ident">out</span>.<span class="ident">clone</span>(),
- <span class="ident">outpoint</span>: <span class="ident">OutPoint</span> {
- <span class="ident">txid</span>,
- <span class="ident">vout</span>: <span class="ident">vout</span> <span class="kw">as</span> <span class="ident">u32</span>,
- },
- <span class="ident">is_internal</span>: <span class="bool-val">false</span>,
- })
- .<span class="ident">unwrap</span>();
- }
-
- <span class="ident">txid</span>
- }
-}
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="kw">mod</span> <span class="ident">test</span> {
- <span class="kw">use</span> <span class="kw">super</span>::<span class="ident">MemoryDatabase</span>;
-
- <span class="kw">fn</span> <span class="ident">get_tree</span>() <span class="op">-</span><span class="op">></span> <span class="ident">MemoryDatabase</span> {
- <span class="ident">MemoryDatabase</span>::<span class="ident">new</span>()
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_script_pubkey</span>() {
- <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_script_pubkey</span>(<span class="ident">get_tree</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_batch_script_pubkey</span>() {
- <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_batch_script_pubkey</span>(<span class="ident">get_tree</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_iter_script_pubkey</span>() {
- <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_iter_script_pubkey</span>(<span class="ident">get_tree</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_del_script_pubkey</span>() {
- <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_del_script_pubkey</span>(<span class="ident">get_tree</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_utxo</span>() {
- <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_utxo</span>(<span class="ident">get_tree</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_raw_tx</span>() {
- <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_raw_tx</span>(<span class="ident">get_tree</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_tx</span>() {
- <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_tx</span>(<span class="ident">get_tree</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_last_index</span>() {
- <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">test</span>::<span class="ident">test_last_index</span>(<span class="ident">get_tree</span>());
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/database/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-<span id="203">203</span>
-<span id="204">204</span>
-<span id="205">205</span>
-<span id="206">206</span>
-<span id="207">207</span>
-<span id="208">208</span>
-<span id="209">209</span>
-<span id="210">210</span>
-<span id="211">211</span>
-<span id="212">212</span>
-<span id="213">213</span>
-<span id="214">214</span>
-<span id="215">215</span>
-<span id="216">216</span>
-<span id="217">217</span>
-<span id="218">218</span>
-<span id="219">219</span>
-<span id="220">220</span>
-<span id="221">221</span>
-<span id="222">222</span>
-<span id="223">223</span>
-<span id="224">224</span>
-<span id="225">225</span>
-<span id="226">226</span>
-<span id="227">227</span>
-<span id="228">228</span>
-<span id="229">229</span>
-<span id="230">230</span>
-<span id="231">231</span>
-<span id="232">232</span>
-<span id="233">233</span>
-<span id="234">234</span>
-<span id="235">235</span>
-<span id="236">236</span>
-<span id="237">237</span>
-<span id="238">238</span>
-<span id="239">239</span>
-<span id="240">240</span>
-<span id="241">241</span>
-<span id="242">242</span>
-<span id="243">243</span>
-<span id="244">244</span>
-<span id="245">245</span>
-<span id="246">246</span>
-<span id="247">247</span>
-<span id="248">248</span>
-<span id="249">249</span>
-<span id="250">250</span>
-<span id="251">251</span>
-<span id="252">252</span>
-<span id="253">253</span>
-<span id="254">254</span>
-<span id="255">255</span>
-<span id="256">256</span>
-<span id="257">257</span>
-<span id="258">258</span>
-<span id="259">259</span>
-<span id="260">260</span>
-<span id="261">261</span>
-<span id="262">262</span>
-<span id="263">263</span>
-<span id="264">264</span>
-<span id="265">265</span>
-<span id="266">266</span>
-<span id="267">267</span>
-<span id="268">268</span>
-<span id="269">269</span>
-<span id="270">270</span>
-<span id="271">271</span>
-<span id="272">272</span>
-<span id="273">273</span>
-<span id="274">274</span>
-<span id="275">275</span>
-<span id="276">276</span>
-<span id="277">277</span>
-<span id="278">278</span>
-<span id="279">279</span>
-<span id="280">280</span>
-<span id="281">281</span>
-<span id="282">282</span>
-<span id="283">283</span>
-<span id="284">284</span>
-<span id="285">285</span>
-<span id="286">286</span>
-<span id="287">287</span>
-<span id="288">288</span>
-<span id="289">289</span>
-<span id="290">290</span>
-<span id="291">291</span>
-<span id="292">292</span>
-<span id="293">293</span>
-<span id="294">294</span>
-<span id="295">295</span>
-<span id="296">296</span>
-<span id="297">297</span>
-<span id="298">298</span>
-<span id="299">299</span>
-<span id="300">300</span>
-<span id="301">301</span>
-<span id="302">302</span>
-<span id="303">303</span>
-<span id="304">304</span>
-<span id="305">305</span>
-<span id="306">306</span>
-<span id="307">307</span>
-<span id="308">308</span>
-<span id="309">309</span>
-<span id="310">310</span>
-<span id="311">311</span>
-<span id="312">312</span>
-<span id="313">313</span>
-<span id="314">314</span>
-<span id="315">315</span>
-<span id="316">316</span>
-<span id="317">317</span>
-<span id="318">318</span>
-<span id="319">319</span>
-<span id="320">320</span>
-<span id="321">321</span>
-<span id="322">322</span>
-<span id="323">323</span>
-<span id="324">324</span>
-<span id="325">325</span>
-<span id="326">326</span>
-<span id="327">327</span>
-<span id="328">328</span>
-<span id="329">329</span>
-<span id="330">330</span>
-<span id="331">331</span>
-<span id="332">332</span>
-<span id="333">333</span>
-<span id="334">334</span>
-<span id="335">335</span>
-<span id="336">336</span>
-<span id="337">337</span>
-<span id="338">338</span>
-<span id="339">339</span>
-<span id="340">340</span>
-<span id="341">341</span>
-<span id="342">342</span>
-<span id="343">343</span>
-<span id="344">344</span>
-<span id="345">345</span>
-<span id="346">346</span>
-<span id="347">347</span>
-<span id="348">348</span>
-<span id="349">349</span>
-<span id="350">350</span>
-<span id="351">351</span>
-<span id="352">352</span>
-<span id="353">353</span>
-<span id="354">354</span>
-<span id="355">355</span>
-<span id="356">356</span>
-<span id="357">357</span>
-<span id="358">358</span>
-<span id="359">359</span>
-<span id="360">360</span>
-<span id="361">361</span>
-<span id="362">362</span>
-<span id="363">363</span>
-<span id="364">364</span>
-<span id="365">365</span>
-<span id="366">366</span>
-<span id="367">367</span>
-<span id="368">368</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="doccomment">//! Database types</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! This module provides the implementation of some defaults database types, along with traits that</span>
-<span class="doccomment">//! can be implemented externally to let [`Wallet`]s use customized databases.</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! It's important to note that the databases defined here only contains "blockchain-related" data.</span>
-<span class="doccomment">//! They can be seen more as a cache than a critical piece of storage that contains secrets and</span>
-<span class="doccomment">//! keys.</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! The currently recommended database is [`sled`], which is a pretty simple key-value embedded</span>
-<span class="doccomment">//! database written in Rust. If the `key-value-db` feature is enabled (which by default is),</span>
-<span class="doccomment">//! this library automatically implements all the required traits for [`sled::Tree`].</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! [`Wallet`]: crate::wallet::Wallet</span>
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hash_types</span>::<span class="ident">Txid</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">OutPoint</span>, <span class="ident">Script</span>, <span class="ident">Transaction</span>, <span class="ident">TxOut</span>};
-
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="kw-2">*</span>;
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"key-value-db"</span>)]</span>
-<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">mod</span> <span class="ident">keyvalue</span>;
-
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">memory</span>;
-<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">memory</span>::<span class="ident">MemoryDatabase</span>;
-
-<span class="doccomment">/// Trait for operations that can be batched</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// This trait defines the list of operations that must be implemented on the [`Database`] type and</span>
-<span class="doccomment">/// the [`BatchDatabase::Batch`] type.</span>
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">BatchOperations</span> {
- <span class="doccomment">/// Store a script_pubkey along with its script type and child number</span>
- <span class="kw">fn</span> <span class="ident">set_script_pubkey</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
- <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
- <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
- <span class="ident">child</span>: <span class="ident">u32</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Store a [`UTXO`]</span>
- <span class="kw">fn</span> <span class="ident">set_utxo</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">utxo</span>: <span class="kw-2">&</span><span class="ident">UTXO</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Store a raw transaction</span>
- <span class="kw">fn</span> <span class="ident">set_raw_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">transaction</span>: <span class="kw-2">&</span><span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Store the metadata of a transaction</span>
- <span class="kw">fn</span> <span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">transaction</span>: <span class="kw-2">&</span><span class="ident">TransactionDetails</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Store the last derivation index for a given script type</span>
- <span class="kw">fn</span> <span class="ident">set_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>, <span class="ident">value</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
-
- <span class="doccomment">/// Delete a script_pubkey given the script type and its child number</span>
- <span class="kw">fn</span> <span class="ident">del_script_pubkey_from_path</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
- <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
- <span class="ident">child</span>: <span class="ident">u32</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Delete the data related to a specific script_pubkey, meaning the script type and the child</span>
- <span class="doccomment">/// number</span>
- <span class="kw">fn</span> <span class="ident">del_path_from_script_pubkey</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
- <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span>(<span class="ident">ScriptType</span>, <span class="ident">u32</span>)<span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Delete a [`UTXO`] given its [`OutPoint`]</span>
- <span class="kw">fn</span> <span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">outpoint</span>: <span class="kw-2">&</span><span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Delete a raw transaction given its [`Txid`]</span>
- <span class="kw">fn</span> <span class="ident">del_raw_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Delete the metadata of a transaction and optionally the raw transaction itself</span>
- <span class="kw">fn</span> <span class="ident">del_tx</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
- <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>,
- <span class="ident">include_raw</span>: <span class="ident">bool</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Delete the last derivation index for a script type</span>
- <span class="kw">fn</span> <span class="ident">del_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
-}
-
-<span class="doccomment">/// Trait for reading data from a database</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// This traits defines the operations that can be used to read data out of a database</span>
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">Database</span>: <span class="ident">BatchOperations</span> {
- <span class="doccomment">/// Read and checks the descriptor checksum for a given script type</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// Should return [`Error::ChecksumMismatch`](crate::error::Error::ChecksumMismatch) if the</span>
- <span class="doccomment">/// checksum doesn't match. If there's no checksum in the database, simply store it for the</span>
- <span class="doccomment">/// next time.</span>
- <span class="kw">fn</span> <span class="ident">check_descriptor_checksum</span><span class="op"><</span><span class="ident">B</span>: <span class="ident">AsRef</span><span class="op"><</span>[<span class="ident">u8</span>]<span class="op">></span><span class="op">></span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
- <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
- <span class="ident">bytes</span>: <span class="ident">B</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
-
- <span class="doccomment">/// Return the list of script_pubkeys</span>
- <span class="kw">fn</span> <span class="ident">iter_script_pubkeys</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script_type</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">ScriptType</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Return the list of [`UTXO`]s</span>
- <span class="kw">fn</span> <span class="ident">iter_utxos</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Return the list of raw transactions</span>
- <span class="kw">fn</span> <span class="ident">iter_raw_txs</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Return the list of transactions metadata</span>
- <span class="kw">fn</span> <span class="ident">iter_txs</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">include_raw</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
-
- <span class="doccomment">/// Fetch a script_pubkey given the script type and child number</span>
- <span class="kw">fn</span> <span class="ident">get_script_pubkey_from_path</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
- <span class="ident">child</span>: <span class="ident">u32</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Fetch the script type and child number of a given script_pubkey</span>
- <span class="kw">fn</span> <span class="ident">get_path_from_script_pubkey</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span>(<span class="ident">ScriptType</span>, <span class="ident">u32</span>)<span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Fetch a [`UTXO`] given its [`OutPoint`]</span>
- <span class="kw">fn</span> <span class="ident">get_utxo</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">outpoint</span>: <span class="kw-2">&</span><span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Fetch a raw transaction given its [`Txid`]</span>
- <span class="kw">fn</span> <span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Fetch the transaction metadata and optionally also the raw transaction</span>
- <span class="kw">fn</span> <span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>, <span class="ident">include_raw</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
- <span class="doccomment">/// Return the last defivation index for a script type</span>
- <span class="kw">fn</span> <span class="ident">get_last_index</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
-
- <span class="doccomment">/// Increment the last derivation index for a script type and returns it</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// It should insert and return `0` if not present in the database</span>
- <span class="kw">fn</span> <span class="ident">increment_last_index</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span>;
-}
-
-<span class="doccomment">/// Trait for a database that supports batch operations</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// This trait defines the methods to start and apply a batch of operations.</span>
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">BatchDatabase</span>: <span class="ident">Database</span> {
- <span class="doccomment">/// Container for the operations</span>
- <span class="kw">type</span> <span class="ident">Batch</span>: <span class="ident">BatchOperations</span>;
-
- <span class="doccomment">/// Create a new batch container</span>
- <span class="kw">fn</span> <span class="ident">begin_batch</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span>::<span class="ident">Batch</span>;
- <span class="doccomment">/// Consume and apply a batch of operations</span>
- <span class="kw">fn</span> <span class="ident">commit_batch</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">batch</span>: <span class="self">Self</span>::<span class="ident">Batch</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span>;
-}
-
-<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">trait</span> <span class="ident">DatabaseUtils</span>: <span class="ident">Database</span> {
- <span class="kw">fn</span> <span class="ident">is_mine</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">bool</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="self">self</span>.<span class="ident">get_path_from_script_pubkey</span>(<span class="ident">script</span>)
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">o</span><span class="op">|</span> <span class="ident">o</span>.<span class="ident">is_some</span>())
- }
-
- <span class="kw">fn</span> <span class="ident">get_raw_tx_or</span><span class="op"><</span><span class="ident">F</span><span class="op">></span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>, <span class="ident">f</span>: <span class="ident">F</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>
- <span class="kw">where</span>
- <span class="ident">F</span>: <span class="ident">FnOnce</span>() <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>,
- {
- <span class="self">self</span>.<span class="ident">get_tx</span>(<span class="ident">txid</span>, <span class="bool-val">true</span>)<span class="question-mark">?</span>
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">t</span><span class="op">|</span> <span class="ident">t</span>.<span class="ident">transaction</span>)
- .<span class="ident">flatten</span>()
- .<span class="ident">map_or_else</span>(<span class="ident">f</span>, <span class="op">|</span><span class="ident">t</span><span class="op">|</span> <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">t</span>)))
- }
-
- <span class="kw">fn</span> <span class="ident">get_previous_output</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">outpoint</span>: <span class="kw-2">&</span><span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TxOut</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="self">self</span>.<span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="ident">outpoint</span>.<span class="ident">txid</span>)<span class="question-mark">?</span>
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">previous_tx</span><span class="op">|</span> {
- <span class="kw">if</span> <span class="ident">outpoint</span>.<span class="ident">vout</span> <span class="kw">as</span> <span class="ident">usize</span> <span class="op">></span><span class="op">=</span> <span class="ident">previous_tx</span>.<span class="ident">output</span>.<span class="ident">len</span>() {
- <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">InvalidOutpoint</span>(<span class="ident">outpoint</span>.<span class="ident">clone</span>()))
- } <span class="kw">else</span> {
- <span class="prelude-val">Ok</span>(<span class="ident">previous_tx</span>.<span class="ident">output</span>[<span class="ident">outpoint</span>.<span class="ident">vout</span> <span class="kw">as</span> <span class="ident">usize</span>].<span class="ident">clone</span>())
- }
- })
- .<span class="ident">transpose</span>()
- }
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">Database</span><span class="op">></span> <span class="ident">DatabaseUtils</span> <span class="kw">for</span> <span class="ident">T</span> {}
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">test</span> {
- <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
-
- <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">deserialize</span>;
- <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="kw-2">*</span>;
- <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="kw-2">*</span>;
-
- <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test_script_pubkey</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">tree</span>: <span class="ident">D</span>) {
- <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="ident">Script</span>::<span class="ident">from</span>(
- <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"76a91402306a7c23f3e8010de41e9e591348bb83f11daa88ac"</span>).<span class="ident">unwrap</span>(),
- );
- <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="number">42</span>;
- <span class="kw">let</span> <span class="ident">script_type</span> <span class="op">=</span> <span class="ident">ScriptType</span>::<span class="ident">External</span>;
-
- <span class="ident">tree</span>.<span class="ident">set_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">script</span>, <span class="ident">script_type</span>, <span class="ident">path</span>).<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tree</span>.<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">script_type</span>, <span class="ident">path</span>).<span class="ident">unwrap</span>(),
- <span class="prelude-val">Some</span>(<span class="ident">script</span>.<span class="ident">clone</span>())
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tree</span>.<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">script</span>).<span class="ident">unwrap</span>(),
- <span class="prelude-val">Some</span>((<span class="ident">script_type</span>, <span class="ident">path</span>.<span class="ident">clone</span>()))
- );
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test_batch_script_pubkey</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">tree</span>: <span class="ident">D</span>) {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">tree</span>.<span class="ident">begin_batch</span>();
-
- <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="ident">Script</span>::<span class="ident">from</span>(
- <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"76a91402306a7c23f3e8010de41e9e591348bb83f11daa88ac"</span>).<span class="ident">unwrap</span>(),
- );
- <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="number">42</span>;
- <span class="kw">let</span> <span class="ident">script_type</span> <span class="op">=</span> <span class="ident">ScriptType</span>::<span class="ident">External</span>;
-
- <span class="ident">batch</span>.<span class="ident">set_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">script</span>, <span class="ident">script_type</span>, <span class="ident">path</span>).<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tree</span>.<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">script_type</span>, <span class="ident">path</span>).<span class="ident">unwrap</span>(),
- <span class="prelude-val">None</span>
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tree</span>.<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">script</span>).<span class="ident">unwrap</span>(), <span class="prelude-val">None</span>);
-
- <span class="ident">tree</span>.<span class="ident">commit_batch</span>(<span class="ident">batch</span>).<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tree</span>.<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">script_type</span>, <span class="ident">path</span>).<span class="ident">unwrap</span>(),
- <span class="prelude-val">Some</span>(<span class="ident">script</span>.<span class="ident">clone</span>())
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tree</span>.<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">script</span>).<span class="ident">unwrap</span>(),
- <span class="prelude-val">Some</span>((<span class="ident">script_type</span>, <span class="ident">path</span>.<span class="ident">clone</span>()))
- );
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test_iter_script_pubkey</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">tree</span>: <span class="ident">D</span>) {
- <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="ident">Script</span>::<span class="ident">from</span>(
- <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"76a91402306a7c23f3e8010de41e9e591348bb83f11daa88ac"</span>).<span class="ident">unwrap</span>(),
- );
- <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="number">42</span>;
- <span class="kw">let</span> <span class="ident">script_type</span> <span class="op">=</span> <span class="ident">ScriptType</span>::<span class="ident">External</span>;
-
- <span class="ident">tree</span>.<span class="ident">set_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">script</span>, <span class="ident">script_type</span>, <span class="ident">path</span>).<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tree</span>.<span class="ident">iter_script_pubkeys</span>(<span class="prelude-val">None</span>).<span class="ident">unwrap</span>().<span class="ident">len</span>(), <span class="number">1</span>);
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test_del_script_pubkey</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">tree</span>: <span class="ident">D</span>) {
- <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="ident">Script</span>::<span class="ident">from</span>(
- <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"76a91402306a7c23f3e8010de41e9e591348bb83f11daa88ac"</span>).<span class="ident">unwrap</span>(),
- );
- <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="number">42</span>;
- <span class="kw">let</span> <span class="ident">script_type</span> <span class="op">=</span> <span class="ident">ScriptType</span>::<span class="ident">External</span>;
-
- <span class="ident">tree</span>.<span class="ident">set_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">script</span>, <span class="ident">script_type</span>, <span class="ident">path</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tree</span>.<span class="ident">iter_script_pubkeys</span>(<span class="prelude-val">None</span>).<span class="ident">unwrap</span>().<span class="ident">len</span>(), <span class="number">1</span>);
-
- <span class="ident">tree</span>.<span class="ident">del_script_pubkey_from_path</span>(<span class="ident">script_type</span>, <span class="ident">path</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tree</span>.<span class="ident">iter_script_pubkeys</span>(<span class="prelude-val">None</span>).<span class="ident">unwrap</span>().<span class="ident">len</span>(), <span class="number">0</span>);
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test_utxo</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">tree</span>: <span class="ident">D</span>) {
- <span class="kw">let</span> <span class="ident">outpoint</span> <span class="op">=</span> <span class="ident">OutPoint</span>::<span class="ident">from_str</span>(
- <span class="string">"5df6e0e2761359d30a8275058e299fcc0381534545f55cf43e41983f5d4c9456:0"</span>,
- )
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="ident">Script</span>::<span class="ident">from</span>(
- <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"76a91402306a7c23f3e8010de41e9e591348bb83f11daa88ac"</span>).<span class="ident">unwrap</span>(),
- );
- <span class="kw">let</span> <span class="ident">txout</span> <span class="op">=</span> <span class="ident">TxOut</span> {
- <span class="ident">value</span>: <span class="number">133742</span>,
- <span class="ident">script_pubkey</span>: <span class="ident">script</span>,
- };
- <span class="kw">let</span> <span class="ident">utxo</span> <span class="op">=</span> <span class="ident">UTXO</span> {
- <span class="ident">txout</span>,
- <span class="ident">outpoint</span>,
- <span class="ident">is_internal</span>: <span class="bool-val">false</span>,
- };
-
- <span class="ident">tree</span>.<span class="ident">set_utxo</span>(<span class="kw-2">&</span><span class="ident">utxo</span>).<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tree</span>.<span class="ident">get_utxo</span>(<span class="kw-2">&</span><span class="ident">outpoint</span>).<span class="ident">unwrap</span>(), <span class="prelude-val">Some</span>(<span class="ident">utxo</span>));
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test_raw_tx</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">tree</span>: <span class="ident">D</span>) {
- <span class="kw">let</span> <span class="ident">hex_tx</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"0100000001a15d57094aa7a21a28cb20b59aab8fc7d1149a3bdbcddba9c622e4f5f6a99ece010000006c493046022100f93bb0e7d8db7bd46e40132d1f8242026e045f03a0efe71bbb8e3f475e970d790221009337cd7f1f929f00cc6ff01f03729b069a7c21b59b1736ddfee5db5946c5da8c0121033b9b137ee87d5a812d6f506efdd37f0affa7ffc310711c06c7f3e097c9447c52ffffffff0100e1f505000000001976a9140389035a9225b3839e2bbf32d826a1e222031fd888ac00000000"</span>).<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">tx</span>: <span class="ident">Transaction</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">hex_tx</span>).<span class="ident">unwrap</span>();
-
- <span class="ident">tree</span>.<span class="ident">set_raw_tx</span>(<span class="kw-2">&</span><span class="ident">tx</span>).<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tree</span>.<span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="ident">txid</span>).<span class="ident">unwrap</span>(), <span class="prelude-val">Some</span>(<span class="ident">tx</span>));
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test_tx</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">tree</span>: <span class="ident">D</span>) {
- <span class="kw">let</span> <span class="ident">hex_tx</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="string">"0100000001a15d57094aa7a21a28cb20b59aab8fc7d1149a3bdbcddba9c622e4f5f6a99ece010000006c493046022100f93bb0e7d8db7bd46e40132d1f8242026e045f03a0efe71bbb8e3f475e970d790221009337cd7f1f929f00cc6ff01f03729b069a7c21b59b1736ddfee5db5946c5da8c0121033b9b137ee87d5a812d6f506efdd37f0affa7ffc310711c06c7f3e097c9447c52ffffffff0100e1f505000000001976a9140389035a9225b3839e2bbf32d826a1e222031fd888ac00000000"</span>).<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">tx</span>: <span class="ident">Transaction</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">hex_tx</span>).<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx_details</span> <span class="op">=</span> <span class="ident">TransactionDetails</span> {
- <span class="ident">transaction</span>: <span class="prelude-val">Some</span>(<span class="ident">tx</span>),
- <span class="ident">txid</span>,
- <span class="ident">timestamp</span>: <span class="number">123456</span>,
- <span class="ident">received</span>: <span class="number">1337</span>,
- <span class="ident">sent</span>: <span class="number">420420</span>,
- <span class="ident">fees</span>: <span class="number">140</span>,
- <span class="ident">height</span>: <span class="prelude-val">Some</span>(<span class="number">1000</span>),
- };
-
- <span class="ident">tree</span>.<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">tx_details</span>).<span class="ident">unwrap</span>();
-
- <span class="comment">// get with raw tx too</span>
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tree</span>.<span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="ident">tx_details</span>.<span class="ident">txid</span>, <span class="bool-val">true</span>).<span class="ident">unwrap</span>(),
- <span class="prelude-val">Some</span>(<span class="ident">tx_details</span>.<span class="ident">clone</span>())
- );
- <span class="comment">// get only raw_tx</span>
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tree</span>.<span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="ident">tx_details</span>.<span class="ident">txid</span>).<span class="ident">unwrap</span>(),
- <span class="ident">tx_details</span>.<span class="ident">transaction</span>
- );
-
- <span class="comment">// now get without raw_tx</span>
- <span class="ident">tx_details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">None</span>;
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tree</span>.<span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="ident">tx_details</span>.<span class="ident">txid</span>, <span class="bool-val">false</span>).<span class="ident">unwrap</span>(),
- <span class="prelude-val">Some</span>(<span class="ident">tx_details</span>)
- );
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test_last_index</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span>(<span class="kw-2">mut</span> <span class="ident">tree</span>: <span class="ident">D</span>) {
- <span class="ident">tree</span>.<span class="ident">set_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="number">1337</span>).<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tree</span>.<span class="ident">get_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>).<span class="ident">unwrap</span>(),
- <span class="prelude-val">Some</span>(<span class="number">1337</span>)
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tree</span>.<span class="ident">get_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>).<span class="ident">unwrap</span>(), <span class="prelude-val">None</span>);
-
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="ident">tree</span>.<span class="ident">increment_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">res</span>, <span class="number">1338</span>);
- <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="ident">tree</span>.<span class="ident">increment_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">res</span>, <span class="number">0</span>);
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tree</span>.<span class="ident">get_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>).<span class="ident">unwrap</span>(),
- <span class="prelude-val">Some</span>(<span class="number">1338</span>)
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tree</span>.<span class="ident">get_last_index</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>).<span class="ident">unwrap</span>(), <span class="prelude-val">Some</span>(<span class="number">0</span>));
- }
-
- <span class="comment">// TODO: more tests...</span>
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/descriptor/checksum.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>checksum.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10">10</span>
-<span id="11">11</span>
-<span id="12">12</span>
-<span id="13">13</span>
-<span id="14">14</span>
-<span id="15">15</span>
-<span id="16">16</span>
-<span id="17">17</span>
-<span id="18">18</span>
-<span id="19">19</span>
-<span id="20">20</span>
-<span id="21">21</span>
-<span id="22">22</span>
-<span id="23">23</span>
-<span id="24">24</span>
-<span id="25">25</span>
-<span id="26">26</span>
-<span id="27">27</span>
-<span id="28">28</span>
-<span id="29">29</span>
-<span id="30">30</span>
-<span id="31">31</span>
-<span id="32">32</span>
-<span id="33">33</span>
-<span id="34">34</span>
-<span id="35">35</span>
-<span id="36">36</span>
-<span id="37">37</span>
-<span id="38">38</span>
-<span id="39">39</span>
-<span id="40">40</span>
-<span id="41">41</span>
-<span id="42">42</span>
-<span id="43">43</span>
-<span id="44">44</span>
-<span id="45">45</span>
-<span id="46">46</span>
-<span id="47">47</span>
-<span id="48">48</span>
-<span id="49">49</span>
-<span id="50">50</span>
-<span id="51">51</span>
-<span id="52">52</span>
-<span id="53">53</span>
-<span id="54">54</span>
-<span id="55">55</span>
-<span id="56">56</span>
-<span id="57">57</span>
-<span id="58">58</span>
-<span id="59">59</span>
-<span id="60">60</span>
-<span id="61">61</span>
-<span id="62">62</span>
-<span id="63">63</span>
-<span id="64">64</span>
-<span id="65">65</span>
-<span id="66">66</span>
-<span id="67">67</span>
-<span id="68">68</span>
-<span id="69">69</span>
-<span id="70">70</span>
-<span id="71">71</span>
-<span id="72">72</span>
-<span id="73">73</span>
-<span id="74">74</span>
-<span id="75">75</span>
-<span id="76">76</span>
-<span id="77">77</span>
-<span id="78">78</span>
-<span id="79">79</span>
-<span id="80">80</span>
-<span id="81">81</span>
-<span id="82">82</span>
-<span id="83">83</span>
-<span id="84">84</span>
-<span id="85">85</span>
-<span id="86">86</span>
-<span id="87">87</span>
-<span id="88">88</span>
-<span id="89">89</span>
-<span id="90">90</span>
-<span id="91">91</span>
-<span id="92">92</span>
-<span id="93">93</span>
-<span id="94">94</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="doccomment">//! Descriptor checksum</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! This module contains a re-implementation of the function used by Bitcoin Core to calculate the</span>
-<span class="doccomment">//! checksum of a descriptor</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">iter</span>::<span class="ident">FromIterator</span>;
-
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">Error</span>;
-
-<span class="kw">const</span> <span class="ident">INPUT_CHARSET</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"0123456789()[],'/*abcdefgh@:$%{}IJKLMNOPQRSTUVWXYZ&+-.;<=>?!^_|~ijklmnopqrstuvwxyzABCDEFGH`#\"\\ "</span>;
-<span class="kw">const</span> <span class="ident">CHECKSUM_CHARSET</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"qpzry9x8gf2tvdw0s3jn54khce6mua7l"</span>;
-
-<span class="kw">fn</span> <span class="ident">poly_mod</span>(<span class="kw-2">mut</span> <span class="ident">c</span>: <span class="ident">u64</span>, <span class="ident">val</span>: <span class="ident">u64</span>) <span class="op">-</span><span class="op">></span> <span class="ident">u64</span> {
- <span class="kw">let</span> <span class="ident">c0</span> <span class="op">=</span> <span class="ident">c</span> <span class="op">></span><span class="op">></span> <span class="number">35</span>;
- <span class="ident">c</span> <span class="op">=</span> ((<span class="ident">c</span> <span class="op">&</span> <span class="number">0x7ffffffff</span>) <span class="op"><</span><span class="op"><</span> <span class="number">5</span>) <span class="op">^</span> <span class="ident">val</span>;
- <span class="kw">if</span> <span class="ident">c0</span> <span class="op">&</span> <span class="number">1</span> <span class="op">></span> <span class="number">0</span> {
- <span class="ident">c</span> <span class="op">^</span><span class="op">=</span> <span class="number">0xf5dee51989</span>
- };
- <span class="kw">if</span> <span class="ident">c0</span> <span class="op">&</span> <span class="number">2</span> <span class="op">></span> <span class="number">0</span> {
- <span class="ident">c</span> <span class="op">^</span><span class="op">=</span> <span class="number">0xa9fdca3312</span>
- };
- <span class="kw">if</span> <span class="ident">c0</span> <span class="op">&</span> <span class="number">4</span> <span class="op">></span> <span class="number">0</span> {
- <span class="ident">c</span> <span class="op">^</span><span class="op">=</span> <span class="number">0x1bab10e32d</span>
- };
- <span class="kw">if</span> <span class="ident">c0</span> <span class="op">&</span> <span class="number">8</span> <span class="op">></span> <span class="number">0</span> {
- <span class="ident">c</span> <span class="op">^</span><span class="op">=</span> <span class="number">0x3706b1677a</span>
- };
- <span class="kw">if</span> <span class="ident">c0</span> <span class="op">&</span> <span class="number">16</span> <span class="op">></span> <span class="number">0</span> {
- <span class="ident">c</span> <span class="op">^</span><span class="op">=</span> <span class="number">0x644d626ffd</span>
- };
-
- <span class="ident">c</span>
-}
-
-<span class="doccomment">/// Compute the checksum of a descriptor</span>
-<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_checksum</span>(<span class="ident">desc</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">c</span> <span class="op">=</span> <span class="number">1</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cls</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">clscount</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">for</span> <span class="ident">ch</span> <span class="kw">in</span> <span class="ident">desc</span>.<span class="ident">chars</span>() {
- <span class="kw">let</span> <span class="ident">pos</span> <span class="op">=</span> <span class="ident">INPUT_CHARSET</span>
- .<span class="ident">find</span>(<span class="ident">ch</span>)
- .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">InvalidDescriptorCharacter</span>(<span class="ident">ch</span>))<span class="question-mark">?</span> <span class="kw">as</span> <span class="ident">u64</span>;
- <span class="ident">c</span> <span class="op">=</span> <span class="ident">poly_mod</span>(<span class="ident">c</span>, <span class="ident">pos</span> <span class="op">&</span> <span class="number">31</span>);
- <span class="ident">cls</span> <span class="op">=</span> <span class="ident">cls</span> <span class="op">*</span> <span class="number">3</span> <span class="op">+</span> (<span class="ident">pos</span> <span class="op">></span><span class="op">></span> <span class="number">5</span>);
- <span class="ident">clscount</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
- <span class="kw">if</span> <span class="ident">clscount</span> <span class="op">=</span><span class="op">=</span> <span class="number">3</span> {
- <span class="ident">c</span> <span class="op">=</span> <span class="ident">poly_mod</span>(<span class="ident">c</span>, <span class="ident">cls</span>);
- <span class="ident">cls</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="ident">clscount</span> <span class="op">=</span> <span class="number">0</span>;
- }
- }
- <span class="kw">if</span> <span class="ident">clscount</span> <span class="op">></span> <span class="number">0</span> {
- <span class="ident">c</span> <span class="op">=</span> <span class="ident">poly_mod</span>(<span class="ident">c</span>, <span class="ident">cls</span>);
- }
- (<span class="number">0</span>..<span class="number">8</span>).<span class="ident">for_each</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">c</span> <span class="op">=</span> <span class="ident">poly_mod</span>(<span class="ident">c</span>, <span class="number">0</span>));
- <span class="ident">c</span> <span class="op">^</span><span class="op">=</span> <span class="number">1</span>;
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">chars</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="number">8</span>);
- <span class="kw">for</span> <span class="ident">j</span> <span class="kw">in</span> <span class="number">0</span>..<span class="number">8</span> {
- <span class="ident">chars</span>.<span class="ident">push</span>(
- <span class="ident">CHECKSUM_CHARSET</span>
- .<span class="ident">chars</span>()
- .<span class="ident">nth</span>(((<span class="ident">c</span> <span class="op">></span><span class="op">></span> (<span class="number">5</span> <span class="op">*</span> (<span class="number">7</span> <span class="op">-</span> <span class="ident">j</span>))) <span class="op">&</span> <span class="number">31</span>) <span class="kw">as</span> <span class="ident">usize</span>)
- .<span class="ident">unwrap</span>(),
- );
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">String</span>::<span class="ident">from_iter</span>(<span class="ident">chars</span>))
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/descriptor/error.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>error.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10">10</span>
-<span id="11">11</span>
-<span id="12">12</span>
-<span id="13">13</span>
-<span id="14">14</span>
-<span id="15">15</span>
-<span id="16">16</span>
-<span id="17">17</span>
-<span id="18">18</span>
-<span id="19">19</span>
-<span id="20">20</span>
-<span id="21">21</span>
-<span id="22">22</span>
-<span id="23">23</span>
-<span id="24">24</span>
-<span id="25">25</span>
-<span id="26">26</span>
-<span id="27">27</span>
-<span id="28">28</span>
-<span id="29">29</span>
-<span id="30">30</span>
-<span id="31">31</span>
-<span id="32">32</span>
-<span id="33">33</span>
-<span id="34">34</span>
-<span id="35">35</span>
-<span id="36">36</span>
-<span id="37">37</span>
-<span id="38">38</span>
-<span id="39">39</span>
-<span id="40">40</span>
-<span id="41">41</span>
-<span id="42">42</span>
-<span id="43">43</span>
-<span id="44">44</span>
-<span id="45">45</span>
-<span id="46">46</span>
-<span id="47">47</span>
-<span id="48">48</span>
-<span id="49">49</span>
-<span id="50">50</span>
-<span id="51">51</span>
-<span id="52">52</span>
-<span id="53">53</span>
-<span id="54">54</span>
-<span id="55">55</span>
-<span id="56">56</span>
-<span id="57">57</span>
-<span id="58">58</span>
-<span id="59">59</span>
-<span id="60">60</span>
-<span id="61">61</span>
-<span id="62">62</span>
-<span id="63">63</span>
-<span id="64">64</span>
-<span id="65">65</span>
-<span id="66">66</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="doccomment">//! Descriptor errors</span>
-
-<span class="doccomment">/// Errors related to the parsing and usage of descriptors</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">Error</span> {
- <span class="ident">InternalError</span>,
- <span class="ident">InvalidPrefix</span>(<span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>),
- <span class="ident">HardenedDerivationOnXpub</span>,
- <span class="ident">MalformedInput</span>,
- <span class="ident">KeyParsingError</span>(<span class="ident">String</span>),
-
- <span class="ident">Policy</span>(<span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">policy</span>::<span class="ident">PolicyError</span>),
-
- <span class="ident">InputIndexDoesntExist</span>,
- <span class="ident">MissingPublicKey</span>,
- <span class="ident">MissingDetails</span>,
-
- <span class="ident">InvalidDescriptorCharacter</span>(<span class="ident">char</span>),
-
- <span class="ident">CantDeriveWithMiniscript</span>,
-
- <span class="ident">BIP32</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">Error</span>),
- <span class="ident">Base58</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">base58</span>::<span class="ident">Error</span>),
- <span class="ident">PK</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">key</span>::<span class="ident">Error</span>),
- <span class="ident">Miniscript</span>(<span class="ident">miniscript</span>::<span class="ident">Error</span>),
- <span class="ident">Hex</span>(<span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">Error</span>),
-}
-
-<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">Error</span> {
- <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">std</span>::<span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">std</span>::<span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
- <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"{:?}"</span>, <span class="self">self</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span> <span class="kw">for</span> <span class="ident">Error</span> {}
-
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">Error</span>, <span class="ident">BIP32</span>);
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">base58</span>::<span class="ident">Error</span>, <span class="ident">Base58</span>);
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">key</span>::<span class="ident">Error</span>, <span class="ident">PK</span>);
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">miniscript</span>::<span class="ident">Error</span>, <span class="ident">Miniscript</span>);
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">Error</span>, <span class="ident">Hex</span>);
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">policy</span>::<span class="ident">PolicyError</span>, <span class="ident">Policy</span>);
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/descriptor/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-<span id="203">203</span>
-<span id="204">204</span>
-<span id="205">205</span>
-<span id="206">206</span>
-<span id="207">207</span>
-<span id="208">208</span>
-<span id="209">209</span>
-<span id="210">210</span>
-<span id="211">211</span>
-<span id="212">212</span>
-<span id="213">213</span>
-<span id="214">214</span>
-<span id="215">215</span>
-<span id="216">216</span>
-<span id="217">217</span>
-<span id="218">218</span>
-<span id="219">219</span>
-<span id="220">220</span>
-<span id="221">221</span>
-<span id="222">222</span>
-<span id="223">223</span>
-<span id="224">224</span>
-<span id="225">225</span>
-<span id="226">226</span>
-<span id="227">227</span>
-<span id="228">228</span>
-<span id="229">229</span>
-<span id="230">230</span>
-<span id="231">231</span>
-<span id="232">232</span>
-<span id="233">233</span>
-<span id="234">234</span>
-<span id="235">235</span>
-<span id="236">236</span>
-<span id="237">237</span>
-<span id="238">238</span>
-<span id="239">239</span>
-<span id="240">240</span>
-<span id="241">241</span>
-<span id="242">242</span>
-<span id="243">243</span>
-<span id="244">244</span>
-<span id="245">245</span>
-<span id="246">246</span>
-<span id="247">247</span>
-<span id="248">248</span>
-<span id="249">249</span>
-<span id="250">250</span>
-<span id="251">251</span>
-<span id="252">252</span>
-<span id="253">253</span>
-<span id="254">254</span>
-<span id="255">255</span>
-<span id="256">256</span>
-<span id="257">257</span>
-<span id="258">258</span>
-<span id="259">259</span>
-<span id="260">260</span>
-<span id="261">261</span>
-<span id="262">262</span>
-<span id="263">263</span>
-<span id="264">264</span>
-<span id="265">265</span>
-<span id="266">266</span>
-<span id="267">267</span>
-<span id="268">268</span>
-<span id="269">269</span>
-<span id="270">270</span>
-<span id="271">271</span>
-<span id="272">272</span>
-<span id="273">273</span>
-<span id="274">274</span>
-<span id="275">275</span>
-<span id="276">276</span>
-<span id="277">277</span>
-<span id="278">278</span>
-<span id="279">279</span>
-<span id="280">280</span>
-<span id="281">281</span>
-<span id="282">282</span>
-<span id="283">283</span>
-<span id="284">284</span>
-<span id="285">285</span>
-<span id="286">286</span>
-<span id="287">287</span>
-<span id="288">288</span>
-<span id="289">289</span>
-<span id="290">290</span>
-<span id="291">291</span>
-<span id="292">292</span>
-<span id="293">293</span>
-<span id="294">294</span>
-<span id="295">295</span>
-<span id="296">296</span>
-<span id="297">297</span>
-<span id="298">298</span>
-<span id="299">299</span>
-<span id="300">300</span>
-<span id="301">301</span>
-<span id="302">302</span>
-<span id="303">303</span>
-<span id="304">304</span>
-<span id="305">305</span>
-<span id="306">306</span>
-<span id="307">307</span>
-<span id="308">308</span>
-<span id="309">309</span>
-<span id="310">310</span>
-<span id="311">311</span>
-<span id="312">312</span>
-<span id="313">313</span>
-<span id="314">314</span>
-<span id="315">315</span>
-<span id="316">316</span>
-<span id="317">317</span>
-<span id="318">318</span>
-<span id="319">319</span>
-<span id="320">320</span>
-<span id="321">321</span>
-<span id="322">322</span>
-<span id="323">323</span>
-<span id="324">324</span>
-<span id="325">325</span>
-<span id="326">326</span>
-<span id="327">327</span>
-<span id="328">328</span>
-<span id="329">329</span>
-<span id="330">330</span>
-<span id="331">331</span>
-<span id="332">332</span>
-<span id="333">333</span>
-<span id="334">334</span>
-<span id="335">335</span>
-<span id="336">336</span>
-<span id="337">337</span>
-<span id="338">338</span>
-<span id="339">339</span>
-<span id="340">340</span>
-<span id="341">341</span>
-<span id="342">342</span>
-<span id="343">343</span>
-<span id="344">344</span>
-<span id="345">345</span>
-<span id="346">346</span>
-<span id="347">347</span>
-<span id="348">348</span>
-<span id="349">349</span>
-<span id="350">350</span>
-<span id="351">351</span>
-<span id="352">352</span>
-<span id="353">353</span>
-<span id="354">354</span>
-<span id="355">355</span>
-<span id="356">356</span>
-<span id="357">357</span>
-<span id="358">358</span>
-<span id="359">359</span>
-<span id="360">360</span>
-<span id="361">361</span>
-<span id="362">362</span>
-<span id="363">363</span>
-<span id="364">364</span>
-<span id="365">365</span>
-<span id="366">366</span>
-<span id="367">367</span>
-<span id="368">368</span>
-<span id="369">369</span>
-<span id="370">370</span>
-<span id="371">371</span>
-<span id="372">372</span>
-<span id="373">373</span>
-<span id="374">374</span>
-<span id="375">375</span>
-<span id="376">376</span>
-<span id="377">377</span>
-<span id="378">378</span>
-<span id="379">379</span>
-<span id="380">380</span>
-<span id="381">381</span>
-<span id="382">382</span>
-<span id="383">383</span>
-<span id="384">384</span>
-<span id="385">385</span>
-<span id="386">386</span>
-<span id="387">387</span>
-<span id="388">388</span>
-<span id="389">389</span>
-<span id="390">390</span>
-<span id="391">391</span>
-<span id="392">392</span>
-<span id="393">393</span>
-<span id="394">394</span>
-<span id="395">395</span>
-<span id="396">396</span>
-<span id="397">397</span>
-<span id="398">398</span>
-<span id="399">399</span>
-<span id="400">400</span>
-<span id="401">401</span>
-<span id="402">402</span>
-<span id="403">403</span>
-<span id="404">404</span>
-<span id="405">405</span>
-<span id="406">406</span>
-<span id="407">407</span>
-<span id="408">408</span>
-<span id="409">409</span>
-<span id="410">410</span>
-<span id="411">411</span>
-<span id="412">412</span>
-<span id="413">413</span>
-<span id="414">414</span>
-<span id="415">415</span>
-<span id="416">416</span>
-<span id="417">417</span>
-<span id="418">418</span>
-<span id="419">419</span>
-<span id="420">420</span>
-<span id="421">421</span>
-<span id="422">422</span>
-<span id="423">423</span>
-<span id="424">424</span>
-<span id="425">425</span>
-<span id="426">426</span>
-<span id="427">427</span>
-<span id="428">428</span>
-<span id="429">429</span>
-<span id="430">430</span>
-<span id="431">431</span>
-<span id="432">432</span>
-<span id="433">433</span>
-<span id="434">434</span>
-<span id="435">435</span>
-<span id="436">436</span>
-<span id="437">437</span>
-<span id="438">438</span>
-<span id="439">439</span>
-<span id="440">440</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="doccomment">//! Descriptors</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! This module contains generic utilities to work with descriptors, plus some re-exported types</span>
-<span class="doccomment">//! from [`miniscript`].</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::{<span class="ident">BTreeMap</span>, <span class="ident">HashMap</span>};
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>;
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hash160</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">secp256k1</span>::<span class="ident">Secp256k1</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::{<span class="ident">ChildNumber</span>, <span class="ident">DerivationPath</span>, <span class="ident">Fingerprint</span>};
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">psbt</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">PublicKey</span>, <span class="ident">Script</span>, <span class="ident">TxOut</span>};
-
-<span class="kw">use</span> <span class="ident">miniscript</span>::<span class="ident">descriptor</span>::{<span class="ident">DescriptorPublicKey</span>, <span class="ident">DescriptorXKey</span>, <span class="ident">InnerXKey</span>};
-<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">miniscript</span>::{
- <span class="ident">Descriptor</span>, <span class="ident">Legacy</span>, <span class="ident">Miniscript</span>, <span class="ident">MiniscriptKey</span>, <span class="ident">ScriptContext</span>, <span class="ident">Segwitv0</span>, <span class="ident">Terminal</span>, <span class="ident">ToPublicKey</span>,
-};
-
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">checksum</span>;
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">error</span>;
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">policy</span>;
-
-<span class="kw">pub</span> <span class="kw">use</span> <span class="self">self</span>::<span class="ident">checksum</span>::<span class="ident">get_checksum</span>;
-<span class="kw">use</span> <span class="self">self</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
-<span class="kw">pub</span> <span class="kw">use</span> <span class="self">self</span>::<span class="ident">policy</span>::<span class="ident">Policy</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">signer</span>::<span class="ident">SignersContainer</span>;
-
-<span class="doccomment">/// Alias for a [`Descriptor`] that can contain extended keys using [`DescriptorPublicKey`]</span>
-<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">ExtendedDescriptor</span> <span class="op">=</span> <span class="ident">Descriptor</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span>;
-
-<span class="doccomment">/// Alias for the type of maps that represent derivation paths in a [`psbt::Input`] or</span>
-<span class="doccomment">/// [`psbt::Output`]</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// [`psbt::Input`]: bitcoin::util::psbt::Input</span>
-<span class="doccomment">/// [`psbt::Output`]: bitcoin::util::psbt::Output</span>
-<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">HDKeyPaths</span> <span class="op">=</span> <span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">PublicKey</span>, (<span class="ident">Fingerprint</span>, <span class="ident">DerivationPath</span>)<span class="op">></span>;
-
-<span class="doccomment">/// Trait implemented on [`Descriptor`]s to add a method to extract the spending [`policy`]</span>
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">ExtractPolicy</span> {
- <span class="kw">fn</span> <span class="ident">extract_policy</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">signers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
-}
-
-<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">trait</span> <span class="ident">XKeyUtils</span> {
- <span class="kw">fn</span> <span class="ident">full_path</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">append</span>: <span class="kw-2">&</span>[<span class="ident">ChildNumber</span>]) <span class="op">-</span><span class="op">></span> <span class="ident">DerivationPath</span>;
- <span class="kw">fn</span> <span class="ident">root_fingerprint</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Fingerprint</span>;
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">InnerXKey</span><span class="op">></span> <span class="ident">XKeyUtils</span> <span class="kw">for</span> <span class="ident">DescriptorXKey</span><span class="op"><</span><span class="ident">K</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">full_path</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">append</span>: <span class="kw-2">&</span>[<span class="ident">ChildNumber</span>]) <span class="op">-</span><span class="op">></span> <span class="ident">DerivationPath</span> {
- <span class="kw">let</span> <span class="ident">full_path</span> <span class="op">=</span> <span class="kw">match</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">source</span> {
- <span class="kw-2">&</span><span class="prelude-val">Some</span>((<span class="kw">_</span>, <span class="kw-2">ref</span> <span class="ident">path</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">path</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">chain</span>(<span class="self">self</span>.<span class="ident">derivation_path</span>.<span class="ident">into_iter</span>())
- .<span class="ident">cloned</span>()
- .<span class="ident">collect</span>(),
- <span class="kw-2">&</span><span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="self">self</span>.<span class="ident">derivation_path</span>.<span class="ident">clone</span>(),
- };
-
- <span class="kw">if</span> <span class="self">self</span>.<span class="ident">is_wildcard</span> {
- <span class="ident">full_path</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">chain</span>(<span class="ident">append</span>.<span class="ident">into_iter</span>())
- .<span class="ident">cloned</span>()
- .<span class="ident">collect</span>()
- } <span class="kw">else</span> {
- <span class="ident">full_path</span>
- }
- }
-
- <span class="kw">fn</span> <span class="ident">root_fingerprint</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Fingerprint</span> {
- <span class="kw">match</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">source</span> {
- <span class="kw-2">&</span><span class="prelude-val">Some</span>((<span class="ident">fingerprint</span>, <span class="kw">_</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">fingerprint</span>.<span class="ident">clone</span>(),
- <span class="kw-2">&</span><span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="self">self</span>.<span class="ident">xkey</span>.<span class="ident">xkey_fingerprint</span>(),
- }
- }
-}
-
-<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">trait</span> <span class="ident">DescriptorMeta</span>: <span class="ident">Sized</span> {
- <span class="kw">fn</span> <span class="ident">is_witness</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span>;
- <span class="kw">fn</span> <span class="ident">get_hd_keypaths</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">index</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">HDKeyPaths</span>, <span class="ident">Error</span><span class="op">></span>;
- <span class="kw">fn</span> <span class="ident">is_fixed</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span>;
- <span class="kw">fn</span> <span class="ident">derive_from_hd_keypaths</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">hd_keypaths</span>: <span class="kw-2">&</span><span class="ident">HDKeyPaths</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="self">Self</span><span class="op">></span>;
- <span class="kw">fn</span> <span class="ident">derive_from_psbt_input</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">psbt_input</span>: <span class="kw-2">&</span><span class="ident">psbt</span>::<span class="ident">Input</span>, <span class="ident">utxo</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TxOut</span><span class="op">></span>)
- <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="self">Self</span><span class="op">></span>;
-}
-
-<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">trait</span> <span class="ident">DescriptorScripts</span> {
- <span class="kw">fn</span> <span class="ident">psbt_redeem_script</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>;
- <span class="kw">fn</span> <span class="ident">psbt_witness_script</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>;
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">T</span><span class="op">></span> <span class="ident">DescriptorScripts</span> <span class="kw">for</span> <span class="ident">Descriptor</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>
-<span class="kw">where</span>
- <span class="ident">T</span>: <span class="ident">miniscript</span>::<span class="ident">MiniscriptKey</span> <span class="op">+</span> <span class="ident">miniscript</span>::<span class="ident">ToPublicKey</span>,
-{
- <span class="kw">fn</span> <span class="ident">psbt_redeem_script</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span> {
- <span class="kw">match</span> <span class="self">self</span> {
- <span class="ident">Descriptor</span>::<span class="ident">ShWpkh</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">witness_script</span>()),
- <span class="ident">Descriptor</span>::<span class="ident">ShWsh</span>(<span class="kw-2">ref</span> <span class="ident">script</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">script</span>.<span class="ident">encode</span>().<span class="ident">to_v0_p2wsh</span>()),
- <span class="ident">Descriptor</span>::<span class="ident">Sh</span>(<span class="kw-2">ref</span> <span class="ident">script</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">script</span>.<span class="ident">encode</span>()),
- <span class="ident">Descriptor</span>::<span class="ident">Bare</span>(<span class="kw-2">ref</span> <span class="ident">script</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">script</span>.<span class="ident">encode</span>()),
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
- }
- }
-
- <span class="kw">fn</span> <span class="ident">psbt_witness_script</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span> {
- <span class="kw">match</span> <span class="self">self</span> {
- <span class="ident">Descriptor</span>::<span class="ident">Wsh</span>(<span class="kw-2">ref</span> <span class="ident">script</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">script</span>.<span class="ident">encode</span>()),
- <span class="ident">Descriptor</span>::<span class="ident">ShWsh</span>(<span class="kw-2">ref</span> <span class="ident">script</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">script</span>.<span class="ident">encode</span>()),
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
- }
- }
-}
-
-<span class="kw">impl</span> <span class="ident">DescriptorMeta</span> <span class="kw">for</span> <span class="ident">Descriptor</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">is_witness</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="kw">match</span> <span class="self">self</span> {
- <span class="ident">Descriptor</span>::<span class="ident">Bare</span>(<span class="kw">_</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Pk</span>(<span class="kw">_</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Pkh</span>(<span class="kw">_</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Sh</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> {
- <span class="bool-val">false</span>
- }
- <span class="ident">Descriptor</span>::<span class="ident">Wpkh</span>(<span class="kw">_</span>)
- <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWpkh</span>(<span class="kw">_</span>)
- <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Wsh</span>(<span class="kw">_</span>)
- <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWsh</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="bool-val">true</span>,
- }
- }
-
- <span class="kw">fn</span> <span class="ident">get_hd_keypaths</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">index</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">HDKeyPaths</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">answer</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
-
- <span class="kw">let</span> <span class="ident">translatefpk</span> <span class="op">=</span> <span class="op">|</span><span class="ident">key</span>: <span class="kw-2">&</span><span class="ident">DescriptorPublicKey</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">match</span> <span class="ident">key</span> {
- <span class="ident">DescriptorPublicKey</span>::<span class="ident">PubKey</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> {}
- <span class="ident">DescriptorPublicKey</span>::<span class="ident">XPub</span>(<span class="ident">xpub</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">derive_path</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">xpub</span>.<span class="ident">is_wildcard</span> {
- <span class="ident">xpub</span>.<span class="ident">derivation_path</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">chain</span>([<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">index</span>)<span class="question-mark">?</span>].<span class="ident">iter</span>())
- .<span class="ident">cloned</span>()
- .<span class="ident">collect</span>()
- } <span class="kw">else</span> {
- <span class="ident">xpub</span>.<span class="ident">derivation_path</span>.<span class="ident">clone</span>()
- };
- <span class="kw">let</span> <span class="ident">derived_pubkey</span> <span class="op">=</span> <span class="ident">xpub</span>
- .<span class="ident">xkey</span>
- .<span class="ident">derive_pub</span>(<span class="kw-2">&</span><span class="ident">Secp256k1</span>::<span class="ident">verification_only</span>(), <span class="kw-2">&</span><span class="ident">derive_path</span>)<span class="question-mark">?</span>;
-
- <span class="ident">answer</span>.<span class="ident">insert</span>(
- <span class="ident">derived_pubkey</span>.<span class="ident">public_key</span>,
- (
- <span class="ident">xpub</span>.<span class="ident">root_fingerprint</span>(),
- <span class="ident">xpub</span>.<span class="ident">full_path</span>(<span class="kw-2">&</span>[<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">index</span>)<span class="question-mark">?</span>]),
- ),
- );
- }
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">DummyKey</span>::<span class="ident">default</span>())
- };
- <span class="kw">let</span> <span class="ident">translatefpkh</span> <span class="op">=</span> <span class="op">|</span><span class="kw">_</span>: <span class="kw-2">&</span><span class="ident">hash160</span>::<span class="ident">Hash</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> { <span class="prelude-val">Ok</span>(<span class="ident">DummyKey</span>::<span class="ident">default</span>()) };
-
- <span class="self">self</span>.<span class="ident">translate_pk</span>(<span class="ident">translatefpk</span>, <span class="ident">translatefpkh</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">answer</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">is_fixed</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">found_wildcard</span> <span class="op">=</span> <span class="bool-val">false</span>;
-
- <span class="kw">let</span> <span class="ident">translatefpk</span> <span class="op">=</span> <span class="op">|</span><span class="ident">key</span>: <span class="kw-2">&</span><span class="ident">DescriptorPublicKey</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">match</span> <span class="ident">key</span> {
- <span class="ident">DescriptorPublicKey</span>::<span class="ident">PubKey</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> {}
- <span class="ident">DescriptorPublicKey</span>::<span class="ident">XPub</span>(<span class="ident">xpub</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">if</span> <span class="ident">xpub</span>.<span class="ident">is_wildcard</span> {
- <span class="ident">found_wildcard</span> <span class="op">=</span> <span class="bool-val">true</span>;
- }
- }
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">DummyKey</span>::<span class="ident">default</span>())
- };
- <span class="kw">let</span> <span class="ident">translatefpkh</span> <span class="op">=</span> <span class="op">|</span><span class="kw">_</span>: <span class="kw-2">&</span><span class="ident">hash160</span>::<span class="ident">Hash</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> { <span class="prelude-val">Ok</span>(<span class="ident">DummyKey</span>::<span class="ident">default</span>()) };
-
- <span class="self">self</span>.<span class="ident">translate_pk</span>(<span class="ident">translatefpk</span>, <span class="ident">translatefpkh</span>).<span class="ident">unwrap</span>();
-
- <span class="op">!</span><span class="ident">found_wildcard</span>
- }
-
- <span class="kw">fn</span> <span class="ident">derive_from_hd_keypaths</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">hd_keypaths</span>: <span class="kw-2">&</span><span class="ident">HDKeyPaths</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="self">Self</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">index</span>: <span class="ident">HashMap</span><span class="op"><</span><span class="kw">_</span>, <span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">hd_keypaths</span>.<span class="ident">values</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>();
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">derive_path</span> <span class="op">=</span> <span class="prelude-val">None</span>::<span class="op"><</span><span class="ident">DerivationPath</span><span class="op">></span>;
- <span class="kw">let</span> <span class="ident">translatefpk</span> <span class="op">=</span> <span class="op">|</span><span class="ident">key</span>: <span class="kw-2">&</span><span class="ident">DescriptorPublicKey</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">if</span> <span class="ident">derive_path</span>.<span class="ident">is_some</span>() {
- <span class="comment">// already found a matching path, we are done</span>
- <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="ident">DummyKey</span>::<span class="ident">default</span>());
- }
-
- <span class="kw">if</span> <span class="kw">let</span> <span class="ident">DescriptorPublicKey</span>::<span class="ident">XPub</span>(<span class="ident">xpub</span>) <span class="op">=</span> <span class="ident">key</span> {
- <span class="comment">// Check if the key matches one entry in our `index`. If it does, `matches()` will</span>
- <span class="comment">// return the "prefix" that matched, so we remove that prefix from the full path</span>
- <span class="comment">// found in `index` and save it in `derive_path`</span>
- <span class="kw">let</span> <span class="ident">root_fingerprint</span> <span class="op">=</span> <span class="ident">xpub</span>.<span class="ident">root_fingerprint</span>();
- <span class="ident">derive_path</span> <span class="op">=</span> <span class="ident">index</span>
- .<span class="ident">get_key_value</span>(<span class="kw-2">&</span><span class="ident">root_fingerprint</span>)
- .<span class="ident">and_then</span>(<span class="op">|</span>(<span class="ident">fingerprint</span>, <span class="ident">path</span>)<span class="op">|</span> <span class="ident">xpub</span>.<span class="ident">matches</span>(<span class="kw-2">*</span><span class="ident">fingerprint</span>, <span class="ident">path</span>))
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">prefix_path</span><span class="op">|</span> <span class="ident">prefix_path</span>.<span class="ident">into_iter</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span><span class="op">></span>())
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">prefix</span><span class="op">|</span> {
- <span class="ident">index</span>
- .<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">xpub</span>.<span class="ident">root_fingerprint</span>())
- .<span class="ident">unwrap</span>()
- .<span class="ident">into_iter</span>()
- .<span class="ident">skip</span>(<span class="ident">prefix</span>.<span class="ident">len</span>())
- .<span class="ident">cloned</span>()
- .<span class="ident">collect</span>()
- });
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">DummyKey</span>::<span class="ident">default</span>())
- };
- <span class="kw">let</span> <span class="ident">translatefpkh</span> <span class="op">=</span> <span class="op">|</span><span class="kw">_</span>: <span class="kw-2">&</span><span class="ident">hash160</span>::<span class="ident">Hash</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span> { <span class="prelude-val">Ok</span>(<span class="ident">DummyKey</span>::<span class="ident">default</span>()) };
-
- <span class="self">self</span>.<span class="ident">translate_pk</span>(<span class="ident">translatefpk</span>, <span class="ident">translatefpkh</span>).<span class="ident">unwrap</span>();
-
- <span class="ident">derive_path</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">path</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">derive</span>(<span class="ident">path</span>.<span class="ident">as_ref</span>()))
- }
-
- <span class="kw">fn</span> <span class="ident">derive_from_psbt_input</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">psbt_input</span>: <span class="kw-2">&</span><span class="ident">psbt</span>::<span class="ident">Input</span>,
- <span class="ident">utxo</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TxOut</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="self">Self</span><span class="op">></span> {
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">derived</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">derive_from_hd_keypaths</span>(<span class="kw-2">&</span><span class="ident">psbt_input</span>.<span class="ident">hd_keypaths</span>) {
- <span class="kw">return</span> <span class="prelude-val">Some</span>(<span class="ident">derived</span>);
- } <span class="kw">else</span> <span class="kw">if</span> <span class="op">!</span><span class="self">self</span>.<span class="ident">is_fixed</span>() {
- <span class="comment">// If the descriptor is not fixed we can't brute-force the derivation address, so just</span>
- <span class="comment">// exit here</span>
- <span class="kw">return</span> <span class="prelude-val">None</span>;
- }
-
- <span class="kw">match</span> <span class="self">self</span> {
- <span class="ident">Descriptor</span>::<span class="ident">Pk</span>(<span class="kw">_</span>)
- <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Pkh</span>(<span class="kw">_</span>)
- <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Wpkh</span>(<span class="kw">_</span>)
- <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWpkh</span>(<span class="kw">_</span>)
- <span class="kw">if</span> <span class="ident">utxo</span>.<span class="ident">is_some</span>()
- <span class="kw-2">&</span><span class="op">&</span> <span class="self">self</span>.<span class="ident">script_pubkey</span>() <span class="op">=</span><span class="op">=</span> <span class="ident">utxo</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap</span>().<span class="ident">script_pubkey</span> <span class="op">=</span><span class="op">></span>
- {
- <span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">clone</span>())
- }
- <span class="ident">Descriptor</span>::<span class="ident">Bare</span>(<span class="ident">ms</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Sh</span>(<span class="ident">ms</span>)
- <span class="kw">if</span> <span class="ident">psbt_input</span>.<span class="ident">redeem_script</span>.<span class="ident">is_some</span>()
- <span class="kw-2">&</span><span class="op">&</span> <span class="kw-2">&</span><span class="ident">ms</span>.<span class="ident">encode</span>() <span class="op">=</span><span class="op">=</span> <span class="ident">psbt_input</span>.<span class="ident">redeem_script</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap</span>() <span class="op">=</span><span class="op">></span>
- {
- <span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">clone</span>())
- }
- <span class="ident">Descriptor</span>::<span class="ident">Wsh</span>(<span class="ident">ms</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWsh</span>(<span class="ident">ms</span>)
- <span class="kw">if</span> <span class="ident">psbt_input</span>.<span class="ident">witness_script</span>.<span class="ident">is_some</span>()
- <span class="kw-2">&</span><span class="op">&</span> <span class="kw-2">&</span><span class="ident">ms</span>.<span class="ident">encode</span>() <span class="op">=</span><span class="op">=</span> <span class="ident">psbt_input</span>.<span class="ident">witness_script</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap</span>() <span class="op">=</span><span class="op">></span>
- {
- <span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">clone</span>())
- }
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
- }
- }
-}
-
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">Hash</span>, <span class="ident">PartialEq</span>, <span class="ident">PartialOrd</span>, <span class="ident">Eq</span>, <span class="ident">Ord</span>, <span class="ident">Default</span>)]</span>
-<span class="kw">struct</span> <span class="ident">DummyKey</span>();
-
-<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">DummyKey</span> {
- <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
- <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"DummyKey"</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span> <span class="kw">for</span> <span class="ident">DummyKey</span> {
- <span class="kw">type</span> <span class="prelude-val">Err</span> <span class="op">=</span> ();
-
- <span class="kw">fn</span> <span class="ident">from_str</span>(<span class="kw">_</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="self">Self</span>::<span class="prelude-val">Err</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="ident">DummyKey</span>::<span class="ident">default</span>())
- }
-}
-
-<span class="kw">impl</span> <span class="ident">miniscript</span>::<span class="ident">MiniscriptKey</span> <span class="kw">for</span> <span class="ident">DummyKey</span> {
- <span class="kw">type</span> <span class="ident">Hash</span> <span class="op">=</span> <span class="ident">DummyKey</span>;
-
- <span class="kw">fn</span> <span class="ident">to_pubkeyhash</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">DummyKey</span> {
- <span class="ident">DummyKey</span>::<span class="ident">default</span>()
- }
-}
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="kw">mod</span> <span class="ident">test</span> {
- <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
-
- <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">deserialize</span>;
- <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">FromHex</span>;
- <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">psbt</span>;
-
- <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
- <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">psbt</span>::<span class="ident">PSBTUtils</span>;
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_derive_from_psbt_input_wpkh_wif</span>() {
- <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="ident">Descriptor</span>::<span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span>::<span class="ident">from_str</span>(
- <span class="string">"wpkh(02b4632d08485ff1df2db55b9dafd23347d1c47a457072a1e87be26896549a8737)"</span>,
- )
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">psbt</span>: <span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span> <span class="op">=</span> <span class="ident">deserialize</span>(
- <span class="kw-2">&</span><span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(
- <span class="string">"70736274ff010052010000000162307be8e431fbaff807cdf9cdc3fde44d7402\
- 11bc8342c31ffd6ec11fe35bcc0100000000ffffffff01328601000000000016\
- 001493ce48570b55c42c2af816aeaba06cfee1224fae000000000001011fa086\
- 01000000000016001493ce48570b55c42c2af816aeaba06cfee1224fae010304\
- 010000000000"</span>,
- )
- .<span class="ident">unwrap</span>(),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">descriptor</span>
- .<span class="ident">derive_from_psbt_input</span>(<span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>], <span class="ident">psbt</span>.<span class="ident">get_utxo_for</span>(<span class="number">0</span>))
- .<span class="ident">is_some</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_derive_from_psbt_input_pkh_tpub</span>() {
- <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="ident">Descriptor</span>::<span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span>::<span class="ident">from_str</span>(
- <span class="string">"pkh([0f056943/44h/0h/0h]tpubDDpWvmUrPZrhSPmUzCMBHffvC3HyMAPnWDSAQNBTnj1iZeJa7BZQEttFiP4DS4GCcXQHezdXhn86Hj6LHX5EDstXPWrMaSneRWM8yUf6NFd/10/*)"</span>,
- )
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">psbt</span>: <span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span> <span class="op">=</span> <span class="ident">deserialize</span>(
- <span class="kw-2">&</span><span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(
- <span class="string">"70736274ff010053010000000145843b86be54a3cd8c9e38444e1162676c00df\
- e7964122a70df491ea12fd67090100000000ffffffff01c19598000000000017\
- a91432bb94283282f72b2e034709e348c44d5a4db0ef8700000000000100f902\
- 0000000001010167e99c0eb67640f3a1b6805f2d8be8238c947f8aaf49eb0a9c\
- bee6a42c984200000000171600142b29a22019cca05b9c2b2d283a4c4489e1cf\
- 9f8ffeffffff02a01dced06100000017a914e2abf033cadbd74f0f4c74946201\
- decd20d5c43c8780969800000000001976a9148b0fce5fb1264e599a65387313\
- 3c95478b902eb288ac02473044022015d9211576163fa5b001e84dfa3d44efd9\
- 86b8f3a0d3d2174369288b2b750906022048dacc0e5d73ae42512fd2b97e2071\
- a8d0bce443b390b1fe0b8128fe70ec919e01210232dad1c5a67dcb0116d407e2\
- 52584228ab7ec00e8b9779d0c3ffe8114fc1a7d2c80600000103040100000022\
- 0603433b83583f8c4879b329dd08bbc7da935e4cc02f637ff746e05f0466ffb2\
- a6a2180f0569432c00008000000080000000800a000000000000000000"</span>,
- )
- .<span class="ident">unwrap</span>(),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">descriptor</span>
- .<span class="ident">derive_from_psbt_input</span>(<span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>], <span class="ident">psbt</span>.<span class="ident">get_utxo_for</span>(<span class="number">0</span>))
- .<span class="ident">is_some</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_derive_from_psbt_input_wsh</span>() {
- <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="ident">Descriptor</span>::<span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span>::<span class="ident">from_str</span>(
- <span class="string">"wsh(and_v(v:pk(03b6633fef2397a0a9de9d7b6f23aef8368a6e362b0581f0f0af70d5ecfd254b14),older(6)))"</span>,
- )
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">psbt</span>: <span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span> <span class="op">=</span> <span class="ident">deserialize</span>(
- <span class="kw-2">&</span><span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(
- <span class="string">"70736274ff01005302000000011c8116eea34408ab6529223c9a176606742207\
- 67a1ff1d46a6e3c4a88243ea6e01000000000600000001109698000000000017\
- a914ad105f61102e0d01d7af40d06d6a5c3ae2f7fde387000000000001012b80\
- 969800000000002200203ca72f106a72234754890ca7640c43f65d2174e44d33\
- 336030f9059345091044010304010000000105252103b6633fef2397a0a9de9d\
- 7b6f23aef8368a6e362b0581f0f0af70d5ecfd254b14ad56b20000"</span>,
- )
- .<span class="ident">unwrap</span>(),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">descriptor</span>
- .<span class="ident">derive_from_psbt_input</span>(<span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>], <span class="ident">psbt</span>.<span class="ident">get_utxo_for</span>(<span class="number">0</span>))
- .<span class="ident">is_some</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_derive_from_psbt_input_sh</span>() {
- <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="ident">Descriptor</span>::<span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span>::<span class="ident">from_str</span>(
- <span class="string">"sh(and_v(v:pk(021403881a5587297818fcaf17d239cefca22fce84a45b3b1d23e836c4af671dbb),after(630000)))"</span>,
- )
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">psbt</span>: <span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span> <span class="op">=</span> <span class="ident">deserialize</span>(
- <span class="kw-2">&</span><span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(
- <span class="string">"70736274ff0100530100000001bc8c13df445dfadcc42afa6dc841f85d22b01d\
- a6270ebf981740f4b7b1d800390000000000feffffff01ba9598000000000017\
- a91457b148ba4d3e5fa8608a8657875124e3d1c9390887f09c0900000100e002\
- 0000000001016ba1bbe05cc93574a0d611ec7d93ad0ab6685b28d0cd80e8a82d\
- debb326643c90100000000feffffff02809698000000000017a914d9a6e8c455\
- 8e16c8253afe53ce37ad61cf4c38c487403504cf6100000017a9144044fb6e0b\
- 757dfc1b34886b6a95aef4d3db137e870247304402202a9b72d939bcde8ba2a1\
- e0980597e47af4f5c152a78499143c3d0a78ac2286a602207a45b1df9e93b8c9\
- 6f09f5c025fe3e413ca4b905fe65ee55d32a3276439a9b8f012102dc1fcc2636\
- 4da1aa718f03d8d9bd6f2ff410ed2cf1245a168aa3bcc995ac18e0a806000001\
- 03040100000001042821021403881a5587297818fcaf17d239cefca22fce84a4\
- 5b3b1d23e836c4af671dbbad03f09c09b10000"</span>,
- )
- .<span class="ident">unwrap</span>(),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">descriptor</span>
- .<span class="ident">derive_from_psbt_input</span>(<span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>], <span class="ident">psbt</span>.<span class="ident">get_utxo_for</span>(<span class="number">0</span>))
- .<span class="ident">is_some</span>());
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/descriptor/policy.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>policy.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-<span id="203">203</span>
-<span id="204">204</span>
-<span id="205">205</span>
-<span id="206">206</span>
-<span id="207">207</span>
-<span id="208">208</span>
-<span id="209">209</span>
-<span id="210">210</span>
-<span id="211">211</span>
-<span id="212">212</span>
-<span id="213">213</span>
-<span id="214">214</span>
-<span id="215">215</span>
-<span id="216">216</span>
-<span id="217">217</span>
-<span id="218">218</span>
-<span id="219">219</span>
-<span id="220">220</span>
-<span id="221">221</span>
-<span id="222">222</span>
-<span id="223">223</span>
-<span id="224">224</span>
-<span id="225">225</span>
-<span id="226">226</span>
-<span id="227">227</span>
-<span id="228">228</span>
-<span id="229">229</span>
-<span id="230">230</span>
-<span id="231">231</span>
-<span id="232">232</span>
-<span id="233">233</span>
-<span id="234">234</span>
-<span id="235">235</span>
-<span id="236">236</span>
-<span id="237">237</span>
-<span id="238">238</span>
-<span id="239">239</span>
-<span id="240">240</span>
-<span id="241">241</span>
-<span id="242">242</span>
-<span id="243">243</span>
-<span id="244">244</span>
-<span id="245">245</span>
-<span id="246">246</span>
-<span id="247">247</span>
-<span id="248">248</span>
-<span id="249">249</span>
-<span id="250">250</span>
-<span id="251">251</span>
-<span id="252">252</span>
-<span id="253">253</span>
-<span id="254">254</span>
-<span id="255">255</span>
-<span id="256">256</span>
-<span id="257">257</span>
-<span id="258">258</span>
-<span id="259">259</span>
-<span id="260">260</span>
-<span id="261">261</span>
-<span id="262">262</span>
-<span id="263">263</span>
-<span id="264">264</span>
-<span id="265">265</span>
-<span id="266">266</span>
-<span id="267">267</span>
-<span id="268">268</span>
-<span id="269">269</span>
-<span id="270">270</span>
-<span id="271">271</span>
-<span id="272">272</span>
-<span id="273">273</span>
-<span id="274">274</span>
-<span id="275">275</span>
-<span id="276">276</span>
-<span id="277">277</span>
-<span id="278">278</span>
-<span id="279">279</span>
-<span id="280">280</span>
-<span id="281">281</span>
-<span id="282">282</span>
-<span id="283">283</span>
-<span id="284">284</span>
-<span id="285">285</span>
-<span id="286">286</span>
-<span id="287">287</span>
-<span id="288">288</span>
-<span id="289">289</span>
-<span id="290">290</span>
-<span id="291">291</span>
-<span id="292">292</span>
-<span id="293">293</span>
-<span id="294">294</span>
-<span id="295">295</span>
-<span id="296">296</span>
-<span id="297">297</span>
-<span id="298">298</span>
-<span id="299">299</span>
-<span id="300">300</span>
-<span id="301">301</span>
-<span id="302">302</span>
-<span id="303">303</span>
-<span id="304">304</span>
-<span id="305">305</span>
-<span id="306">306</span>
-<span id="307">307</span>
-<span id="308">308</span>
-<span id="309">309</span>
-<span id="310">310</span>
-<span id="311">311</span>
-<span id="312">312</span>
-<span id="313">313</span>
-<span id="314">314</span>
-<span id="315">315</span>
-<span id="316">316</span>
-<span id="317">317</span>
-<span id="318">318</span>
-<span id="319">319</span>
-<span id="320">320</span>
-<span id="321">321</span>
-<span id="322">322</span>
-<span id="323">323</span>
-<span id="324">324</span>
-<span id="325">325</span>
-<span id="326">326</span>
-<span id="327">327</span>
-<span id="328">328</span>
-<span id="329">329</span>
-<span id="330">330</span>
-<span id="331">331</span>
-<span id="332">332</span>
-<span id="333">333</span>
-<span id="334">334</span>
-<span id="335">335</span>
-<span id="336">336</span>
-<span id="337">337</span>
-<span id="338">338</span>
-<span id="339">339</span>
-<span id="340">340</span>
-<span id="341">341</span>
-<span id="342">342</span>
-<span id="343">343</span>
-<span id="344">344</span>
-<span id="345">345</span>
-<span id="346">346</span>
-<span id="347">347</span>
-<span id="348">348</span>
-<span id="349">349</span>
-<span id="350">350</span>
-<span id="351">351</span>
-<span id="352">352</span>
-<span id="353">353</span>
-<span id="354">354</span>
-<span id="355">355</span>
-<span id="356">356</span>
-<span id="357">357</span>
-<span id="358">358</span>
-<span id="359">359</span>
-<span id="360">360</span>
-<span id="361">361</span>
-<span id="362">362</span>
-<span id="363">363</span>
-<span id="364">364</span>
-<span id="365">365</span>
-<span id="366">366</span>
-<span id="367">367</span>
-<span id="368">368</span>
-<span id="369">369</span>
-<span id="370">370</span>
-<span id="371">371</span>
-<span id="372">372</span>
-<span id="373">373</span>
-<span id="374">374</span>
-<span id="375">375</span>
-<span id="376">376</span>
-<span id="377">377</span>
-<span id="378">378</span>
-<span id="379">379</span>
-<span id="380">380</span>
-<span id="381">381</span>
-<span id="382">382</span>
-<span id="383">383</span>
-<span id="384">384</span>
-<span id="385">385</span>
-<span id="386">386</span>
-<span id="387">387</span>
-<span id="388">388</span>
-<span id="389">389</span>
-<span id="390">390</span>
-<span id="391">391</span>
-<span id="392">392</span>
-<span id="393">393</span>
-<span id="394">394</span>
-<span id="395">395</span>
-<span id="396">396</span>
-<span id="397">397</span>
-<span id="398">398</span>
-<span id="399">399</span>
-<span id="400">400</span>
-<span id="401">401</span>
-<span id="402">402</span>
-<span id="403">403</span>
-<span id="404">404</span>
-<span id="405">405</span>
-<span id="406">406</span>
-<span id="407">407</span>
-<span id="408">408</span>
-<span id="409">409</span>
-<span id="410">410</span>
-<span id="411">411</span>
-<span id="412">412</span>
-<span id="413">413</span>
-<span id="414">414</span>
-<span id="415">415</span>
-<span id="416">416</span>
-<span id="417">417</span>
-<span id="418">418</span>
-<span id="419">419</span>
-<span id="420">420</span>
-<span id="421">421</span>
-<span id="422">422</span>
-<span id="423">423</span>
-<span id="424">424</span>
-<span id="425">425</span>
-<span id="426">426</span>
-<span id="427">427</span>
-<span id="428">428</span>
-<span id="429">429</span>
-<span id="430">430</span>
-<span id="431">431</span>
-<span id="432">432</span>
-<span id="433">433</span>
-<span id="434">434</span>
-<span id="435">435</span>
-<span id="436">436</span>
-<span id="437">437</span>
-<span id="438">438</span>
-<span id="439">439</span>
-<span id="440">440</span>
-<span id="441">441</span>
-<span id="442">442</span>
-<span id="443">443</span>
-<span id="444">444</span>
-<span id="445">445</span>
-<span id="446">446</span>
-<span id="447">447</span>
-<span id="448">448</span>
-<span id="449">449</span>
-<span id="450">450</span>
-<span id="451">451</span>
-<span id="452">452</span>
-<span id="453">453</span>
-<span id="454">454</span>
-<span id="455">455</span>
-<span id="456">456</span>
-<span id="457">457</span>
-<span id="458">458</span>
-<span id="459">459</span>
-<span id="460">460</span>
-<span id="461">461</span>
-<span id="462">462</span>
-<span id="463">463</span>
-<span id="464">464</span>
-<span id="465">465</span>
-<span id="466">466</span>
-<span id="467">467</span>
-<span id="468">468</span>
-<span id="469">469</span>
-<span id="470">470</span>
-<span id="471">471</span>
-<span id="472">472</span>
-<span id="473">473</span>
-<span id="474">474</span>
-<span id="475">475</span>
-<span id="476">476</span>
-<span id="477">477</span>
-<span id="478">478</span>
-<span id="479">479</span>
-<span id="480">480</span>
-<span id="481">481</span>
-<span id="482">482</span>
-<span id="483">483</span>
-<span id="484">484</span>
-<span id="485">485</span>
-<span id="486">486</span>
-<span id="487">487</span>
-<span id="488">488</span>
-<span id="489">489</span>
-<span id="490">490</span>
-<span id="491">491</span>
-<span id="492">492</span>
-<span id="493">493</span>
-<span id="494">494</span>
-<span id="495">495</span>
-<span id="496">496</span>
-<span id="497">497</span>
-<span id="498">498</span>
-<span id="499">499</span>
-<span id="500">500</span>
-<span id="501">501</span>
-<span id="502">502</span>
-<span id="503">503</span>
-<span id="504">504</span>
-<span id="505">505</span>
-<span id="506">506</span>
-<span id="507">507</span>
-<span id="508">508</span>
-<span id="509">509</span>
-<span id="510">510</span>
-<span id="511">511</span>
-<span id="512">512</span>
-<span id="513">513</span>
-<span id="514">514</span>
-<span id="515">515</span>
-<span id="516">516</span>
-<span id="517">517</span>
-<span id="518">518</span>
-<span id="519">519</span>
-<span id="520">520</span>
-<span id="521">521</span>
-<span id="522">522</span>
-<span id="523">523</span>
-<span id="524">524</span>
-<span id="525">525</span>
-<span id="526">526</span>
-<span id="527">527</span>
-<span id="528">528</span>
-<span id="529">529</span>
-<span id="530">530</span>
-<span id="531">531</span>
-<span id="532">532</span>
-<span id="533">533</span>
-<span id="534">534</span>
-<span id="535">535</span>
-<span id="536">536</span>
-<span id="537">537</span>
-<span id="538">538</span>
-<span id="539">539</span>
-<span id="540">540</span>
-<span id="541">541</span>
-<span id="542">542</span>
-<span id="543">543</span>
-<span id="544">544</span>
-<span id="545">545</span>
-<span id="546">546</span>
-<span id="547">547</span>
-<span id="548">548</span>
-<span id="549">549</span>
-<span id="550">550</span>
-<span id="551">551</span>
-<span id="552">552</span>
-<span id="553">553</span>
-<span id="554">554</span>
-<span id="555">555</span>
-<span id="556">556</span>
-<span id="557">557</span>
-<span id="558">558</span>
-<span id="559">559</span>
-<span id="560">560</span>
-<span id="561">561</span>
-<span id="562">562</span>
-<span id="563">563</span>
-<span id="564">564</span>
-<span id="565">565</span>
-<span id="566">566</span>
-<span id="567">567</span>
-<span id="568">568</span>
-<span id="569">569</span>
-<span id="570">570</span>
-<span id="571">571</span>
-<span id="572">572</span>
-<span id="573">573</span>
-<span id="574">574</span>
-<span id="575">575</span>
-<span id="576">576</span>
-<span id="577">577</span>
-<span id="578">578</span>
-<span id="579">579</span>
-<span id="580">580</span>
-<span id="581">581</span>
-<span id="582">582</span>
-<span id="583">583</span>
-<span id="584">584</span>
-<span id="585">585</span>
-<span id="586">586</span>
-<span id="587">587</span>
-<span id="588">588</span>
-<span id="589">589</span>
-<span id="590">590</span>
-<span id="591">591</span>
-<span id="592">592</span>
-<span id="593">593</span>
-<span id="594">594</span>
-<span id="595">595</span>
-<span id="596">596</span>
-<span id="597">597</span>
-<span id="598">598</span>
-<span id="599">599</span>
-<span id="600">600</span>
-<span id="601">601</span>
-<span id="602">602</span>
-<span id="603">603</span>
-<span id="604">604</span>
-<span id="605">605</span>
-<span id="606">606</span>
-<span id="607">607</span>
-<span id="608">608</span>
-<span id="609">609</span>
-<span id="610">610</span>
-<span id="611">611</span>
-<span id="612">612</span>
-<span id="613">613</span>
-<span id="614">614</span>
-<span id="615">615</span>
-<span id="616">616</span>
-<span id="617">617</span>
-<span id="618">618</span>
-<span id="619">619</span>
-<span id="620">620</span>
-<span id="621">621</span>
-<span id="622">622</span>
-<span id="623">623</span>
-<span id="624">624</span>
-<span id="625">625</span>
-<span id="626">626</span>
-<span id="627">627</span>
-<span id="628">628</span>
-<span id="629">629</span>
-<span id="630">630</span>
-<span id="631">631</span>
-<span id="632">632</span>
-<span id="633">633</span>
-<span id="634">634</span>
-<span id="635">635</span>
-<span id="636">636</span>
-<span id="637">637</span>
-<span id="638">638</span>
-<span id="639">639</span>
-<span id="640">640</span>
-<span id="641">641</span>
-<span id="642">642</span>
-<span id="643">643</span>
-<span id="644">644</span>
-<span id="645">645</span>
-<span id="646">646</span>
-<span id="647">647</span>
-<span id="648">648</span>
-<span id="649">649</span>
-<span id="650">650</span>
-<span id="651">651</span>
-<span id="652">652</span>
-<span id="653">653</span>
-<span id="654">654</span>
-<span id="655">655</span>
-<span id="656">656</span>
-<span id="657">657</span>
-<span id="658">658</span>
-<span id="659">659</span>
-<span id="660">660</span>
-<span id="661">661</span>
-<span id="662">662</span>
-<span id="663">663</span>
-<span id="664">664</span>
-<span id="665">665</span>
-<span id="666">666</span>
-<span id="667">667</span>
-<span id="668">668</span>
-<span id="669">669</span>
-<span id="670">670</span>
-<span id="671">671</span>
-<span id="672">672</span>
-<span id="673">673</span>
-<span id="674">674</span>
-<span id="675">675</span>
-<span id="676">676</span>
-<span id="677">677</span>
-<span id="678">678</span>
-<span id="679">679</span>
-<span id="680">680</span>
-<span id="681">681</span>
-<span id="682">682</span>
-<span id="683">683</span>
-<span id="684">684</span>
-<span id="685">685</span>
-<span id="686">686</span>
-<span id="687">687</span>
-<span id="688">688</span>
-<span id="689">689</span>
-<span id="690">690</span>
-<span id="691">691</span>
-<span id="692">692</span>
-<span id="693">693</span>
-<span id="694">694</span>
-<span id="695">695</span>
-<span id="696">696</span>
-<span id="697">697</span>
-<span id="698">698</span>
-<span id="699">699</span>
-<span id="700">700</span>
-<span id="701">701</span>
-<span id="702">702</span>
-<span id="703">703</span>
-<span id="704">704</span>
-<span id="705">705</span>
-<span id="706">706</span>
-<span id="707">707</span>
-<span id="708">708</span>
-<span id="709">709</span>
-<span id="710">710</span>
-<span id="711">711</span>
-<span id="712">712</span>
-<span id="713">713</span>
-<span id="714">714</span>
-<span id="715">715</span>
-<span id="716">716</span>
-<span id="717">717</span>
-<span id="718">718</span>
-<span id="719">719</span>
-<span id="720">720</span>
-<span id="721">721</span>
-<span id="722">722</span>
-<span id="723">723</span>
-<span id="724">724</span>
-<span id="725">725</span>
-<span id="726">726</span>
-<span id="727">727</span>
-<span id="728">728</span>
-<span id="729">729</span>
-<span id="730">730</span>
-<span id="731">731</span>
-<span id="732">732</span>
-<span id="733">733</span>
-<span id="734">734</span>
-<span id="735">735</span>
-<span id="736">736</span>
-<span id="737">737</span>
-<span id="738">738</span>
-<span id="739">739</span>
-<span id="740">740</span>
-<span id="741">741</span>
-<span id="742">742</span>
-<span id="743">743</span>
-<span id="744">744</span>
-<span id="745">745</span>
-<span id="746">746</span>
-<span id="747">747</span>
-<span id="748">748</span>
-<span id="749">749</span>
-<span id="750">750</span>
-<span id="751">751</span>
-<span id="752">752</span>
-<span id="753">753</span>
-<span id="754">754</span>
-<span id="755">755</span>
-<span id="756">756</span>
-<span id="757">757</span>
-<span id="758">758</span>
-<span id="759">759</span>
-<span id="760">760</span>
-<span id="761">761</span>
-<span id="762">762</span>
-<span id="763">763</span>
-<span id="764">764</span>
-<span id="765">765</span>
-<span id="766">766</span>
-<span id="767">767</span>
-<span id="768">768</span>
-<span id="769">769</span>
-<span id="770">770</span>
-<span id="771">771</span>
-<span id="772">772</span>
-<span id="773">773</span>
-<span id="774">774</span>
-<span id="775">775</span>
-<span id="776">776</span>
-<span id="777">777</span>
-<span id="778">778</span>
-<span id="779">779</span>
-<span id="780">780</span>
-<span id="781">781</span>
-<span id="782">782</span>
-<span id="783">783</span>
-<span id="784">784</span>
-<span id="785">785</span>
-<span id="786">786</span>
-<span id="787">787</span>
-<span id="788">788</span>
-<span id="789">789</span>
-<span id="790">790</span>
-<span id="791">791</span>
-<span id="792">792</span>
-<span id="793">793</span>
-<span id="794">794</span>
-<span id="795">795</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="doccomment">//! Descriptor policy</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! This module implements the logic to extract and represent the spending policies of a descriptor</span>
-<span class="doccomment">//! in a more human-readable format.</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ## Example</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ```</span>
-<span class="doccomment">//! # use std::sync::Arc;</span>
-<span class="doccomment">//! # use magical::descriptor::*;</span>
-<span class="doccomment">//! let desc = "wsh(and_v(v:pk(cV3oCth6zxZ1UVsHLnGothsWNsaoxRhC6aeNi5VbSdFpwUkgkEci),or_d(pk(cVMTy7uebJgvFaSBwcgvwk8qn8xSLc97dKow4MBetjrrahZoimm2),older(12960))))";</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! let (extended_desc, key_map) = ExtendedDescriptor::parse_secret(desc)?;</span>
-<span class="doccomment">//! println!("{:?}", extended_desc);</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! let signers = Arc::new(key_map.into());</span>
-<span class="doccomment">//! let policy = extended_desc.extract_policy(signers)?;</span>
-<span class="doccomment">//! println!("policy: {}", serde_json::to_string(&policy)?);</span>
-<span class="doccomment">//! # Ok::<(), magical::Error>(())</span>
-<span class="doccomment">//! ```</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">cmp</span>::<span class="ident">max</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::{<span class="ident">BTreeMap</span>, <span class="ident">HashSet</span>, <span class="ident">VecDeque</span>};
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>;
-
-<span class="kw">use</span> <span class="ident">serde</span>::<span class="ident">ser</span>::<span class="ident">SerializeMap</span>;
-<span class="kw">use</span> <span class="ident">serde</span>::{<span class="ident">Serialize</span>, <span class="ident">Serializer</span>};
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="kw-2">*</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">Fingerprint</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">PublicKey</span>;
-
-<span class="kw">use</span> <span class="ident">miniscript</span>::<span class="ident">descriptor</span>::<span class="ident">DescriptorPublicKey</span>;
-<span class="kw">use</span> <span class="ident">miniscript</span>::{<span class="ident">Descriptor</span>, <span class="ident">Miniscript</span>, <span class="ident">MiniscriptKey</span>, <span class="ident">ScriptContext</span>, <span class="ident">Terminal</span>};
-
-<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_imports</span>)]</span>
-<span class="kw">use</span> <span class="ident">log</span>::{<span class="ident">debug</span>, <span class="ident">error</span>, <span class="ident">info</span>, <span class="ident">trace</span>};
-
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">ExtractPolicy</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">signer</span>::{<span class="ident">SignerId</span>, <span class="ident">SignersContainer</span>};
-
-<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">checksum</span>::<span class="ident">get_checksum</span>;
-<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
-<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">XKeyUtils</span>;
-
-<span class="doccomment">/// Raw public key or extended key fingerprint</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">Default</span>, <span class="ident">Serialize</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">PKOrF</span> {
- <span class="attribute">#[<span class="ident">serde</span>(<span class="ident">skip_serializing_if</span> <span class="op">=</span> <span class="string">"Option::is_none"</span>)]</span>
- <span class="ident">pubkey</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">PublicKey</span><span class="op">></span>,
- <span class="attribute">#[<span class="ident">serde</span>(<span class="ident">skip_serializing_if</span> <span class="op">=</span> <span class="string">"Option::is_none"</span>)]</span>
- <span class="ident">pubkey_hash</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">hash160</span>::<span class="ident">Hash</span><span class="op">></span>,
- <span class="attribute">#[<span class="ident">serde</span>(<span class="ident">skip_serializing_if</span> <span class="op">=</span> <span class="string">"Option::is_none"</span>)]</span>
- <span class="ident">fingerprint</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Fingerprint</span><span class="op">></span>,
-}
-
-<span class="kw">impl</span> <span class="ident">PKOrF</span> {
- <span class="kw">fn</span> <span class="ident">from_key</span>(<span class="ident">k</span>: <span class="kw-2">&</span><span class="ident">DescriptorPublicKey</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="kw">match</span> <span class="ident">k</span> {
- <span class="ident">DescriptorPublicKey</span>::<span class="ident">PubKey</span>(<span class="ident">pubkey</span>) <span class="op">=</span><span class="op">></span> <span class="ident">PKOrF</span> {
- <span class="ident">pubkey</span>: <span class="prelude-val">Some</span>(<span class="kw-2">*</span><span class="ident">pubkey</span>),
- ..<span class="ident">Default</span>::<span class="ident">default</span>()
- },
- <span class="ident">DescriptorPublicKey</span>::<span class="ident">XPub</span>(<span class="ident">xpub</span>) <span class="op">=</span><span class="op">></span> <span class="ident">PKOrF</span> {
- <span class="ident">fingerprint</span>: <span class="prelude-val">Some</span>(<span class="ident">xpub</span>.<span class="ident">root_fingerprint</span>()),
- ..<span class="ident">Default</span>::<span class="ident">default</span>()
- },
- }
- }
-
- <span class="kw">fn</span> <span class="ident">from_key_hash</span>(<span class="ident">k</span>: <span class="ident">hash160</span>::<span class="ident">Hash</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">PKOrF</span> {
- <span class="ident">pubkey_hash</span>: <span class="prelude-val">Some</span>(<span class="ident">k</span>),
- ..<span class="ident">Default</span>::<span class="ident">default</span>()
- }
- }
-}
-
-<span class="doccomment">/// An item that need to be satisfied</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">Serialize</span>)]</span>
-<span class="attribute">#[<span class="ident">serde</span>(<span class="ident">tag</span> <span class="op">=</span> <span class="string">"type"</span>, <span class="ident">rename_all</span> <span class="op">=</span> <span class="string">"UPPERCASE"</span>)]</span>
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">SatisfiableItem</span> {
- <span class="comment">// Leaves</span>
- <span class="ident">Signature</span>(<span class="ident">PKOrF</span>),
- <span class="ident">SignatureKey</span>(<span class="ident">PKOrF</span>),
- <span class="ident">SHA256Preimage</span> {
- <span class="ident">hash</span>: <span class="ident">sha256</span>::<span class="ident">Hash</span>,
- },
- <span class="ident">HASH256Preimage</span> {
- <span class="ident">hash</span>: <span class="ident">sha256d</span>::<span class="ident">Hash</span>,
- },
- <span class="ident">RIPEMD160Preimage</span> {
- <span class="ident">hash</span>: <span class="ident">ripemd160</span>::<span class="ident">Hash</span>,
- },
- <span class="ident">HASH160Preimage</span> {
- <span class="ident">hash</span>: <span class="ident">hash160</span>::<span class="ident">Hash</span>,
- },
- <span class="ident">AbsoluteTimelock</span> {
- <span class="ident">value</span>: <span class="ident">u32</span>,
- },
- <span class="ident">RelativeTimelock</span> {
- <span class="ident">value</span>: <span class="ident">u32</span>,
- },
-
- <span class="comment">// Complex item</span>
- <span class="ident">Thresh</span> {
- <span class="ident">items</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>,
- <span class="ident">threshold</span>: <span class="ident">usize</span>,
- },
- <span class="ident">Multisig</span> {
- <span class="ident">keys</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">PKOrF</span><span class="op">></span>,
- <span class="ident">threshold</span>: <span class="ident">usize</span>,
- },
-}
-
-<span class="kw">impl</span> <span class="ident">SatisfiableItem</span> {
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_leaf</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="kw">match</span> <span class="self">self</span> {
- <span class="ident">SatisfiableItem</span>::<span class="ident">Thresh</span> {
- <span class="ident">items</span>: <span class="kw">_</span>,
- <span class="ident">threshold</span>: <span class="kw">_</span>,
- } <span class="op">=</span><span class="op">></span> <span class="bool-val">false</span>,
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="bool-val">true</span>,
- }
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">id</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">String</span> {
- <span class="ident">get_checksum</span>(<span class="kw-2">&</span><span class="ident">serde_json</span>::<span class="ident">to_string</span>(<span class="self">self</span>).<span class="ident">expect</span>(<span class="string">"Failed to serialize a SatisfiableItem"</span>))
- .<span class="ident">expect</span>(<span class="string">"Failed to compute a SatisfiableItem id"</span>)
- }
-}
-
-<span class="kw">fn</span> <span class="ident">combinations</span>(<span class="ident">vec</span>: <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>, <span class="ident">size</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span><span class="op">></span> {
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">vec</span>.<span class="ident">len</span>() <span class="op">></span><span class="op">=</span> <span class="ident">size</span>);
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">answer</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">queue</span> <span class="op">=</span> <span class="ident">VecDeque</span>::<span class="ident">new</span>();
- <span class="kw">for</span> (<span class="ident">index</span>, <span class="ident">val</span>) <span class="kw">in</span> <span class="ident">vec</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">new_vec</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">size</span>);
- <span class="ident">new_vec</span>.<span class="ident">push</span>(<span class="kw-2">*</span><span class="ident">val</span>);
- <span class="ident">queue</span>.<span class="ident">push_back</span>((<span class="ident">index</span>, <span class="ident">new_vec</span>));
- }
-
- <span class="kw">while</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">index</span>, <span class="ident">vals</span>)) <span class="op">=</span> <span class="ident">queue</span>.<span class="ident">pop_front</span>() {
- <span class="kw">if</span> <span class="ident">vals</span>.<span class="ident">len</span>() <span class="op">></span><span class="op">=</span> <span class="ident">size</span> {
- <span class="ident">answer</span>.<span class="ident">push</span>(<span class="ident">vals</span>);
- } <span class="kw">else</span> {
- <span class="kw">for</span> (<span class="ident">new_index</span>, <span class="ident">val</span>) <span class="kw">in</span> <span class="ident">vec</span>.<span class="ident">iter</span>().<span class="ident">skip</span>(<span class="ident">index</span> <span class="op">+</span> <span class="number">1</span>).<span class="ident">enumerate</span>() {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cloned</span> <span class="op">=</span> <span class="ident">vals</span>.<span class="ident">clone</span>();
- <span class="ident">cloned</span>.<span class="ident">push</span>(<span class="kw-2">*</span><span class="ident">val</span>);
- <span class="ident">queue</span>.<span class="ident">push_front</span>((<span class="ident">new_index</span>, <span class="ident">cloned</span>));
- }
- }
- }
-
- <span class="ident">answer</span>
-}
-
-<span class="kw">fn</span> <span class="ident">mix</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">Clone</span><span class="op">></span>(<span class="ident">vec</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">T</span><span class="op">></span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">T</span><span class="op">></span><span class="op">></span> {
- <span class="kw">if</span> <span class="ident">vec</span>.<span class="ident">is_empty</span>() <span class="op">|</span><span class="op">|</span> <span class="ident">vec</span>.<span class="ident">iter</span>().<span class="ident">any</span>(<span class="ident">Vec</span>::<span class="ident">is_empty</span>) {
- <span class="kw">return</span> <span class="macro">vec</span><span class="macro">!</span>[];
- }
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">answer</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
- <span class="kw">let</span> <span class="ident">size</span> <span class="op">=</span> <span class="ident">vec</span>.<span class="ident">len</span>();
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">queue</span> <span class="op">=</span> <span class="ident">VecDeque</span>::<span class="ident">new</span>();
- <span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">vec</span>[<span class="number">0</span>] {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">new_vec</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">size</span>);
- <span class="ident">new_vec</span>.<span class="ident">push</span>(<span class="ident">i</span>.<span class="ident">clone</span>());
- <span class="ident">queue</span>.<span class="ident">push_back</span>(<span class="ident">new_vec</span>);
- }
-
- <span class="kw">while</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">vals</span>) <span class="op">=</span> <span class="ident">queue</span>.<span class="ident">pop_front</span>() {
- <span class="kw">if</span> <span class="ident">vals</span>.<span class="ident">len</span>() <span class="op">></span><span class="op">=</span> <span class="ident">size</span> {
- <span class="ident">answer</span>.<span class="ident">push</span>(<span class="ident">vals</span>);
- } <span class="kw">else</span> {
- <span class="kw">let</span> <span class="ident">level</span> <span class="op">=</span> <span class="ident">vals</span>.<span class="ident">len</span>();
- <span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">vec</span>[<span class="ident">level</span>] {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cloned</span> <span class="op">=</span> <span class="ident">vals</span>.<span class="ident">clone</span>();
- <span class="ident">cloned</span>.<span class="ident">push</span>(<span class="ident">i</span>.<span class="ident">clone</span>());
- <span class="ident">queue</span>.<span class="ident">push_front</span>(<span class="ident">cloned</span>);
- }
- }
- }
-
- <span class="ident">answer</span>
-}
-
-<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">ConditionMap</span> <span class="op">=</span> <span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">usize</span>, <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Condition</span><span class="op">></span><span class="op">></span>;
-<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">FoldedConditionMap</span> <span class="op">=</span> <span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>, <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Condition</span><span class="op">></span><span class="op">></span>;
-
-<span class="kw">fn</span> <span class="ident">serialize_folded_cond_map</span><span class="op"><</span><span class="ident">S</span><span class="op">></span>(
- <span class="ident">input_map</span>: <span class="kw-2">&</span><span class="ident">FoldedConditionMap</span>,
- <span class="ident">serializer</span>: <span class="ident">S</span>,
-) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">S</span>::<span class="prelude-val">Ok</span>, <span class="ident">S</span>::<span class="ident">Error</span><span class="op">></span>
-<span class="kw">where</span>
- <span class="ident">S</span>: <span class="ident">Serializer</span>,
-{
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">serializer</span>.<span class="ident">serialize_map</span>(<span class="prelude-val">Some</span>(<span class="ident">input_map</span>.<span class="ident">len</span>()))<span class="question-mark">?</span>;
- <span class="kw">for</span> (<span class="ident">k</span>, <span class="ident">v</span>) <span class="kw">in</span> <span class="ident">input_map</span> {
- <span class="kw">let</span> <span class="ident">k_string</span> <span class="op">=</span> <span class="macro">format</span><span class="macro">!</span>(<span class="string">"{:?}"</span>, <span class="ident">k</span>);
- <span class="ident">map</span>.<span class="ident">serialize_entry</span>(<span class="kw-2">&</span><span class="ident">k_string</span>, <span class="ident">v</span>)<span class="question-mark">?</span>;
- }
- <span class="ident">map</span>.<span class="ident">end</span>()
-}
-
-<span class="doccomment">/// Represent if and how much a policy item is satisfied by the wallet's descriptor</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">Serialize</span>)]</span>
-<span class="attribute">#[<span class="ident">serde</span>(<span class="ident">tag</span> <span class="op">=</span> <span class="string">"type"</span>, <span class="ident">rename_all</span> <span class="op">=</span> <span class="string">"UPPERCASE"</span>)]</span>
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">Satisfaction</span> {
- <span class="doccomment">/// Only a partial satisfaction of some kind of threshold policy</span>
- <span class="ident">Partial</span> {
- <span class="doccomment">/// Total number of items</span>
- <span class="ident">n</span>: <span class="ident">usize</span>,
- <span class="doccomment">/// Threshold</span>
- <span class="ident">m</span>: <span class="ident">usize</span>,
- <span class="doccomment">/// The items that can be satisfied by the descriptor</span>
- <span class="ident">items</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
- <span class="attribute">#[<span class="ident">serde</span>(<span class="ident">skip_serializing_if</span> <span class="op">=</span> <span class="string">"BTreeMap::is_empty"</span>)]</span>
- <span class="doccomment">/// Extra conditions that also need to be satisfied</span>
- <span class="ident">conditions</span>: <span class="ident">ConditionMap</span>,
- },
- <span class="doccomment">/// Can reach the threshold of some kind of threshold policy</span>
- <span class="ident">PartialComplete</span> {
- <span class="doccomment">/// Total number of items</span>
- <span class="ident">n</span>: <span class="ident">usize</span>,
- <span class="doccomment">/// Threshold</span>
- <span class="ident">m</span>: <span class="ident">usize</span>,
- <span class="doccomment">/// The items that can be satisfied by the descriptor</span>
- <span class="ident">items</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
- <span class="attribute">#[<span class="ident">serde</span>(
- <span class="ident">serialize_with</span> <span class="op">=</span> <span class="string">"serialize_folded_cond_map"</span>,
- <span class="ident">skip_serializing_if</span> <span class="op">=</span> <span class="string">"BTreeMap::is_empty"</span>
- )]</span>
- <span class="doccomment">/// Extra conditions that also need to be satisfied</span>
- <span class="ident">conditions</span>: <span class="ident">FoldedConditionMap</span>,
- },
-
- <span class="doccomment">/// Can satisfy the policy item</span>
- <span class="ident">Complete</span> {
- <span class="doccomment">/// Extra conditions that also need to be satisfied</span>
- <span class="ident">condition</span>: <span class="ident">Condition</span>,
- },
- <span class="doccomment">/// Cannot satisfy or contribute to the policy item</span>
- <span class="prelude-val">None</span>,
-}
-
-<span class="kw">impl</span> <span class="ident">Satisfaction</span> {
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_leaf</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="kw">match</span> <span class="self">self</span> {
- <span class="ident">Satisfaction</span>::<span class="prelude-val">None</span> <span class="op">|</span> <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> { .. } <span class="op">=</span><span class="op">></span> <span class="bool-val">true</span>,
- <span class="ident">Satisfaction</span>::<span class="ident">PartialComplete</span> { .. } <span class="op">|</span> <span class="ident">Satisfaction</span>::<span class="ident">Partial</span> { .. } <span class="op">=</span><span class="op">></span> <span class="bool-val">false</span>,
- }
- }
-
- <span class="comment">// add `inner` as one of self's partial items. this only makes sense on partials</span>
- <span class="kw">fn</span> <span class="ident">add</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">inner</span>: <span class="kw-2">&</span><span class="ident">Satisfaction</span>, <span class="ident">inner_index</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">PolicyError</span><span class="op">></span> {
- <span class="kw">match</span> <span class="self">self</span> {
- <span class="ident">Satisfaction</span>::<span class="prelude-val">None</span> <span class="op">|</span> <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> { .. } <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="ident">PolicyError</span>::<span class="ident">AddOnLeaf</span>),
- <span class="ident">Satisfaction</span>::<span class="ident">PartialComplete</span> { .. } <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="ident">PolicyError</span>::<span class="ident">AddOnPartialComplete</span>),
- <span class="ident">Satisfaction</span>::<span class="ident">Partial</span> {
- <span class="ident">n</span>,
- <span class="kw-2">ref</span> <span class="kw-2">mut</span> <span class="ident">conditions</span>,
- <span class="kw-2">ref</span> <span class="kw-2">mut</span> <span class="ident">items</span>,
- ..
- } <span class="op">=</span><span class="op">></span> {
- <span class="kw">if</span> <span class="ident">inner_index</span> <span class="op">></span><span class="op">=</span> <span class="kw-2">*</span><span class="ident">n</span> <span class="op">|</span><span class="op">|</span> <span class="ident">items</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">inner_index</span>) {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">PolicyError</span>::<span class="ident">IndexOutOfRange</span>(<span class="ident">inner_index</span>));
- }
-
- <span class="kw">match</span> <span class="ident">inner</span> {
- <span class="comment">// not relevant if not completed yet</span>
- <span class="ident">Satisfaction</span>::<span class="prelude-val">None</span> <span class="op">|</span> <span class="ident">Satisfaction</span>::<span class="ident">Partial</span> { .. } <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Ok</span>(()),
- <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> { <span class="ident">condition</span> } <span class="op">=</span><span class="op">></span> {
- <span class="ident">items</span>.<span class="ident">push</span>(<span class="ident">inner_index</span>);
- <span class="ident">conditions</span>.<span class="ident">insert</span>(<span class="ident">inner_index</span>, <span class="macro">vec</span><span class="macro">!</span>[<span class="kw-2">*</span><span class="ident">condition</span>].<span class="ident">into_iter</span>().<span class="ident">collect</span>());
- }
- <span class="ident">Satisfaction</span>::<span class="ident">PartialComplete</span> {
- <span class="ident">conditions</span>: <span class="ident">other_conditions</span>,
- ..
- } <span class="op">=</span><span class="op">></span> {
- <span class="ident">items</span>.<span class="ident">push</span>(<span class="ident">inner_index</span>);
- <span class="kw">let</span> <span class="ident">conditions_set</span> <span class="op">=</span> <span class="ident">other_conditions</span>
- .<span class="ident">values</span>()
- .<span class="ident">fold</span>(<span class="ident">HashSet</span>::<span class="ident">new</span>(), <span class="op">|</span><span class="ident">set</span>, <span class="ident">i</span><span class="op">|</span> <span class="ident">set</span>.<span class="ident">union</span>(<span class="kw-2">&</span><span class="ident">i</span>).<span class="ident">cloned</span>().<span class="ident">collect</span>());
- <span class="ident">conditions</span>.<span class="ident">insert</span>(<span class="ident">inner_index</span>, <span class="ident">conditions_set</span>);
- }
- }
-
- <span class="prelude-val">Ok</span>(())
- }
- }
- }
-
- <span class="kw">fn</span> <span class="ident">finalize</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">PolicyError</span><span class="op">></span> {
- <span class="comment">// if partial try to bump it to a partialcomplete</span>
- <span class="kw">if</span> <span class="kw">let</span> <span class="ident">Satisfaction</span>::<span class="ident">Partial</span> {
- <span class="ident">n</span>,
- <span class="ident">m</span>,
- <span class="ident">items</span>,
- <span class="ident">conditions</span>,
- } <span class="op">=</span> <span class="self">self</span>
- {
- <span class="kw">if</span> <span class="ident">items</span>.<span class="ident">len</span>() <span class="op">></span><span class="op">=</span> <span class="kw-2">*</span><span class="ident">m</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
- <span class="kw">let</span> <span class="ident">indexes</span> <span class="op">=</span> <span class="ident">combinations</span>(<span class="ident">items</span>, <span class="kw-2">*</span><span class="ident">m</span>);
- <span class="comment">// `indexes` at this point is a Vec<Vec<usize>>, with the "n choose k" of items (m of n)</span>
- <span class="ident">indexes</span>
- .<span class="ident">into_iter</span>()
- <span class="comment">// .inspect(|x| println!("--- orig --- {:?}", x))</span>
- <span class="comment">// we map each of the combinations of elements into a tuple of ([choosen items], [conditions]). unfortunately, those items have potentially more than one</span>
- <span class="comment">// condition (think about ORs), so we also use `mix` to expand those, i.e. [[0], [1, 2]] becomes [[0, 1], [0, 2]]. This is necessary to make sure that we</span>
- <span class="comment">// consider every possibile options and check whether or not they are compatible.</span>
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">i_vec</span><span class="op">|</span> {
- <span class="ident">mix</span>(<span class="ident">i_vec</span>
- .<span class="ident">iter</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> {
- <span class="ident">conditions</span>
- .<span class="ident">get</span>(<span class="ident">i</span>)
- .<span class="ident">and_then</span>(<span class="op">|</span><span class="ident">set</span><span class="op">|</span> <span class="prelude-val">Some</span>(<span class="ident">set</span>.<span class="ident">clone</span>().<span class="ident">into_iter</span>().<span class="ident">collect</span>()))
- .<span class="ident">unwrap_or</span>(<span class="macro">vec</span><span class="macro">!</span>[])
- })
- .<span class="ident">collect</span>())
- .<span class="ident">into_iter</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> (<span class="ident">i_vec</span>.<span class="ident">clone</span>(), <span class="ident">x</span>))
- .<span class="ident">collect</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span>(<span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>, <span class="ident">Vec</span><span class="op"><</span><span class="ident">Condition</span><span class="op">></span>)<span class="op">></span><span class="op">></span>()
- })
- <span class="comment">// .inspect(|x: &Vec<(Vec<usize>, Vec<Condition>)>| println!("fetch {:?}", x))</span>
- <span class="comment">// since the previous step can turn one item of the iterator into multiple ones, we call flatten to expand them out</span>
- .<span class="ident">flatten</span>()
- <span class="comment">// .inspect(|x| println!("flat {:?}", x))</span>
- <span class="comment">// try to fold all the conditions for this specific combination of indexes/options. if they are not compatibile, try_fold will be Err</span>
- .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">key</span>, <span class="ident">val</span>)<span class="op">|</span> {
- (
- <span class="ident">key</span>,
- <span class="ident">val</span>.<span class="ident">into_iter</span>()
- .<span class="ident">try_fold</span>(<span class="ident">Condition</span>::<span class="ident">default</span>(), <span class="op">|</span><span class="ident">acc</span>, <span class="ident">v</span><span class="op">|</span> <span class="ident">acc</span>.<span class="ident">merge</span>(<span class="kw-2">&</span><span class="ident">v</span>)),
- )
- })
- <span class="comment">// .inspect(|x| println!("try_fold {:?}", x))</span>
- <span class="comment">// filter out all the incompatible combinations</span>
- .<span class="ident">filter</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">val</span>)<span class="op">|</span> <span class="ident">val</span>.<span class="ident">is_ok</span>())
- <span class="comment">// .inspect(|x| println!("filter {:?}", x))</span>
- <span class="comment">// push them into the map</span>
- .<span class="ident">for_each</span>(<span class="op">|</span>(<span class="ident">key</span>, <span class="ident">val</span>)<span class="op">|</span> {
- <span class="ident">map</span>.<span class="ident">entry</span>(<span class="ident">key</span>)
- .<span class="ident">or_insert_with</span>(<span class="ident">HashSet</span>::<span class="ident">new</span>)
- .<span class="ident">insert</span>(<span class="ident">val</span>.<span class="ident">unwrap</span>());
- });
- <span class="comment">// TODO: if the map is empty, the conditions are not compatible, return an error?</span>
- <span class="kw-2">*</span><span class="self">self</span> <span class="op">=</span> <span class="ident">Satisfaction</span>::<span class="ident">PartialComplete</span> {
- <span class="ident">n</span>: <span class="kw-2">*</span><span class="ident">n</span>,
- <span class="ident">m</span>: <span class="kw-2">*</span><span class="ident">m</span>,
- <span class="ident">items</span>: <span class="ident">items</span>.<span class="ident">clone</span>(),
- <span class="ident">conditions</span>: <span class="ident">map</span>,
- };
- }
- }
-
- <span class="prelude-val">Ok</span>(())
- }
-}
-
-<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">bool</span><span class="op">></span> <span class="kw">for</span> <span class="ident">Satisfaction</span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">other</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="kw">if</span> <span class="ident">other</span> {
- <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> {
- <span class="ident">condition</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
- }
- } <span class="kw">else</span> {
- <span class="ident">Satisfaction</span>::<span class="prelude-val">None</span>
- }
- }
-}
-
-<span class="doccomment">/// Descriptor spending policy</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">Serialize</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Policy</span> {
- <span class="doccomment">/// Identifier for this policy node</span>
- <span class="kw">pub</span> <span class="ident">id</span>: <span class="ident">String</span>,
-
- <span class="doccomment">/// Type of this policy node</span>
- <span class="attribute">#[<span class="ident">serde</span>(<span class="ident">flatten</span>)]</span>
- <span class="kw">pub</span> <span class="ident">item</span>: <span class="ident">SatisfiableItem</span>,
- <span class="doccomment">/// How a much given PSBT already satisfies this polcy node **(currently unused)**</span>
- <span class="kw">pub</span> <span class="ident">satisfaction</span>: <span class="ident">Satisfaction</span>,
- <span class="doccomment">/// How the wallet's descriptor can satisfy this policy node</span>
- <span class="kw">pub</span> <span class="ident">contribution</span>: <span class="ident">Satisfaction</span>,
-}
-
-<span class="doccomment">/// An extra condition that must be satisfied but that is out of control of the user</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Hash</span>, <span class="ident">Clone</span>, <span class="ident">Copy</span>, <span class="ident">Debug</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>, <span class="ident">PartialOrd</span>, <span class="ident">Ord</span>, <span class="ident">Default</span>, <span class="ident">Serialize</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Condition</span> {
- <span class="attribute">#[<span class="ident">serde</span>(<span class="ident">skip_serializing_if</span> <span class="op">=</span> <span class="string">"Option::is_none"</span>)]</span>
- <span class="kw">pub</span> <span class="ident">csv</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
- <span class="attribute">#[<span class="ident">serde</span>(<span class="ident">skip_serializing_if</span> <span class="op">=</span> <span class="string">"Option::is_none"</span>)]</span>
- <span class="kw">pub</span> <span class="ident">timelock</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
-}
-
-<span class="kw">impl</span> <span class="ident">Condition</span> {
- <span class="kw">fn</span> <span class="ident">merge_timelock</span>(<span class="ident">a</span>: <span class="ident">u32</span>, <span class="ident">b</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">PolicyError</span><span class="op">></span> {
- <span class="kw">const</span> <span class="ident">BLOCKS_TIMELOCK_THRESHOLD</span>: <span class="ident">u32</span> <span class="op">=</span> <span class="number">500000000</span>;
-
- <span class="kw">if</span> (<span class="ident">a</span> <span class="op"><</span> <span class="ident">BLOCKS_TIMELOCK_THRESHOLD</span>) <span class="op">!</span><span class="op">=</span> (<span class="ident">b</span> <span class="op"><</span> <span class="ident">BLOCKS_TIMELOCK_THRESHOLD</span>) {
- <span class="prelude-val">Err</span>(<span class="ident">PolicyError</span>::<span class="ident">MixedTimelockUnits</span>)
- } <span class="kw">else</span> {
- <span class="prelude-val">Ok</span>(<span class="ident">max</span>(<span class="ident">a</span>, <span class="ident">b</span>))
- }
- }
-
- <span class="kw">fn</span> <span class="ident">merge</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">other</span>: <span class="kw-2">&</span><span class="ident">Condition</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">PolicyError</span><span class="op">></span> {
- <span class="kw">match</span> (<span class="self">self</span>.<span class="ident">csv</span>, <span class="ident">other</span>.<span class="ident">csv</span>) {
- (<span class="prelude-val">Some</span>(<span class="ident">a</span>), <span class="prelude-val">Some</span>(<span class="ident">b</span>)) <span class="op">=</span><span class="op">></span> <span class="self">self</span>.<span class="ident">csv</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="self">Self</span>::<span class="ident">merge_timelock</span>(<span class="ident">a</span>, <span class="ident">b</span>)<span class="question-mark">?</span>),
- (<span class="prelude-val">None</span>, <span class="ident">any</span>) <span class="op">=</span><span class="op">></span> <span class="self">self</span>.<span class="ident">csv</span> <span class="op">=</span> <span class="ident">any</span>,
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> {}
- }
-
- <span class="kw">match</span> (<span class="self">self</span>.<span class="ident">timelock</span>, <span class="ident">other</span>.<span class="ident">timelock</span>) {
- (<span class="prelude-val">Some</span>(<span class="ident">a</span>), <span class="prelude-val">Some</span>(<span class="ident">b</span>)) <span class="op">=</span><span class="op">></span> <span class="self">self</span>.<span class="ident">timelock</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="self">Self</span>::<span class="ident">merge_timelock</span>(<span class="ident">a</span>, <span class="ident">b</span>)<span class="question-mark">?</span>),
- (<span class="prelude-val">None</span>, <span class="ident">any</span>) <span class="op">=</span><span class="op">></span> <span class="self">self</span>.<span class="ident">timelock</span> <span class="op">=</span> <span class="ident">any</span>,
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> {}
- }
-
- <span class="prelude-val">Ok</span>(<span class="self">self</span>)
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_null</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="self">self</span>.<span class="ident">csv</span>.<span class="ident">is_none</span>() <span class="kw-2">&</span><span class="op">&</span> <span class="self">self</span>.<span class="ident">timelock</span>.<span class="ident">is_none</span>()
- }
-}
-
-<span class="doccomment">/// Errors that can happen while extracting and manipulating policies</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">PolicyError</span> {
- <span class="ident">NotEnoughItemsSelected</span>(<span class="ident">String</span>),
- <span class="ident">TooManyItemsSelected</span>(<span class="ident">String</span>),
- <span class="ident">IndexOutOfRange</span>(<span class="ident">usize</span>),
- <span class="ident">AddOnLeaf</span>,
- <span class="ident">AddOnPartialComplete</span>,
- <span class="ident">MixedTimelockUnits</span>,
- <span class="ident">IncompatibleConditions</span>,
-}
-
-<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">PolicyError</span> {
- <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
- <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"{:?}"</span>, <span class="self">self</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span> <span class="kw">for</span> <span class="ident">PolicyError</span> {}
-
-<span class="kw">impl</span> <span class="ident">Policy</span> {
- <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">item</span>: <span class="ident">SatisfiableItem</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">Policy</span> {
- <span class="ident">id</span>: <span class="ident">item</span>.<span class="ident">id</span>(),
- <span class="ident">item</span>,
- <span class="ident">satisfaction</span>: <span class="ident">Satisfaction</span>::<span class="prelude-val">None</span>,
- <span class="ident">contribution</span>: <span class="ident">Satisfaction</span>::<span class="prelude-val">None</span>,
- }
- }
-
- <span class="kw">fn</span> <span class="ident">make_and</span>(<span class="ident">a</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">b</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">PolicyError</span><span class="op">></span> {
- <span class="kw">match</span> (<span class="ident">a</span>, <span class="ident">b</span>) {
- (<span class="prelude-val">None</span>, <span class="prelude-val">None</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
- (<span class="prelude-val">Some</span>(<span class="ident">x</span>), <span class="prelude-val">None</span>) <span class="op">|</span> (<span class="prelude-val">None</span>, <span class="prelude-val">Some</span>(<span class="ident">x</span>)) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">x</span>)),
- (<span class="prelude-val">Some</span>(<span class="ident">a</span>), <span class="prelude-val">Some</span>(<span class="ident">b</span>)) <span class="op">=</span><span class="op">></span> <span class="self">Self</span>::<span class="ident">make_thresh</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">a</span>, <span class="ident">b</span>], <span class="number">2</span>),
- }
- }
-
- <span class="kw">fn</span> <span class="ident">make_or</span>(<span class="ident">a</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">b</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">PolicyError</span><span class="op">></span> {
- <span class="kw">match</span> (<span class="ident">a</span>, <span class="ident">b</span>) {
- (<span class="prelude-val">None</span>, <span class="prelude-val">None</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
- (<span class="prelude-val">Some</span>(<span class="ident">x</span>), <span class="prelude-val">None</span>) <span class="op">|</span> (<span class="prelude-val">None</span>, <span class="prelude-val">Some</span>(<span class="ident">x</span>)) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">x</span>)),
- (<span class="prelude-val">Some</span>(<span class="ident">a</span>), <span class="prelude-val">Some</span>(<span class="ident">b</span>)) <span class="op">=</span><span class="op">></span> <span class="self">Self</span>::<span class="ident">make_thresh</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">a</span>, <span class="ident">b</span>], <span class="number">1</span>),
- }
- }
-
- <span class="kw">fn</span> <span class="ident">make_thresh</span>(<span class="ident">items</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">threshold</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">PolicyError</span><span class="op">></span> {
- <span class="kw">if</span> <span class="ident">threshold</span> <span class="op">=</span><span class="op">=</span> <span class="number">0</span> {
- <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>);
- }
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">contribution</span> <span class="op">=</span> <span class="ident">Satisfaction</span>::<span class="ident">Partial</span> {
- <span class="ident">n</span>: <span class="ident">items</span>.<span class="ident">len</span>(),
- <span class="ident">m</span>: <span class="ident">threshold</span>,
- <span class="ident">items</span>: <span class="macro">vec</span><span class="macro">!</span>[],
- <span class="ident">conditions</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
- };
- <span class="kw">for</span> (<span class="ident">index</span>, <span class="ident">item</span>) <span class="kw">in</span> <span class="ident">items</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
- <span class="ident">contribution</span>.<span class="ident">add</span>(<span class="kw-2">&</span><span class="ident">item</span>.<span class="ident">contribution</span>, <span class="ident">index</span>)<span class="question-mark">?</span>;
- }
- <span class="ident">contribution</span>.<span class="ident">finalize</span>()<span class="question-mark">?</span>;
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">policy</span>: <span class="ident">Policy</span> <span class="op">=</span> <span class="ident">SatisfiableItem</span>::<span class="ident">Thresh</span> { <span class="ident">items</span>, <span class="ident">threshold</span> }.<span class="ident">into</span>();
- <span class="ident">policy</span>.<span class="ident">contribution</span> <span class="op">=</span> <span class="ident">contribution</span>;
-
- <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">policy</span>))
- }
-
- <span class="kw">fn</span> <span class="ident">make_multisig</span>(
- <span class="ident">keys</span>: <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span>,
- <span class="ident">signers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span><span class="op">></span>,
- <span class="ident">threshold</span>: <span class="ident">usize</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">PolicyError</span><span class="op">></span> {
- <span class="kw">if</span> <span class="ident">threshold</span> <span class="op">=</span><span class="op">=</span> <span class="number">0</span> {
- <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>);
- }
-
- <span class="kw">let</span> <span class="ident">parsed_keys</span> <span class="op">=</span> <span class="ident">keys</span>.<span class="ident">iter</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">k</span><span class="op">|</span> <span class="ident">PKOrF</span>::<span class="ident">from_key</span>(<span class="ident">k</span>)).<span class="ident">collect</span>();
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">contribution</span> <span class="op">=</span> <span class="ident">Satisfaction</span>::<span class="ident">Partial</span> {
- <span class="ident">n</span>: <span class="ident">keys</span>.<span class="ident">len</span>(),
- <span class="ident">m</span>: <span class="ident">threshold</span>,
- <span class="ident">items</span>: <span class="macro">vec</span><span class="macro">!</span>[],
- <span class="ident">conditions</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
- };
- <span class="kw">for</span> (<span class="ident">index</span>, <span class="ident">key</span>) <span class="kw">in</span> <span class="ident">keys</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="kw">_</span>) <span class="op">=</span> <span class="ident">signers</span>.<span class="ident">find</span>(<span class="ident">signer_id</span>(<span class="ident">key</span>)) {
- <span class="ident">contribution</span>.<span class="ident">add</span>(
- <span class="kw-2">&</span><span class="ident">Satisfaction</span>::<span class="ident">Complete</span> {
- <span class="ident">condition</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
- },
- <span class="ident">index</span>,
- )<span class="question-mark">?</span>;
- }
- }
- <span class="ident">contribution</span>.<span class="ident">finalize</span>()<span class="question-mark">?</span>;
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">policy</span>: <span class="ident">Policy</span> <span class="op">=</span> <span class="ident">SatisfiableItem</span>::<span class="ident">Multisig</span> {
- <span class="ident">keys</span>: <span class="ident">parsed_keys</span>,
- <span class="ident">threshold</span>,
- }
- .<span class="ident">into</span>();
- <span class="ident">policy</span>.<span class="ident">contribution</span> <span class="op">=</span> <span class="ident">contribution</span>;
-
- <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">policy</span>))
- }
-
- <span class="doccomment">/// Return whether or not a specific path in the policy tree is required to unambiguously</span>
- <span class="doccomment">/// create a transaction</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// What this means is that for some spending policies the user should select which paths in</span>
- <span class="doccomment">/// the tree it intends to satisfy while signing, because the transaction must be created differently based</span>
- <span class="doccomment">/// on that.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">requires_path</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="self">self</span>.<span class="ident">get_condition</span>(<span class="kw-2">&</span><span class="ident">BTreeMap</span>::<span class="ident">new</span>()).<span class="ident">is_err</span>()
- }
-
- <span class="doccomment">/// Return the conditions that are set by the spending policy for a given path in the</span>
- <span class="doccomment">/// policy tree</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_condition</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">path</span>: <span class="kw-2">&</span><span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Condition</span>, <span class="ident">PolicyError</span><span class="op">></span> {
- <span class="comment">// if items.len() == threshold, selected can be omitted and we take all of them by default</span>
- <span class="kw">let</span> <span class="ident">default</span> <span class="op">=</span> <span class="kw">match</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">item</span> {
- <span class="ident">SatisfiableItem</span>::<span class="ident">Thresh</span> { <span class="ident">items</span>, <span class="ident">threshold</span> } <span class="kw">if</span> <span class="ident">items</span>.<span class="ident">len</span>() <span class="op">=</span><span class="op">=</span> <span class="kw-2">*</span><span class="ident">threshold</span> <span class="op">=</span><span class="op">></span> {
- (<span class="number">0</span>..<span class="kw-2">*</span><span class="ident">threshold</span>).<span class="ident">into_iter</span>().<span class="ident">collect</span>()
- }
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="macro">vec</span><span class="macro">!</span>[],
- };
- <span class="kw">let</span> <span class="ident">selected</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">path</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">id</span>) {
- <span class="kw">_</span> <span class="kw">if</span> <span class="op">!</span><span class="ident">default</span>.<span class="ident">is_empty</span>() <span class="op">=</span><span class="op">></span> <span class="kw-2">&</span><span class="ident">default</span>,
- <span class="prelude-val">Some</span>(<span class="ident">arr</span>) <span class="op">=</span><span class="op">></span> <span class="ident">arr</span>,
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="kw-2">&</span><span class="ident">default</span>,
- };
-
- <span class="kw">match</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">item</span> {
- <span class="ident">SatisfiableItem</span>::<span class="ident">Thresh</span> { <span class="ident">items</span>, <span class="ident">threshold</span> } <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">mapped_req</span> <span class="op">=</span> <span class="ident">items</span>
- .<span class="ident">iter</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> <span class="ident">i</span>.<span class="ident">get_condition</span>(<span class="ident">path</span>))
- .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()<span class="question-mark">?</span>;
-
- <span class="comment">// if all the requirements are null we don't care about `selected` because there</span>
- <span class="comment">// are no requirements</span>
- <span class="kw">if</span> <span class="ident">mapped_req</span>.<span class="ident">iter</span>().<span class="ident">all</span>(<span class="ident">Condition</span>::<span class="ident">is_null</span>) {
- <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="ident">Condition</span>::<span class="ident">default</span>());
- }
-
- <span class="comment">// if we have something, make sure we have enough items. note that the user can set</span>
- <span class="comment">// an empty value for this step in case of n-of-n, because `selected` is set to all</span>
- <span class="comment">// the elements above</span>
- <span class="kw">if</span> <span class="ident">selected</span>.<span class="ident">len</span>() <span class="op"><</span> <span class="kw-2">*</span><span class="ident">threshold</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">PolicyError</span>::<span class="ident">NotEnoughItemsSelected</span>(<span class="self">self</span>.<span class="ident">id</span>.<span class="ident">clone</span>()));
- } <span class="kw">else</span> <span class="kw">if</span> <span class="ident">selected</span>.<span class="ident">len</span>() <span class="op">></span> <span class="kw-2">*</span><span class="ident">threshold</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">PolicyError</span>::<span class="ident">TooManyItemsSelected</span>(<span class="self">self</span>.<span class="ident">id</span>.<span class="ident">clone</span>()));
- }
-
- <span class="comment">// check the selected items, see if there are conflicting requirements</span>
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">requirements</span> <span class="op">=</span> <span class="ident">Condition</span>::<span class="ident">default</span>();
- <span class="kw">for</span> <span class="ident">item_index</span> <span class="kw">in</span> <span class="ident">selected</span> {
- <span class="ident">requirements</span> <span class="op">=</span> <span class="ident">requirements</span>.<span class="ident">merge</span>(
- <span class="ident">mapped_req</span>
- .<span class="ident">get</span>(<span class="kw-2">*</span><span class="ident">item_index</span>)
- .<span class="ident">ok_or</span>(<span class="ident">PolicyError</span>::<span class="ident">IndexOutOfRange</span>(<span class="kw-2">*</span><span class="ident">item_index</span>))<span class="question-mark">?</span>,
- )<span class="question-mark">?</span>;
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">requirements</span>)
- }
- <span class="kw">_</span> <span class="kw">if</span> <span class="op">!</span><span class="ident">selected</span>.<span class="ident">is_empty</span>() <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="ident">PolicyError</span>::<span class="ident">TooManyItemsSelected</span>(<span class="self">self</span>.<span class="ident">id</span>.<span class="ident">clone</span>())),
- <span class="ident">SatisfiableItem</span>::<span class="ident">AbsoluteTimelock</span> { <span class="ident">value</span> } <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">Condition</span> {
- <span class="ident">csv</span>: <span class="prelude-val">None</span>,
- <span class="ident">timelock</span>: <span class="prelude-val">Some</span>(<span class="kw-2">*</span><span class="ident">value</span>),
- }),
- <span class="ident">SatisfiableItem</span>::<span class="ident">RelativeTimelock</span> { <span class="ident">value</span> } <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">Condition</span> {
- <span class="ident">csv</span>: <span class="prelude-val">Some</span>(<span class="kw-2">*</span><span class="ident">value</span>),
- <span class="ident">timelock</span>: <span class="prelude-val">None</span>,
- }),
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">Condition</span>::<span class="ident">default</span>()),
- }
- }
-}
-
-<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">SatisfiableItem</span><span class="op">></span> <span class="kw">for</span> <span class="ident">Policy</span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">other</span>: <span class="ident">SatisfiableItem</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">Self</span>::<span class="ident">new</span>(<span class="ident">other</span>)
- }
-}
-
-<span class="kw">fn</span> <span class="ident">signer_id</span>(<span class="ident">key</span>: <span class="kw-2">&</span><span class="ident">DescriptorPublicKey</span>) <span class="op">-</span><span class="op">></span> <span class="ident">SignerId</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
- <span class="kw">match</span> <span class="ident">key</span> {
- <span class="ident">DescriptorPublicKey</span>::<span class="ident">PubKey</span>(<span class="ident">pubkey</span>) <span class="op">=</span><span class="op">></span> <span class="ident">pubkey</span>.<span class="ident">to_pubkeyhash</span>().<span class="ident">into</span>(),
- <span class="ident">DescriptorPublicKey</span>::<span class="ident">XPub</span>(<span class="ident">xpub</span>) <span class="op">=</span><span class="op">></span> <span class="ident">xpub</span>.<span class="ident">root_fingerprint</span>().<span class="ident">into</span>(),
- }
-}
-
-<span class="kw">fn</span> <span class="ident">signature</span>(
- <span class="ident">key</span>: <span class="kw-2">&</span><span class="ident">DescriptorPublicKey</span>,
- <span class="ident">signers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span><span class="op">></span>,
-) <span class="op">-</span><span class="op">></span> <span class="ident">Policy</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">policy</span>: <span class="ident">Policy</span> <span class="op">=</span> <span class="ident">SatisfiableItem</span>::<span class="ident">Signature</span>(<span class="ident">PKOrF</span>::<span class="ident">from_key</span>(<span class="ident">key</span>)).<span class="ident">into</span>();
-
- <span class="ident">policy</span>.<span class="ident">contribution</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">signers</span>.<span class="ident">find</span>(<span class="ident">signer_id</span>(<span class="ident">key</span>)).<span class="ident">is_some</span>() {
- <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> {
- <span class="ident">condition</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
- }
- } <span class="kw">else</span> {
- <span class="ident">Satisfaction</span>::<span class="prelude-val">None</span>
- };
-
- <span class="ident">policy</span>
-}
-
-<span class="kw">fn</span> <span class="ident">signature_key</span>(
- <span class="ident">key_hash</span>: <span class="kw-2">&</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span> <span class="kw">as</span> <span class="ident">MiniscriptKey</span><span class="op">></span>::<span class="ident">Hash</span>,
- <span class="ident">signers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span><span class="op">></span>,
-) <span class="op">-</span><span class="op">></span> <span class="ident">Policy</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">policy</span>: <span class="ident">Policy</span> <span class="op">=</span> <span class="ident">SatisfiableItem</span>::<span class="ident">Signature</span>(<span class="ident">PKOrF</span>::<span class="ident">from_key_hash</span>(<span class="kw-2">*</span><span class="ident">key_hash</span>)).<span class="ident">into</span>();
-
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="kw">_</span>) <span class="op">=</span> <span class="ident">signers</span>.<span class="ident">find</span>(<span class="ident">SignerId</span>::<span class="ident">PkHash</span>(<span class="kw-2">*</span><span class="ident">key_hash</span>)) {
- <span class="ident">policy</span>.<span class="ident">contribution</span> <span class="op">=</span> <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> {
- <span class="ident">condition</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
- }
- }
-
- <span class="ident">policy</span>
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span> <span class="ident">ExtractPolicy</span> <span class="kw">for</span> <span class="ident">Miniscript</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span>, <span class="ident">Ctx</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">extract_policy</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">signers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="kw">match</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">node</span> {
- <span class="comment">// Leaves</span>
- <span class="ident">Terminal</span>::<span class="ident">True</span> <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">False</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
- <span class="ident">Terminal</span>::<span class="ident">PkK</span>(<span class="ident">pubkey</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">signature</span>(<span class="ident">pubkey</span>, <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))),
- <span class="ident">Terminal</span>::<span class="ident">PkH</span>(<span class="ident">pubkey_hash</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">signature_key</span>(<span class="ident">pubkey_hash</span>, <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))),
- <span class="ident">Terminal</span>::<span class="ident">After</span>(<span class="ident">value</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">policy</span>: <span class="ident">Policy</span> <span class="op">=</span> <span class="ident">SatisfiableItem</span>::<span class="ident">AbsoluteTimelock</span> { <span class="ident">value</span>: <span class="kw-2">*</span><span class="ident">value</span> }.<span class="ident">into</span>();
- <span class="ident">policy</span>.<span class="ident">contribution</span> <span class="op">=</span> <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> {
- <span class="ident">condition</span>: <span class="ident">Condition</span> {
- <span class="ident">timelock</span>: <span class="prelude-val">Some</span>(<span class="kw-2">*</span><span class="ident">value</span>),
- <span class="ident">csv</span>: <span class="prelude-val">None</span>,
- },
- };
-
- <span class="prelude-val">Some</span>(<span class="ident">policy</span>)
- }
- <span class="ident">Terminal</span>::<span class="ident">Older</span>(<span class="ident">value</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">policy</span>: <span class="ident">Policy</span> <span class="op">=</span> <span class="ident">SatisfiableItem</span>::<span class="ident">RelativeTimelock</span> { <span class="ident">value</span>: <span class="kw-2">*</span><span class="ident">value</span> }.<span class="ident">into</span>();
- <span class="ident">policy</span>.<span class="ident">contribution</span> <span class="op">=</span> <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> {
- <span class="ident">condition</span>: <span class="ident">Condition</span> {
- <span class="ident">timelock</span>: <span class="prelude-val">None</span>,
- <span class="ident">csv</span>: <span class="prelude-val">Some</span>(<span class="kw-2">*</span><span class="ident">value</span>),
- },
- };
-
- <span class="prelude-val">Some</span>(<span class="ident">policy</span>)
- }
- <span class="ident">Terminal</span>::<span class="ident">Sha256</span>(<span class="ident">hash</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">SatisfiableItem</span>::<span class="ident">SHA256Preimage</span> { <span class="ident">hash</span>: <span class="kw-2">*</span><span class="ident">hash</span> }.<span class="ident">into</span>()),
- <span class="ident">Terminal</span>::<span class="ident">Hash256</span>(<span class="ident">hash</span>) <span class="op">=</span><span class="op">></span> {
- <span class="prelude-val">Some</span>(<span class="ident">SatisfiableItem</span>::<span class="ident">HASH256Preimage</span> { <span class="ident">hash</span>: <span class="kw-2">*</span><span class="ident">hash</span> }.<span class="ident">into</span>())
- }
- <span class="ident">Terminal</span>::<span class="ident">Ripemd160</span>(<span class="ident">hash</span>) <span class="op">=</span><span class="op">></span> {
- <span class="prelude-val">Some</span>(<span class="ident">SatisfiableItem</span>::<span class="ident">RIPEMD160Preimage</span> { <span class="ident">hash</span>: <span class="kw-2">*</span><span class="ident">hash</span> }.<span class="ident">into</span>())
- }
- <span class="ident">Terminal</span>::<span class="ident">Hash160</span>(<span class="ident">hash</span>) <span class="op">=</span><span class="op">></span> {
- <span class="prelude-val">Some</span>(<span class="ident">SatisfiableItem</span>::<span class="ident">HASH160Preimage</span> { <span class="ident">hash</span>: <span class="kw-2">*</span><span class="ident">hash</span> }.<span class="ident">into</span>())
- }
- <span class="ident">Terminal</span>::<span class="ident">Multi</span>(<span class="ident">k</span>, <span class="ident">pks</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Policy</span>::<span class="ident">make_multisig</span>(<span class="ident">pks</span>, <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>), <span class="kw-2">*</span><span class="ident">k</span>)<span class="question-mark">?</span>,
- <span class="comment">// Identities</span>
- <span class="ident">Terminal</span>::<span class="ident">Alt</span>(<span class="ident">inner</span>)
- <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">Swap</span>(<span class="ident">inner</span>)
- <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">Check</span>(<span class="ident">inner</span>)
- <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">DupIf</span>(<span class="ident">inner</span>)
- <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">Verify</span>(<span class="ident">inner</span>)
- <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">NonZero</span>(<span class="ident">inner</span>)
- <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">ZeroNotEqual</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="ident">inner</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))<span class="question-mark">?</span>,
- <span class="comment">// Complex policies</span>
- <span class="ident">Terminal</span>::<span class="ident">AndV</span>(<span class="ident">a</span>, <span class="ident">b</span>) <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">AndB</span>(<span class="ident">a</span>, <span class="ident">b</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Policy</span>::<span class="ident">make_and</span>(
- <span class="ident">a</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))<span class="question-mark">?</span>,
- <span class="ident">b</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))<span class="question-mark">?</span>,
- )<span class="question-mark">?</span>,
- <span class="ident">Terminal</span>::<span class="ident">AndOr</span>(<span class="ident">x</span>, <span class="ident">y</span>, <span class="ident">z</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Policy</span>::<span class="ident">make_or</span>(
- <span class="ident">Policy</span>::<span class="ident">make_and</span>(
- <span class="ident">x</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))<span class="question-mark">?</span>,
- <span class="ident">y</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))<span class="question-mark">?</span>,
- )<span class="question-mark">?</span>,
- <span class="ident">z</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))<span class="question-mark">?</span>,
- )<span class="question-mark">?</span>,
- <span class="ident">Terminal</span>::<span class="ident">OrB</span>(<span class="ident">a</span>, <span class="ident">b</span>)
- <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">OrD</span>(<span class="ident">a</span>, <span class="ident">b</span>)
- <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">OrC</span>(<span class="ident">a</span>, <span class="ident">b</span>)
- <span class="op">|</span> <span class="ident">Terminal</span>::<span class="ident">OrI</span>(<span class="ident">a</span>, <span class="ident">b</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Policy</span>::<span class="ident">make_or</span>(
- <span class="ident">a</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))<span class="question-mark">?</span>,
- <span class="ident">b</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>))<span class="question-mark">?</span>,
- )<span class="question-mark">?</span>,
- <span class="ident">Terminal</span>::<span class="ident">Thresh</span>(<span class="ident">k</span>, <span class="ident">nodes</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">threshold</span> <span class="op">=</span> <span class="kw-2">*</span><span class="ident">k</span>;
- <span class="kw">let</span> <span class="ident">mapped</span>: <span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">nodes</span>
- .<span class="ident">iter</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">n</span><span class="op">|</span> <span class="ident">n</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">signers</span>)))
- .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()<span class="question-mark">?</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">filter_map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span>)
- .<span class="ident">collect</span>();
-
- <span class="kw">if</span> <span class="ident">mapped</span>.<span class="ident">len</span>() <span class="op"><</span> <span class="ident">nodes</span>.<span class="ident">len</span>() {
- <span class="ident">threshold</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">threshold</span>.<span class="ident">checked_sub</span>(<span class="ident">nodes</span>.<span class="ident">len</span>() <span class="op">-</span> <span class="ident">mapped</span>.<span class="ident">len</span>()) {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
- <span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="op">=</span><span class="op">></span> <span class="ident">x</span>,
- };
- }
-
- <span class="ident">Policy</span>::<span class="ident">make_thresh</span>(<span class="ident">mapped</span>, <span class="ident">threshold</span>)<span class="question-mark">?</span>
- }
- })
- }
-}
-
-<span class="kw">impl</span> <span class="ident">ExtractPolicy</span> <span class="kw">for</span> <span class="ident">Descriptor</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">extract_policy</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">signers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">match</span> <span class="self">self</span> {
- <span class="ident">Descriptor</span>::<span class="ident">Pk</span>(<span class="ident">pubkey</span>)
- <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Pkh</span>(<span class="ident">pubkey</span>)
- <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Wpkh</span>(<span class="ident">pubkey</span>)
- <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWpkh</span>(<span class="ident">pubkey</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">signature</span>(<span class="ident">pubkey</span>, <span class="ident">signers</span>))),
- <span class="ident">Descriptor</span>::<span class="ident">Bare</span>(<span class="ident">inner</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Sh</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">inner</span>.<span class="ident">extract_policy</span>(<span class="ident">signers</span>)<span class="question-mark">?</span>),
- <span class="ident">Descriptor</span>::<span class="ident">Wsh</span>(<span class="ident">inner</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWsh</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">inner</span>.<span class="ident">extract_policy</span>(<span class="ident">signers</span>)<span class="question-mark">?</span>),
- }
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/error.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>error.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Address</span>, <span class="ident">OutPoint</span>};
-
-<span class="doccomment">/// Errors that can be thrown by the [`Wallet`](crate::wallet::Wallet)</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">Error</span> {
- <span class="ident">KeyMismatch</span>(<span class="ident">bitcoin</span>::<span class="ident">secp256k1</span>::<span class="ident">PublicKey</span>, <span class="ident">bitcoin</span>::<span class="ident">secp256k1</span>::<span class="ident">PublicKey</span>),
- <span class="ident">MissingInputUTXO</span>(<span class="ident">usize</span>),
- <span class="ident">InvalidU32Bytes</span>(<span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>),
- <span class="ident">Generic</span>(<span class="ident">String</span>),
- <span class="ident">ScriptDoesntHaveAddressForm</span>,
- <span class="ident">SendAllMultipleOutputs</span>,
- <span class="ident">NoAddressees</span>,
- <span class="ident">OutputBelowDustLimit</span>(<span class="ident">usize</span>),
- <span class="ident">InsufficientFunds</span>,
- <span class="ident">InvalidAddressNetwork</span>(<span class="ident">Address</span>),
- <span class="ident">UnknownUTXO</span>,
- <span class="ident">DifferentTransactions</span>,
- <span class="ident">TransactionNotFound</span>,
- <span class="ident">TransactionConfirmed</span>,
- <span class="ident">IrreplaceableTransaction</span>,
- <span class="ident">FeeRateTooLow</span> {
- <span class="ident">required</span>: <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">FeeRate</span>,
- },
-
- <span class="ident">ChecksumMismatch</span>,
- <span class="ident">DifferentDescriptorStructure</span>,
-
- <span class="ident">SpendingPolicyRequired</span>,
- <span class="ident">InvalidPolicyPathError</span>(<span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">policy</span>::<span class="ident">PolicyError</span>),
-
- <span class="ident">Signer</span>(<span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">signer</span>::<span class="ident">SignerError</span>),
-
- <span class="comment">// Blockchain interface errors</span>
- <span class="ident">Uncapable</span>(<span class="kw">crate</span>::<span class="ident">blockchain</span>::<span class="ident">Capability</span>),
- <span class="ident">OfflineClient</span>,
- <span class="ident">InvalidProgressValue</span>(<span class="ident">f32</span>),
- <span class="ident">ProgressUpdateError</span>,
- <span class="ident">MissingCachedAddresses</span>,
- <span class="ident">InvalidOutpoint</span>(<span class="ident">OutPoint</span>),
-
- <span class="ident">Descriptor</span>(<span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">error</span>::<span class="ident">Error</span>),
- <span class="ident">AddressValidator</span>(<span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">address_validator</span>::<span class="ident">AddressValidatorError</span>),
-
- <span class="ident">Encode</span>(<span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span>),
- <span class="ident">Miniscript</span>(<span class="ident">miniscript</span>::<span class="ident">Error</span>),
- <span class="ident">BIP32</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">Error</span>),
- <span class="ident">Secp256k1</span>(<span class="ident">bitcoin</span>::<span class="ident">secp256k1</span>::<span class="ident">Error</span>),
- <span class="ident">JSON</span>(<span class="ident">serde_json</span>::<span class="ident">Error</span>),
- <span class="ident">Hex</span>(<span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">Error</span>),
- <span class="ident">PSBT</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">psbt</span>::<span class="ident">Error</span>),
-
- <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"electrum"</span>)]</span>
- <span class="ident">Electrum</span>(<span class="ident">electrum_client</span>::<span class="ident">Error</span>),
- <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"esplora"</span>)]</span>
- <span class="ident">Esplora</span>(<span class="kw">crate</span>::<span class="ident">blockchain</span>::<span class="ident">esplora</span>::<span class="ident">EsploraError</span>),
- <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"compact_filters"</span>)]</span>
- <span class="ident">CompactFilters</span>(<span class="kw">crate</span>::<span class="ident">blockchain</span>::<span class="ident">compact_filters</span>::<span class="ident">CompactFiltersError</span>),
- <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"key-value-db"</span>)]</span>
- <span class="ident">Sled</span>(<span class="ident">sled</span>::<span class="ident">Error</span>),
-}
-
-<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">Error</span> {
- <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
- <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"{:?}"</span>, <span class="self">self</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span> <span class="kw">for</span> <span class="ident">Error</span> {}
-
-<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_error</span> {
- ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">from</span>:<span class="ident">ty</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">to</span>:<span class="ident">ident</span> ) <span class="op">=</span><span class="op">></span> {
- <span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">convert</span>::<span class="ident">From</span><span class="op"><</span><span class="macro-nonterminal">$</span><span class="macro-nonterminal">from</span><span class="op">></span> <span class="kw">for</span> <span class="ident">Error</span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">err</span>: <span class="macro-nonterminal">$</span><span class="macro-nonterminal">from</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">Error</span>::<span class="macro-nonterminal">$</span><span class="macro-nonterminal">to</span>(<span class="ident">err</span>)
- }
- }
- };
-}
-
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">error</span>::<span class="ident">Error</span>, <span class="ident">Descriptor</span>);
-<span class="macro">impl_error</span><span class="macro">!</span>(
- <span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">address_validator</span>::<span class="ident">AddressValidatorError</span>,
- <span class="ident">AddressValidator</span>
-);
-<span class="macro">impl_error</span><span class="macro">!</span>(
- <span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">policy</span>::<span class="ident">PolicyError</span>,
- <span class="ident">InvalidPolicyPathError</span>
-);
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">signer</span>::<span class="ident">SignerError</span>, <span class="ident">Signer</span>);
-
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span>, <span class="ident">Encode</span>);
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">miniscript</span>::<span class="ident">Error</span>, <span class="ident">Miniscript</span>);
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">Error</span>, <span class="ident">BIP32</span>);
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">secp256k1</span>::<span class="ident">Error</span>, <span class="ident">Secp256k1</span>);
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">serde_json</span>::<span class="ident">Error</span>, <span class="ident">JSON</span>);
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">Error</span>, <span class="ident">Hex</span>);
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">psbt</span>::<span class="ident">Error</span>, <span class="ident">PSBT</span>);
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"electrum"</span>)]</span>
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">electrum_client</span>::<span class="ident">Error</span>, <span class="ident">Electrum</span>);
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"esplora"</span>)]</span>
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="kw">crate</span>::<span class="ident">blockchain</span>::<span class="ident">esplora</span>::<span class="ident">EsploraError</span>, <span class="ident">Esplora</span>);
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"key-value-db"</span>)]</span>
-<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">sled</span>::<span class="ident">Error</span>, <span class="ident">Sled</span>);
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"compact_filters"</span>)]</span>
-<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="kw">crate</span>::<span class="ident">blockchain</span>::<span class="ident">compact_filters</span>::<span class="ident">CompactFiltersError</span><span class="op">></span> <span class="kw">for</span> <span class="ident">Error</span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">other</span>: <span class="kw">crate</span>::<span class="ident">blockchain</span>::<span class="ident">compact_filters</span>::<span class="ident">CompactFiltersError</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="kw">match</span> <span class="ident">other</span> {
- <span class="kw">crate</span>::<span class="ident">blockchain</span>::<span class="ident">compact_filters</span>::<span class="ident">CompactFiltersError</span>::<span class="ident">Global</span>(<span class="ident">e</span>) <span class="op">=</span><span class="op">></span> <span class="kw-2">*</span><span class="ident">e</span>,
- <span class="ident">err</span> @ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="ident">Error</span>::<span class="ident">CompactFilters</span>(<span class="ident">err</span>),
- }
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/lib.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>lib.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10">10</span>
-<span id="11">11</span>
-<span id="12">12</span>
-<span id="13">13</span>
-<span id="14">14</span>
-<span id="15">15</span>
-<span id="16">16</span>
-<span id="17">17</span>
-<span id="18">18</span>
-<span id="19">19</span>
-<span id="20">20</span>
-<span id="21">21</span>
-<span id="22">22</span>
-<span id="23">23</span>
-<span id="24">24</span>
-<span id="25">25</span>
-<span id="26">26</span>
-<span id="27">27</span>
-<span id="28">28</span>
-<span id="29">29</span>
-<span id="30">30</span>
-<span id="31">31</span>
-<span id="32">32</span>
-<span id="33">33</span>
-<span id="34">34</span>
-<span id="35">35</span>
-<span id="36">36</span>
-<span id="37">37</span>
-<span id="38">38</span>
-<span id="39">39</span>
-<span id="40">40</span>
-<span id="41">41</span>
-<span id="42">42</span>
-<span id="43">43</span>
-<span id="44">44</span>
-<span id="45">45</span>
-<span id="46">46</span>
-<span id="47">47</span>
-<span id="48">48</span>
-<span id="49">49</span>
-<span id="50">50</span>
-<span id="51">51</span>
-<span id="52">52</span>
-<span id="53">53</span>
-<span id="54">54</span>
-<span id="55">55</span>
-<span id="56">56</span>
-<span id="57">57</span>
-<span id="58">58</span>
-<span id="59">59</span>
-<span id="60">60</span>
-<span id="61">61</span>
-<span id="62">62</span>
-<span id="63">63</span>
-<span id="64">64</span>
-<span id="65">65</span>
-<span id="66">66</span>
-<span id="67">67</span>
-<span id="68">68</span>
-<span id="69">69</span>
-<span id="70">70</span>
-<span id="71">71</span>
-<span id="72">72</span>
-<span id="73">73</span>
-<span id="74">74</span>
-<span id="75">75</span>
-<span id="76">76</span>
-<span id="77">77</span>
-<span id="78">78</span>
-<span id="79">79</span>
-<span id="80">80</span>
-<span id="81">81</span>
-<span id="82">82</span>
-<span id="83">83</span>
-<span id="84">84</span>
-<span id="85">85</span>
-<span id="86">86</span>
-<span id="87">87</span>
-<span id="88">88</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="comment">// only enables the `doc_cfg` feature when</span>
-<span class="comment">// the `docsrs` configuration attribute is defined</span>
-<span class="attribute">#![<span class="ident">cfg_attr</span>(<span class="ident">docsrs</span>, <span class="ident">feature</span>(<span class="ident">doc_cfg</span>))]</span>
-<span class="comment">// only enables the nightly `external_doc` feature when</span>
-<span class="comment">// `test-md-docs` is enabled</span>
-<span class="attribute">#![<span class="ident">cfg_attr</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"test-md-docs"</span>, <span class="ident">feature</span>(<span class="ident">external_doc</span>))]</span>
-
-<span class="kw">pub</span> <span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">bitcoin</span>;
-<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">log</span>;
-<span class="kw">pub</span> <span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">miniscript</span>;
-<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">serde</span>;
-<span class="attribute">#[<span class="ident">macro_use</span>]</span>
-<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">serde_json</span>;
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">any</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>, <span class="ident">feature</span> <span class="op">=</span> <span class="string">"async-interface"</span>))]</span>
-<span class="attribute">#[<span class="ident">macro_use</span>]</span>
-<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">async_trait</span>;
-<span class="attribute">#[<span class="ident">macro_use</span>]</span>
-<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">magical_macros</span>;
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">any</span>(<span class="ident">test</span>, <span class="ident">feature</span> <span class="op">=</span> <span class="string">"compact_filters"</span>))]</span>
-<span class="attribute">#[<span class="ident">macro_use</span>]</span>
-<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">lazy_static</span>;
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"electrum"</span>)]</span>
-<span class="kw">pub</span> <span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">electrum_client</span>;
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"esplora"</span>)]</span>
-<span class="kw">pub</span> <span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">reqwest</span>;
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"key-value-db"</span>)]</span>
-<span class="kw">pub</span> <span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">sled</span>;
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"cli-utils"</span>)]</span>
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">cli</span>;
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="attribute">#[<span class="ident">macro_use</span>]</span>
-<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">testutils</span>;
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="attribute">#[<span class="ident">macro_use</span>]</span>
-<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">testutils_macros</span>;
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="attribute">#[<span class="ident">macro_use</span>]</span>
-<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">serial_test</span>;
-
-<span class="attribute">#[<span class="ident">macro_use</span>]</span>
-<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">mod</span> <span class="ident">error</span>;
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">blockchain</span>;
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">database</span>;
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">descriptor</span>;
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"test-md-docs"</span>)]</span>
-<span class="kw">mod</span> <span class="ident">doctest</span>;
-<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">mod</span> <span class="ident">psbt</span>;
-<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">mod</span> <span class="ident">types</span>;
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">wallet</span>;
-
-<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">descriptor</span>::<span class="ident">HDKeyPaths</span>;
-<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">error</span>::<span class="ident">Error</span>;
-<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">types</span>::<span class="kw-2">*</span>;
-<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">wallet</span>::<span class="ident">address_validator</span>;
-<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">wallet</span>::<span class="ident">signer</span>;
-<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">wallet</span>::<span class="ident">tx_builder</span>::<span class="ident">TxBuilder</span>;
-<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">wallet</span>::{<span class="ident">OfflineWallet</span>, <span class="ident">Wallet</span>};
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/psbt/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10">10</span>
-<span id="11">11</span>
-<span id="12">12</span>
-<span id="13">13</span>
-<span id="14">14</span>
-<span id="15">15</span>
-<span id="16">16</span>
-<span id="17">17</span>
-<span id="18">18</span>
-<span id="19">19</span>
-<span id="20">20</span>
-<span id="21">21</span>
-<span id="22">22</span>
-<span id="23">23</span>
-<span id="24">24</span>
-<span id="25">25</span>
-<span id="26">26</span>
-<span id="27">27</span>
-<span id="28">28</span>
-<span id="29">29</span>
-<span id="30">30</span>
-<span id="31">31</span>
-<span id="32">32</span>
-<span id="33">33</span>
-<span id="34">34</span>
-<span id="35">35</span>
-<span id="36">36</span>
-<span id="37">37</span>
-<span id="38">38</span>
-<span id="39">39</span>
-<span id="40">40</span>
-<span id="41">41</span>
-<span id="42">42</span>
-<span id="43">43</span>
-<span id="44">44</span>
-<span id="45">45</span>
-<span id="46">46</span>
-<span id="47">47</span>
-<span id="48">48</span>
-<span id="49">49</span>
-<span id="50">50</span>
-<span id="51">51</span>
-<span id="52">52</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span> <span class="kw">as</span> <span class="ident">PSBT</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">TxOut</span>;
-
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">PSBTUtils</span> {
- <span class="kw">fn</span> <span class="ident">get_utxo_for</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">input_index</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TxOut</span><span class="op">></span>;
-}
-
-<span class="kw">impl</span> <span class="ident">PSBTUtils</span> <span class="kw">for</span> <span class="ident">PSBT</span> {
- <span class="kw">fn</span> <span class="ident">get_utxo_for</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">input_index</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TxOut</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>;
-
- <span class="kw">if</span> <span class="ident">input_index</span> <span class="op">></span><span class="op">=</span> <span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">len</span>() {
- <span class="kw">return</span> <span class="prelude-val">None</span>;
- }
-
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">input</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">inputs</span>.<span class="ident">get</span>(<span class="ident">input_index</span>) {
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">wit_utxo</span>) <span class="op">=</span> <span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">witness_utxo</span> {
- <span class="prelude-val">Some</span>(<span class="ident">wit_utxo</span>.<span class="ident">clone</span>())
- } <span class="kw">else</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">in_tx</span>) <span class="op">=</span> <span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">non_witness_utxo</span> {
- <span class="prelude-val">Some</span>(<span class="ident">in_tx</span>.<span class="ident">output</span>[<span class="ident">tx</span>.<span class="ident">input</span>[<span class="ident">input_index</span>].<span class="ident">previous_output</span>.<span class="ident">vout</span> <span class="kw">as</span> <span class="ident">usize</span>].<span class="ident">clone</span>())
- } <span class="kw">else</span> {
- <span class="prelude-val">None</span>
- }
- } <span class="kw">else</span> {
- <span class="prelude-val">None</span>
- }
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/types.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>types.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../magical/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">convert</span>::<span class="ident">AsRef</span>;
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">blockdata</span>::<span class="ident">transaction</span>::{<span class="ident">OutPoint</span>, <span class="ident">Transaction</span>, <span class="ident">TxOut</span>};
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hash_types</span>::<span class="ident">Txid</span>;
-
-<span class="kw">use</span> <span class="ident">serde</span>::{<span class="ident">Deserialize</span>, <span class="ident">Serialize</span>};
-
-<span class="doccomment">/// Types of script</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Serialize</span>, <span class="ident">Deserialize</span>, <span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">Copy</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>, <span class="ident">Hash</span>)]</span>
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">ScriptType</span> {
- <span class="ident">External</span> <span class="op">=</span> <span class="number">0</span>,
- <span class="ident">Internal</span> <span class="op">=</span> <span class="number">1</span>,
-}
-
-<span class="kw">impl</span> <span class="ident">ScriptType</span> {
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">as_byte</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">u8</span> {
- <span class="kw">match</span> <span class="self">self</span> {
- <span class="ident">ScriptType</span>::<span class="ident">External</span> <span class="op">=</span><span class="op">></span> <span class="string">'e'</span> <span class="kw">as</span> <span class="ident">u8</span>,
- <span class="ident">ScriptType</span>::<span class="ident">Internal</span> <span class="op">=</span><span class="op">></span> <span class="string">'i'</span> <span class="kw">as</span> <span class="ident">u8</span>,
- }
- }
-
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_internal</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="self">self</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">ScriptType</span>::<span class="ident">Internal</span>
- }
-}
-
-<span class="kw">impl</span> <span class="ident">AsRef</span><span class="op"><</span>[<span class="ident">u8</span>]<span class="op">></span> <span class="kw">for</span> <span class="ident">ScriptType</span> {
- <span class="kw">fn</span> <span class="ident">as_ref</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="kw-2">&</span>[<span class="ident">u8</span>] {
- <span class="kw">match</span> <span class="self">self</span> {
- <span class="ident">ScriptType</span>::<span class="ident">External</span> <span class="op">=</span><span class="op">></span> <span class="string">b"e"</span>,
- <span class="ident">ScriptType</span>::<span class="ident">Internal</span> <span class="op">=</span><span class="op">></span> <span class="string">b"i"</span>,
- }
- }
-}
-
-<span class="doccomment">/// Fee rate</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Copy</span>, <span class="ident">Clone</span>, <span class="ident">PartialEq</span>, <span class="ident">PartialOrd</span>)]</span>
-<span class="comment">// Internally stored as satoshi/vbyte</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">FeeRate</span>(<span class="ident">f32</span>);
-
-<span class="kw">impl</span> <span class="ident">FeeRate</span> {
- <span class="doccomment">/// Create a new instance of [`FeeRate`] given a float fee rate in btc/kvbytes</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">from_btc_per_kvb</span>(<span class="ident">btc_per_kvb</span>: <span class="ident">f32</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">FeeRate</span>(<span class="ident">btc_per_kvb</span> <span class="op">*</span> <span class="number">1e5</span>)
- }
-
- <span class="doccomment">/// Create a new instance of [`FeeRate`] given a float fee rate in satoshi/vbyte</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">from_sat_per_vb</span>(<span class="ident">sat_per_vb</span>: <span class="ident">f32</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">FeeRate</span>(<span class="ident">sat_per_vb</span>)
- }
-
- <span class="doccomment">/// Create a new [`FeeRate`] with the default min relay fee value</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">default_min_relay_fee</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">FeeRate</span>(<span class="number">1.0</span>)
- }
-
- <span class="doccomment">/// Return the value as satoshi/vbyte</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">as_sat_vb</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">f32</span> {
- <span class="self">self</span>.<span class="number">0</span>
- }
-}
-
-<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">default</span>::<span class="ident">Default</span> <span class="kw">for</span> <span class="ident">FeeRate</span> {
- <span class="kw">fn</span> <span class="ident">default</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">FeeRate</span>::<span class="ident">default_min_relay_fee</span>()
- }
-}
-
-<span class="doccomment">/// A wallet unspent output</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Serialize</span>, <span class="ident">Deserialize</span>, <span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">UTXO</span> {
- <span class="kw">pub</span> <span class="ident">outpoint</span>: <span class="ident">OutPoint</span>,
- <span class="kw">pub</span> <span class="ident">txout</span>: <span class="ident">TxOut</span>,
- <span class="kw">pub</span> <span class="ident">is_internal</span>: <span class="ident">bool</span>,
-}
-
-<span class="doccomment">/// A wallet transaction</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Serialize</span>, <span class="ident">Deserialize</span>, <span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>, <span class="ident">Default</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">TransactionDetails</span> {
- <span class="kw">pub</span> <span class="ident">transaction</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span>,
- <span class="kw">pub</span> <span class="ident">txid</span>: <span class="ident">Txid</span>,
- <span class="kw">pub</span> <span class="ident">timestamp</span>: <span class="ident">u64</span>,
- <span class="kw">pub</span> <span class="ident">received</span>: <span class="ident">u64</span>,
- <span class="kw">pub</span> <span class="ident">sent</span>: <span class="ident">u64</span>,
- <span class="kw">pub</span> <span class="ident">fees</span>: <span class="ident">u64</span>,
- <span class="kw">pub</span> <span class="ident">height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "magical";</script><script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script><script defer src="../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/wallet/address_validator.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>address_validator.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="doccomment">//! Address validation callbacks</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! The typical usage of those callbacks is for displaying the newly-generated address on a</span>
-<span class="doccomment">//! hardware wallet, so that the user can cross-check its correctness.</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! More generally speaking though, these callbacks can also be used to "do something" every time</span>
-<span class="doccomment">//! an address is generated, without necessarily checking or validating it.</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! An address validator can be attached to a [`Wallet`](super::Wallet) by using the</span>
-<span class="doccomment">//! [`Wallet::add_address_validator`](super::Wallet::add_address_validator) method, and</span>
-<span class="doccomment">//! whenever a new address is generated (either explicitly by the user with</span>
-<span class="doccomment">//! [`Wallet::get_new_address`](super::Wallet::get_new_address) or internally to create a change</span>
-<span class="doccomment">//! address) all the attached validators will be polled, in sequence. All of them must complete</span>
-<span class="doccomment">//! successfully to continue.</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ## Example</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ```</span>
-<span class="doccomment">//! # use std::sync::Arc;</span>
-<span class="doccomment">//! # use bitcoin::*;</span>
-<span class="doccomment">//! # use magical::address_validator::*;</span>
-<span class="doccomment">//! # use magical::database::*;</span>
-<span class="doccomment">//! # use magical::*;</span>
-<span class="doccomment">//! struct PrintAddressAndContinue;</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! impl AddressValidator for PrintAddressAndContinue {</span>
-<span class="doccomment">//! fn validate(</span>
-<span class="doccomment">//! &self,</span>
-<span class="doccomment">//! script_type: ScriptType,</span>
-<span class="doccomment">//! hd_keypaths: &HDKeyPaths,</span>
-<span class="doccomment">//! script: &Script</span>
-<span class="doccomment">//! ) -> Result<(), AddressValidatorError> {</span>
-<span class="doccomment">//! let address = Address::from_script(script, Network::Testnet)</span>
-<span class="doccomment">//! .as_ref()</span>
-<span class="doccomment">//! .map(Address::to_string)</span>
-<span class="doccomment">//! .unwrap_or(script.to_string());</span>
-<span class="doccomment">//! println!("New address of type {:?}: {}", script_type, address);</span>
-<span class="doccomment">//! println!("HD keypaths: {:#?}", hd_keypaths);</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! Ok(())</span>
-<span class="doccomment">//! }</span>
-<span class="doccomment">//! }</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! let descriptor = "wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)";</span>
-<span class="doccomment">//! let mut wallet: OfflineWallet<_> = Wallet::new_offline(descriptor, None, Network::Testnet, MemoryDatabase::default())?;</span>
-<span class="doccomment">//! wallet.add_address_validator(Arc::new(Box::new(PrintAddressAndContinue)));</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! let address = wallet.get_new_address()?;</span>
-<span class="doccomment">//! println!("Address: {}", address);</span>
-<span class="doccomment">//! # Ok::<(), magical::Error>(())</span>
-<span class="doccomment">//! ```</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">Script</span>;
-
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">HDKeyPaths</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">ScriptType</span>;
-
-<span class="doccomment">/// Errors that can be returned to fail the validation of an address</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>)]</span>
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">AddressValidatorError</span> {
- <span class="ident">UserRejected</span>,
- <span class="ident">ConnectionError</span>,
- <span class="ident">TimeoutError</span>,
- <span class="ident">InvalidScript</span>,
- <span class="ident">Message</span>(<span class="ident">String</span>),
-}
-
-<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">AddressValidatorError</span> {
- <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
- <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"{:?}"</span>, <span class="self">self</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span> <span class="kw">for</span> <span class="ident">AddressValidatorError</span> {}
-
-<span class="doccomment">/// Trait to build address validators</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// All the address validators attached to a wallet with [`Wallet::add_address_validator`](super::Wallet::add_address_validator) will be polled</span>
-<span class="doccomment">/// every time an address (external or internal) is generated by the wallet. Errors returned in the</span>
-<span class="doccomment">/// validator will be propagated up to the original caller that triggered the address generation.</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// For a usage example see [this module](crate::address_validator)'s documentation.</span>
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">AddressValidator</span> {
- <span class="doccomment">/// Validate or inspect an address</span>
- <span class="kw">fn</span> <span class="ident">validate</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
- <span class="ident">hd_keypaths</span>: <span class="kw-2">&</span><span class="ident">HDKeyPaths</span>,
- <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">AddressValidatorError</span><span class="op">></span>;
-}
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="kw">mod</span> <span class="ident">test</span> {
- <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>;
-
- <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
- <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">test</span>::{<span class="ident">get_funded_wallet</span>, <span class="ident">get_test_wpkh</span>};
- <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">TxBuilder</span>;
-
- <span class="kw">struct</span> <span class="ident">TestValidator</span>;
- <span class="kw">impl</span> <span class="ident">AddressValidator</span> <span class="kw">for</span> <span class="ident">TestValidator</span> {
- <span class="kw">fn</span> <span class="ident">validate</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">_script_type</span>: <span class="ident">ScriptType</span>,
- <span class="ident">_hd_keypaths</span>: <span class="kw-2">&</span><span class="ident">HDKeyPaths</span>,
- <span class="ident">_script</span>: <span class="kw-2">&</span><span class="ident">bitcoin</span>::<span class="ident">Script</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">AddressValidatorError</span><span class="op">></span> {
- <span class="prelude-val">Err</span>(<span class="ident">AddressValidatorError</span>::<span class="ident">InvalidScript</span>)
- }
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"InvalidScript"</span>)]</span>
- <span class="kw">fn</span> <span class="ident">test_address_validator_external</span>() {
- <span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="ident">wallet</span>.<span class="ident">add_address_validator</span>(<span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">TestValidator</span>)));
-
- <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"InvalidScript"</span>)]</span>
- <span class="kw">fn</span> <span class="ident">test_address_validator_internal</span>() {
- <span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">wallet</span>, <span class="ident">descriptors</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="ident">wallet</span>.<span class="ident">add_address_validator</span>(<span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">TestValidator</span>)));
-
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="macro">testutils</span><span class="macro">!</span>(@<span class="ident">external</span> <span class="ident">descriptors</span>, <span class="number">10</span>);
- <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
- <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
- <span class="number">25_000</span>,
- )]))
- .<span class="ident">unwrap</span>();
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/wallet/coin_selection.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>coin_selection.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-<span id="203">203</span>
-<span id="204">204</span>
-<span id="205">205</span>
-<span id="206">206</span>
-<span id="207">207</span>
-<span id="208">208</span>
-<span id="209">209</span>
-<span id="210">210</span>
-<span id="211">211</span>
-<span id="212">212</span>
-<span id="213">213</span>
-<span id="214">214</span>
-<span id="215">215</span>
-<span id="216">216</span>
-<span id="217">217</span>
-<span id="218">218</span>
-<span id="219">219</span>
-<span id="220">220</span>
-<span id="221">221</span>
-<span id="222">222</span>
-<span id="223">223</span>
-<span id="224">224</span>
-<span id="225">225</span>
-<span id="226">226</span>
-<span id="227">227</span>
-<span id="228">228</span>
-<span id="229">229</span>
-<span id="230">230</span>
-<span id="231">231</span>
-<span id="232">232</span>
-<span id="233">233</span>
-<span id="234">234</span>
-<span id="235">235</span>
-<span id="236">236</span>
-<span id="237">237</span>
-<span id="238">238</span>
-<span id="239">239</span>
-<span id="240">240</span>
-<span id="241">241</span>
-<span id="242">242</span>
-<span id="243">243</span>
-<span id="244">244</span>
-<span id="245">245</span>
-<span id="246">246</span>
-<span id="247">247</span>
-<span id="248">248</span>
-<span id="249">249</span>
-<span id="250">250</span>
-<span id="251">251</span>
-<span id="252">252</span>
-<span id="253">253</span>
-<span id="254">254</span>
-<span id="255">255</span>
-<span id="256">256</span>
-<span id="257">257</span>
-<span id="258">258</span>
-<span id="259">259</span>
-<span id="260">260</span>
-<span id="261">261</span>
-<span id="262">262</span>
-<span id="263">263</span>
-<span id="264">264</span>
-<span id="265">265</span>
-<span id="266">266</span>
-<span id="267">267</span>
-<span id="268">268</span>
-<span id="269">269</span>
-<span id="270">270</span>
-<span id="271">271</span>
-<span id="272">272</span>
-<span id="273">273</span>
-<span id="274">274</span>
-<span id="275">275</span>
-<span id="276">276</span>
-<span id="277">277</span>
-<span id="278">278</span>
-<span id="279">279</span>
-<span id="280">280</span>
-<span id="281">281</span>
-<span id="282">282</span>
-<span id="283">283</span>
-<span id="284">284</span>
-<span id="285">285</span>
-<span id="286">286</span>
-<span id="287">287</span>
-<span id="288">288</span>
-<span id="289">289</span>
-<span id="290">290</span>
-<span id="291">291</span>
-<span id="292">292</span>
-<span id="293">293</span>
-<span id="294">294</span>
-<span id="295">295</span>
-<span id="296">296</span>
-<span id="297">297</span>
-<span id="298">298</span>
-<span id="299">299</span>
-<span id="300">300</span>
-<span id="301">301</span>
-<span id="302">302</span>
-<span id="303">303</span>
-<span id="304">304</span>
-<span id="305">305</span>
-<span id="306">306</span>
-<span id="307">307</span>
-<span id="308">308</span>
-<span id="309">309</span>
-<span id="310">310</span>
-<span id="311">311</span>
-<span id="312">312</span>
-<span id="313">313</span>
-<span id="314">314</span>
-<span id="315">315</span>
-<span id="316">316</span>
-<span id="317">317</span>
-<span id="318">318</span>
-<span id="319">319</span>
-<span id="320">320</span>
-<span id="321">321</span>
-<span id="322">322</span>
-<span id="323">323</span>
-<span id="324">324</span>
-<span id="325">325</span>
-<span id="326">326</span>
-<span id="327">327</span>
-<span id="328">328</span>
-<span id="329">329</span>
-<span id="330">330</span>
-<span id="331">331</span>
-<span id="332">332</span>
-<span id="333">333</span>
-<span id="334">334</span>
-<span id="335">335</span>
-<span id="336">336</span>
-<span id="337">337</span>
-<span id="338">338</span>
-<span id="339">339</span>
-<span id="340">340</span>
-<span id="341">341</span>
-<span id="342">342</span>
-<span id="343">343</span>
-<span id="344">344</span>
-<span id="345">345</span>
-<span id="346">346</span>
-<span id="347">347</span>
-<span id="348">348</span>
-<span id="349">349</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="doccomment">//! Coin selection</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! This module provides the trait [`CoinSelectionAlgorithm`] that can be implemented to</span>
-<span class="doccomment">//! define custom coin selection algorithms.</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! The coin selection algorithm is not globally part of a [`Wallet`](super::Wallet), instead it</span>
-<span class="doccomment">//! is selected whenever a [`Wallet::create_tx`](super::Wallet::create_tx) call is made, through</span>
-<span class="doccomment">//! the use of the [`TxBuilder`] structure, specifically with</span>
-<span class="doccomment">//! [`TxBuilder::coin_selection`](super::tx_builder::TxBuilder::coin_selection) method.</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! The [`DefaultCoinSelectionAlgorithm`] selects the default coin selection algorithm that</span>
-<span class="doccomment">//! [`TxBuilder`] uses, if it's not explicitly overridden.</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! [`TxBuilder`]: super::tx_builder::TxBuilder</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ## Example</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ```no_run</span>
-<span class="doccomment">//! # use std::str::FromStr;</span>
-<span class="doccomment">//! # use bitcoin::*;</span>
-<span class="doccomment">//! # use bitcoin::consensus::serialize;</span>
-<span class="doccomment">//! # use magical::wallet::coin_selection::*;</span>
-<span class="doccomment">//! # use magical::*;</span>
-<span class="doccomment">//! #[derive(Debug)]</span>
-<span class="doccomment">//! struct AlwaysSpendEverything;</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! impl CoinSelectionAlgorithm for AlwaysSpendEverything {</span>
-<span class="doccomment">//! fn coin_select(</span>
-<span class="doccomment">//! &self,</span>
-<span class="doccomment">//! utxos: Vec<UTXO>,</span>
-<span class="doccomment">//! _use_all_utxos: bool,</span>
-<span class="doccomment">//! fee_rate: FeeRate,</span>
-<span class="doccomment">//! amount_needed: u64,</span>
-<span class="doccomment">//! input_witness_weight: usize,</span>
-<span class="doccomment">//! fee_amount: f32,</span>
-<span class="doccomment">//! ) -> Result<CoinSelectionResult, magical::Error> {</span>
-<span class="doccomment">//! let selected_amount = utxos.iter().fold(0, |acc, utxo| acc + utxo.txout.value);</span>
-<span class="doccomment">//! let all_utxos_selected = utxos</span>
-<span class="doccomment">//! .into_iter()</span>
-<span class="doccomment">//! .map(|utxo| {</span>
-<span class="doccomment">//! (</span>
-<span class="doccomment">//! TxIn {</span>
-<span class="doccomment">//! previous_output: utxo.outpoint,</span>
-<span class="doccomment">//! ..Default::default()</span>
-<span class="doccomment">//! },</span>
-<span class="doccomment">//! utxo.txout.script_pubkey,</span>
-<span class="doccomment">//! )</span>
-<span class="doccomment">//! })</span>
-<span class="doccomment">//! .collect::<Vec<_>>();</span>
-<span class="doccomment">//! let additional_weight = all_utxos_selected.iter().fold(0, |acc, (txin, _)| {</span>
-<span class="doccomment">//! acc + serialize(txin).len() * 4 + input_witness_weight</span>
-<span class="doccomment">//! });</span>
-<span class="doccomment">//! let additional_fees = additional_weight as f32 * fee_rate.as_sat_vb() / 4.0;</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! if (fee_amount + additional_fees).ceil() as u64 + amount_needed > selected_amount {</span>
-<span class="doccomment">//! return Err(magical::Error::InsufficientFunds);</span>
-<span class="doccomment">//! }</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! Ok(CoinSelectionResult {</span>
-<span class="doccomment">//! txin: all_utxos_selected,</span>
-<span class="doccomment">//! selected_amount,</span>
-<span class="doccomment">//! fee_amount: fee_amount + additional_fees,</span>
-<span class="doccomment">//! })</span>
-<span class="doccomment">//! }</span>
-<span class="doccomment">//! }</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! # let wallet: OfflineWallet<_> = Wallet::new_offline("", None, Network::Testnet, magical::database::MemoryDatabase::default())?;</span>
-<span class="doccomment">//! // create wallet, sync, ...</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! let to_address = Address::from_str("2N4eQYCbKUHCCTUjBJeHcJp9ok6J2GZsTDt").unwrap();</span>
-<span class="doccomment">//! let (psbt, details) = wallet.create_tx(</span>
-<span class="doccomment">//! TxBuilder::with_recipients(vec![(to_address.script_pubkey(), 50_000)])</span>
-<span class="doccomment">//! .coin_selection(AlwaysSpendEverything),</span>
-<span class="doccomment">//! )?;</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! // inspect, sign, broadcast, ...</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! # Ok::<(), magical::Error>(())</span>
-<span class="doccomment">//! ```</span>
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">serialize</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Script</span>, <span class="ident">TxIn</span>};
-
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::{<span class="ident">FeeRate</span>, <span class="ident">UTXO</span>};
-
-<span class="doccomment">/// Default coin selection algorithm used by [`TxBuilder`](super::tx_builder::TxBuilder) if not</span>
-<span class="doccomment">/// overridden</span>
-<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">DefaultCoinSelectionAlgorithm</span> <span class="op">=</span> <span class="ident">DumbCoinSelection</span>;
-
-<span class="doccomment">/// Result of a successful coin selection</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">CoinSelectionResult</span> {
- <span class="doccomment">/// List of inputs to use, with the respective previous script_pubkey</span>
- <span class="kw">pub</span> <span class="ident">txin</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">TxIn</span>, <span class="ident">Script</span>)<span class="op">></span>,
- <span class="doccomment">/// Sum of the selected inputs' value</span>
- <span class="kw">pub</span> <span class="ident">selected_amount</span>: <span class="ident">u64</span>,
- <span class="doccomment">/// Total fee amount in satoshi</span>
- <span class="kw">pub</span> <span class="ident">fee_amount</span>: <span class="ident">f32</span>,
-}
-
-<span class="doccomment">/// Trait for generalized coin selection algorithms</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// This trait can be implemented to make the [`Wallet`](super::Wallet) use a customized coin</span>
-<span class="doccomment">/// selection algorithm when it creates transactions.</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// For an example see [this module](crate::wallet::coin_selection)'s documentation.</span>
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">CoinSelectionAlgorithm</span>: <span class="ident">std</span>::<span class="ident">fmt</span>::<span class="ident">Debug</span> {
- <span class="doccomment">/// Perform the coin selection</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// - `utxos`: the list of spendable UTXOs</span>
- <span class="doccomment">/// - `use_all_utxos`: if true all utxos should be spent unconditionally</span>
- <span class="doccomment">/// - `fee_rate`: fee rate to use</span>
- <span class="doccomment">/// - `amount_needed`: the amount in satoshi to select</span>
- <span class="doccomment">/// - `input_witness_weight`: the weight of an input's witness to keep into account for the fees</span>
- <span class="doccomment">/// - `fee_amount`: the amount of fees in satoshi already accumulated from adding outputs</span>
- <span class="kw">fn</span> <span class="ident">coin_select</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>,
- <span class="ident">use_all_utxos</span>: <span class="ident">bool</span>,
- <span class="ident">fee_rate</span>: <span class="ident">FeeRate</span>,
- <span class="ident">amount_needed</span>: <span class="ident">u64</span>,
- <span class="ident">input_witness_weight</span>: <span class="ident">usize</span>,
- <span class="ident">fee_amount</span>: <span class="ident">f32</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CoinSelectionResult</span>, <span class="ident">Error</span><span class="op">></span>;
-}
-
-<span class="doccomment">/// Simple and dumb coin selection</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// This coin selection algorithm sorts the available UTXOs by value and then picks them starting</span>
-<span class="doccomment">/// from the largest ones until the required amount is reached.</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Default</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">DumbCoinSelection</span>;
-
-<span class="kw">impl</span> <span class="ident">CoinSelectionAlgorithm</span> <span class="kw">for</span> <span class="ident">DumbCoinSelection</span> {
- <span class="kw">fn</span> <span class="ident">coin_select</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="kw-2">mut</span> <span class="ident">utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>,
- <span class="ident">use_all_utxos</span>: <span class="ident">bool</span>,
- <span class="ident">fee_rate</span>: <span class="ident">FeeRate</span>,
- <span class="ident">outgoing_amount</span>: <span class="ident">u64</span>,
- <span class="ident">input_witness_weight</span>: <span class="ident">usize</span>,
- <span class="kw-2">mut</span> <span class="ident">fee_amount</span>: <span class="ident">f32</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">CoinSelectionResult</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">txin</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
- <span class="kw">let</span> <span class="ident">calc_fee_bytes</span> <span class="op">=</span> <span class="op">|</span><span class="ident">wu</span><span class="op">|</span> (<span class="ident">wu</span> <span class="kw">as</span> <span class="ident">f32</span>) <span class="op">*</span> <span class="ident">fee_rate</span>.<span class="ident">as_sat_vb</span>() <span class="op">/</span> <span class="number">4.0</span>;
-
- <span class="ident">log</span>::<span class="macro">debug</span><span class="macro">!</span>(
- <span class="string">"outgoing_amount = `{}`, fee_amount = `{}`, fee_rate = `{:?}`"</span>,
- <span class="ident">outgoing_amount</span>,
- <span class="ident">fee_amount</span>,
- <span class="ident">fee_rate</span>
- );
-
- <span class="comment">// sort so that we pick them starting from the larger.</span>
- <span class="ident">utxos</span>.<span class="ident">sort_by</span>(<span class="op">|</span><span class="ident">a</span>, <span class="ident">b</span><span class="op">|</span> <span class="ident">a</span>.<span class="ident">txout</span>.<span class="ident">value</span>.<span class="ident">partial_cmp</span>(<span class="kw-2">&</span><span class="ident">b</span>.<span class="ident">txout</span>.<span class="ident">value</span>).<span class="ident">unwrap</span>());
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">selected_amount</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">while</span> <span class="ident">use_all_utxos</span> <span class="op">|</span><span class="op">|</span> <span class="ident">selected_amount</span> <span class="op"><</span> <span class="ident">outgoing_amount</span> <span class="op">+</span> (<span class="ident">fee_amount</span>.<span class="ident">ceil</span>() <span class="kw">as</span> <span class="ident">u64</span>) {
- <span class="kw">let</span> <span class="ident">utxo</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">utxos</span>.<span class="ident">pop</span>() {
- <span class="prelude-val">Some</span>(<span class="ident">utxo</span>) <span class="op">=</span><span class="op">></span> <span class="ident">utxo</span>,
- <span class="prelude-val">None</span> <span class="kw">if</span> <span class="ident">selected_amount</span> <span class="op"><</span> <span class="ident">outgoing_amount</span> <span class="op">+</span> (<span class="ident">fee_amount</span>.<span class="ident">ceil</span>() <span class="kw">as</span> <span class="ident">u64</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">InsufficientFunds</span>)
- }
- <span class="prelude-val">None</span> <span class="kw">if</span> <span class="ident">use_all_utxos</span> <span class="op">=</span><span class="op">></span> <span class="kw">break</span>,
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">InsufficientFunds</span>),
- };
-
- <span class="kw">let</span> <span class="ident">new_in</span> <span class="op">=</span> <span class="ident">TxIn</span> {
- <span class="ident">previous_output</span>: <span class="ident">utxo</span>.<span class="ident">outpoint</span>,
- <span class="ident">script_sig</span>: <span class="ident">Script</span>::<span class="ident">default</span>(),
- <span class="ident">sequence</span>: <span class="number">0</span>, <span class="comment">// Let the caller choose the right nSequence</span>
- <span class="ident">witness</span>: <span class="macro">vec</span><span class="macro">!</span>[],
- };
- <span class="ident">fee_amount</span> <span class="op">+</span><span class="op">=</span> <span class="ident">calc_fee_bytes</span>(<span class="ident">serialize</span>(<span class="kw-2">&</span><span class="ident">new_in</span>).<span class="ident">len</span>() <span class="op">*</span> <span class="number">4</span> <span class="op">+</span> <span class="ident">input_witness_weight</span>);
- <span class="ident">log</span>::<span class="macro">debug</span><span class="macro">!</span>(
- <span class="string">"Selected {}, updated fee_amount = `{}`"</span>,
- <span class="ident">new_in</span>.<span class="ident">previous_output</span>,
- <span class="ident">fee_amount</span>
- );
-
- <span class="ident">txin</span>.<span class="ident">push</span>((<span class="ident">new_in</span>, <span class="ident">utxo</span>.<span class="ident">txout</span>.<span class="ident">script_pubkey</span>));
- <span class="ident">selected_amount</span> <span class="op">+</span><span class="op">=</span> <span class="ident">utxo</span>.<span class="ident">txout</span>.<span class="ident">value</span>;
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">CoinSelectionResult</span> {
- <span class="ident">txin</span>,
- <span class="ident">fee_amount</span>,
- <span class="ident">selected_amount</span>,
- })
- }
-}
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="kw">mod</span> <span class="ident">test</span> {
- <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
-
- <span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">OutPoint</span>, <span class="ident">Script</span>, <span class="ident">TxOut</span>};
-
- <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
- <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="kw-2">*</span>;
-
- <span class="kw">const</span> <span class="ident">P2WPKH_WITNESS_SIZE</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">73</span> <span class="op">+</span> <span class="number">33</span> <span class="op">+</span> <span class="number">2</span>;
-
- <span class="kw">fn</span> <span class="ident">get_test_utxos</span>() <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span> {
- <span class="macro">vec</span><span class="macro">!</span>[
- <span class="ident">UTXO</span> {
- <span class="ident">outpoint</span>: <span class="ident">OutPoint</span>::<span class="ident">from_str</span>(
- <span class="string">"ebd9813ecebc57ff8f30797de7c205e3c7498ca950ea4341ee51a685ff2fa30a:0"</span>,
- )
- .<span class="ident">unwrap</span>(),
- <span class="ident">txout</span>: <span class="ident">TxOut</span> {
- <span class="ident">value</span>: <span class="number">100_000</span>,
- <span class="ident">script_pubkey</span>: <span class="ident">Script</span>::<span class="ident">new</span>(),
- },
- <span class="ident">is_internal</span>: <span class="bool-val">false</span>,
- },
- <span class="ident">UTXO</span> {
- <span class="ident">outpoint</span>: <span class="ident">OutPoint</span>::<span class="ident">from_str</span>(
- <span class="string">"65d92ddff6b6dc72c89624a6491997714b90f6004f928d875bc0fd53f264fa85:0"</span>,
- )
- .<span class="ident">unwrap</span>(),
- <span class="ident">txout</span>: <span class="ident">TxOut</span> {
- <span class="ident">value</span>: <span class="number">200_000</span>,
- <span class="ident">script_pubkey</span>: <span class="ident">Script</span>::<span class="ident">new</span>(),
- },
- <span class="ident">is_internal</span>: <span class="bool-val">true</span>,
- },
- ]
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_dumb_coin_selection_success</span>() {
- <span class="kw">let</span> <span class="ident">utxos</span> <span class="op">=</span> <span class="ident">get_test_utxos</span>();
-
- <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">DumbCoinSelection</span>
- .<span class="ident">coin_select</span>(
- <span class="ident">utxos</span>,
- <span class="bool-val">false</span>,
- <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">1.0</span>),
- <span class="number">250_000</span>,
- <span class="ident">P2WPKH_WITNESS_SIZE</span>,
- <span class="number">50.0</span>,
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">txin</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">selected_amount</span>, <span class="number">300_000</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">fee_amount</span>, <span class="number">186.0</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_dumb_coin_selection_use_all</span>() {
- <span class="kw">let</span> <span class="ident">utxos</span> <span class="op">=</span> <span class="ident">get_test_utxos</span>();
-
- <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">DumbCoinSelection</span>
- .<span class="ident">coin_select</span>(
- <span class="ident">utxos</span>,
- <span class="bool-val">true</span>,
- <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">1.0</span>),
- <span class="number">20_000</span>,
- <span class="ident">P2WPKH_WITNESS_SIZE</span>,
- <span class="number">50.0</span>,
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">txin</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">selected_amount</span>, <span class="number">300_000</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">fee_amount</span>, <span class="number">186.0</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_dumb_coin_selection_use_only_necessary</span>() {
- <span class="kw">let</span> <span class="ident">utxos</span> <span class="op">=</span> <span class="ident">get_test_utxos</span>();
-
- <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">DumbCoinSelection</span>
- .<span class="ident">coin_select</span>(
- <span class="ident">utxos</span>,
- <span class="bool-val">false</span>,
- <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">1.0</span>),
- <span class="number">20_000</span>,
- <span class="ident">P2WPKH_WITNESS_SIZE</span>,
- <span class="number">50.0</span>,
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">txin</span>.<span class="ident">len</span>(), <span class="number">1</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">selected_amount</span>, <span class="number">200_000</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">fee_amount</span>, <span class="number">118.0</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"InsufficientFunds"</span>)]</span>
- <span class="kw">fn</span> <span class="ident">test_dumb_coin_selection_insufficient_funds</span>() {
- <span class="kw">let</span> <span class="ident">utxos</span> <span class="op">=</span> <span class="ident">get_test_utxos</span>();
-
- <span class="ident">DumbCoinSelection</span>
- .<span class="ident">coin_select</span>(
- <span class="ident">utxos</span>,
- <span class="bool-val">false</span>,
- <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">1.0</span>),
- <span class="number">500_000</span>,
- <span class="ident">P2WPKH_WITNESS_SIZE</span>,
- <span class="number">50.0</span>,
- )
- .<span class="ident">unwrap</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"InsufficientFunds"</span>)]</span>
- <span class="kw">fn</span> <span class="ident">test_dumb_coin_selection_insufficient_funds_high_fees</span>() {
- <span class="kw">let</span> <span class="ident">utxos</span> <span class="op">=</span> <span class="ident">get_test_utxos</span>();
-
- <span class="ident">DumbCoinSelection</span>
- .<span class="ident">coin_select</span>(
- <span class="ident">utxos</span>,
- <span class="bool-val">false</span>,
- <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">1000.0</span>),
- <span class="number">250_000</span>,
- <span class="ident">P2WPKH_WITNESS_SIZE</span>,
- <span class="number">50.0</span>,
- )
- .<span class="ident">unwrap</span>();
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/wallet/export.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>export.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-<span id="203">203</span>
-<span id="204">204</span>
-<span id="205">205</span>
-<span id="206">206</span>
-<span id="207">207</span>
-<span id="208">208</span>
-<span id="209">209</span>
-<span id="210">210</span>
-<span id="211">211</span>
-<span id="212">212</span>
-<span id="213">213</span>
-<span id="214">214</span>
-<span id="215">215</span>
-<span id="216">216</span>
-<span id="217">217</span>
-<span id="218">218</span>
-<span id="219">219</span>
-<span id="220">220</span>
-<span id="221">221</span>
-<span id="222">222</span>
-<span id="223">223</span>
-<span id="224">224</span>
-<span id="225">225</span>
-<span id="226">226</span>
-<span id="227">227</span>
-<span id="228">228</span>
-<span id="229">229</span>
-<span id="230">230</span>
-<span id="231">231</span>
-<span id="232">232</span>
-<span id="233">233</span>
-<span id="234">234</span>
-<span id="235">235</span>
-<span id="236">236</span>
-<span id="237">237</span>
-<span id="238">238</span>
-<span id="239">239</span>
-<span id="240">240</span>
-<span id="241">241</span>
-<span id="242">242</span>
-<span id="243">243</span>
-<span id="244">244</span>
-<span id="245">245</span>
-<span id="246">246</span>
-<span id="247">247</span>
-<span id="248">248</span>
-<span id="249">249</span>
-<span id="250">250</span>
-<span id="251">251</span>
-<span id="252">252</span>
-<span id="253">253</span>
-<span id="254">254</span>
-<span id="255">255</span>
-<span id="256">256</span>
-<span id="257">257</span>
-<span id="258">258</span>
-<span id="259">259</span>
-<span id="260">260</span>
-<span id="261">261</span>
-<span id="262">262</span>
-<span id="263">263</span>
-<span id="264">264</span>
-<span id="265">265</span>
-<span id="266">266</span>
-<span id="267">267</span>
-<span id="268">268</span>
-<span id="269">269</span>
-<span id="270">270</span>
-<span id="271">271</span>
-<span id="272">272</span>
-<span id="273">273</span>
-<span id="274">274</span>
-<span id="275">275</span>
-<span id="276">276</span>
-<span id="277">277</span>
-<span id="278">278</span>
-<span id="279">279</span>
-<span id="280">280</span>
-<span id="281">281</span>
-<span id="282">282</span>
-<span id="283">283</span>
-<span id="284">284</span>
-<span id="285">285</span>
-<span id="286">286</span>
-<span id="287">287</span>
-<span id="288">288</span>
-<span id="289">289</span>
-<span id="290">290</span>
-<span id="291">291</span>
-<span id="292">292</span>
-<span id="293">293</span>
-<span id="294">294</span>
-<span id="295">295</span>
-<span id="296">296</span>
-<span id="297">297</span>
-<span id="298">298</span>
-<span id="299">299</span>
-<span id="300">300</span>
-<span id="301">301</span>
-<span id="302">302</span>
-<span id="303">303</span>
-<span id="304">304</span>
-<span id="305">305</span>
-<span id="306">306</span>
-<span id="307">307</span>
-<span id="308">308</span>
-<span id="309">309</span>
-<span id="310">310</span>
-<span id="311">311</span>
-<span id="312">312</span>
-<span id="313">313</span>
-<span id="314">314</span>
-<span id="315">315</span>
-<span id="316">316</span>
-<span id="317">317</span>
-<span id="318">318</span>
-<span id="319">319</span>
-<span id="320">320</span>
-<span id="321">321</span>
-<span id="322">322</span>
-<span id="323">323</span>
-<span id="324">324</span>
-<span id="325">325</span>
-<span id="326">326</span>
-<span id="327">327</span>
-<span id="328">328</span>
-<span id="329">329</span>
-<span id="330">330</span>
-<span id="331">331</span>
-<span id="332">332</span>
-<span id="333">333</span>
-<span id="334">334</span>
-<span id="335">335</span>
-<span id="336">336</span>
-<span id="337">337</span>
-<span id="338">338</span>
-<span id="339">339</span>
-<span id="340">340</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="doccomment">//! Wallet export</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! This modules implements the wallet export format used by [FullyNoded](https://github.com/Fonta1n3/FullyNoded/blob/10b7808c8b929b171cca537fb50522d015168ac9/Docs/Wallets/Wallet-Export-Spec.md).</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ## Examples</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ### Import from JSON</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ```</span>
-<span class="doccomment">//! # use std::str::FromStr;</span>
-<span class="doccomment">//! # use bitcoin::*;</span>
-<span class="doccomment">//! # use magical::database::*;</span>
-<span class="doccomment">//! # use magical::wallet::export::*;</span>
-<span class="doccomment">//! # use magical::*;</span>
-<span class="doccomment">//! let import = r#"{</span>
-<span class="doccomment">//! "descriptor": "wpkh([c258d2e4\/84h\/1h\/0h]tpubDD3ynpHgJQW8VvWRzQ5WFDCrs4jqVFGHB3vLC3r49XHJSqP8bHKdK4AriuUKLccK68zfzowx7YhmDN8SiSkgCDENUFx9qVw65YyqM78vyVe\/0\/*)",</span>
-<span class="doccomment">//! "blockheight":1782088,</span>
-<span class="doccomment">//! "label":"testnet"</span>
-<span class="doccomment">//! }"#;</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! let import = WalletExport::from_str(import)?;</span>
-<span class="doccomment">//! let wallet: OfflineWallet<_> = Wallet::new_offline(&import.descriptor(), import.change_descriptor().as_deref(), Network::Testnet, MemoryDatabase::default())?;</span>
-<span class="doccomment">//! # Ok::<_, magical::Error>(())</span>
-<span class="doccomment">//! ```</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ### Export a `Wallet`</span>
-<span class="doccomment">//! ```</span>
-<span class="doccomment">//! # use bitcoin::*;</span>
-<span class="doccomment">//! # use magical::database::*;</span>
-<span class="doccomment">//! # use magical::wallet::export::*;</span>
-<span class="doccomment">//! # use magical::*;</span>
-<span class="doccomment">//! let wallet: OfflineWallet<_> = Wallet::new_offline(</span>
-<span class="doccomment">//! "wpkh([c258d2e4/84h/1h/0h]tpubDD3ynpHgJQW8VvWRzQ5WFDCrs4jqVFGHB3vLC3r49XHJSqP8bHKdK4AriuUKLccK68zfzowx7YhmDN8SiSkgCDENUFx9qVw65YyqM78vyVe/0/*)",</span>
-<span class="doccomment">//! Some("wpkh([c258d2e4/84h/1h/0h]tpubDD3ynpHgJQW8VvWRzQ5WFDCrs4jqVFGHB3vLC3r49XHJSqP8bHKdK4AriuUKLccK68zfzowx7YhmDN8SiSkgCDENUFx9qVw65YyqM78vyVe/1/*)"),</span>
-<span class="doccomment">//! Network::Testnet,</span>
-<span class="doccomment">//! MemoryDatabase::default()</span>
-<span class="doccomment">//! )?;</span>
-<span class="doccomment">//! let export = WalletExport::export_wallet(&wallet, "exported wallet", true)</span>
-<span class="doccomment">//! .map_err(ToString::to_string)</span>
-<span class="doccomment">//! .map_err(magical::Error::Generic)?;</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! println!("Exported: {}", export.to_string());</span>
-<span class="doccomment">//! # Ok::<_, magical::Error>(())</span>
-<span class="doccomment">//! ```</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
-
-<span class="kw">use</span> <span class="ident">serde</span>::{<span class="ident">Deserialize</span>, <span class="ident">Serialize</span>};
-
-<span class="kw">use</span> <span class="ident">miniscript</span>::{<span class="ident">Descriptor</span>, <span class="ident">ScriptContext</span>, <span class="ident">Terminal</span>};
-
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">blockchain</span>::<span class="ident">Blockchain</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">BatchDatabase</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">Wallet</span>;
-
-<span class="doccomment">/// Structure that contains the export of a wallet</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// For a usage example see [this module](crate::wallet::export)'s documentation.</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Serialize</span>, <span class="ident">Deserialize</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">WalletExport</span> {
- <span class="ident">descriptor</span>: <span class="ident">String</span>,
- <span class="doccomment">/// Earliest block to rescan when looking for the wallet's transactions</span>
- <span class="kw">pub</span> <span class="ident">blockheight</span>: <span class="ident">u32</span>,
- <span class="doccomment">/// Arbitrary label for the wallet</span>
- <span class="kw">pub</span> <span class="ident">label</span>: <span class="ident">String</span>,
-}
-
-<span class="kw">impl</span> <span class="ident">ToString</span> <span class="kw">for</span> <span class="ident">WalletExport</span> {
- <span class="kw">fn</span> <span class="ident">to_string</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">String</span> {
- <span class="ident">serde_json</span>::<span class="ident">to_string</span>(<span class="self">self</span>).<span class="ident">unwrap</span>()
- }
-}
-
-<span class="kw">impl</span> <span class="ident">FromStr</span> <span class="kw">for</span> <span class="ident">WalletExport</span> {
- <span class="kw">type</span> <span class="prelude-val">Err</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">Error</span>;
-
- <span class="kw">fn</span> <span class="ident">from_str</span>(<span class="ident">s</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="self">Self</span>::<span class="prelude-val">Err</span><span class="op">></span> {
- <span class="ident">serde_json</span>::<span class="ident">from_str</span>(<span class="ident">s</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">WalletExport</span> {
- <span class="doccomment">/// Export a wallet</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// This function returns an error if it determines that the `wallet`'s descriptor(s) are not</span>
- <span class="doccomment">/// supported by Bitcoin Core or don't follow the standard derivation paths defined by BIP44</span>
- <span class="doccomment">/// and others.</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// If `include_blockheight` is `true`, this function will look into the `wallet`'s database</span>
- <span class="doccomment">/// for the oldest transaction it knows and use that as the earliest block to rescan.</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// If the database is empty or `include_blockheight` is false, the `blockheight` field</span>
- <span class="doccomment">/// returned will be `0`.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">export_wallet</span><span class="op"><</span><span class="ident">B</span>: <span class="ident">Blockchain</span>, <span class="ident">D</span>: <span class="ident">BatchDatabase</span><span class="op">></span>(
- <span class="ident">wallet</span>: <span class="kw-2">&</span><span class="ident">Wallet</span><span class="op"><</span><span class="ident">B</span>, <span class="ident">D</span><span class="op">></span>,
- <span class="ident">label</span>: <span class="kw-2">&</span><span class="ident">str</span>,
- <span class="ident">include_blockheight</span>: <span class="ident">bool</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">descriptor</span>
- .<span class="ident">to_string_with_secret</span>(<span class="kw-2">&</span><span class="ident">wallet</span>.<span class="ident">signers</span>.<span class="ident">as_key_map</span>());
- <span class="self">Self</span>::<span class="ident">is_compatible_with_core</span>(<span class="kw-2">&</span><span class="ident">descriptor</span>)<span class="question-mark">?</span>;
-
- <span class="kw">let</span> <span class="ident">blockheight</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">iter_txs</span>(<span class="bool-val">false</span>) {
- <span class="kw">_</span> <span class="kw">if</span> <span class="op">!</span><span class="ident">include_blockheight</span> <span class="op">=</span><span class="op">></span> <span class="number">0</span>,
- <span class="prelude-val">Err</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="number">0</span>,
- <span class="prelude-val">Ok</span>(<span class="ident">txs</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">heights</span> <span class="op">=</span> <span class="ident">txs</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">tx</span><span class="op">|</span> <span class="ident">tx</span>.<span class="ident">height</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>))
- .<span class="ident">collect</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span><span class="op">></span>();
- <span class="ident">heights</span>.<span class="ident">sort</span>();
-
- <span class="kw-2">*</span><span class="ident">heights</span>.<span class="ident">last</span>().<span class="ident">unwrap_or</span>(<span class="kw-2">&</span><span class="number">0</span>)
- }
- };
-
- <span class="kw">let</span> <span class="ident">export</span> <span class="op">=</span> <span class="ident">WalletExport</span> {
- <span class="ident">descriptor</span>,
- <span class="ident">label</span>: <span class="ident">label</span>.<span class="ident">into</span>(),
- <span class="ident">blockheight</span>,
- };
-
- <span class="kw">if</span> <span class="ident">export</span>.<span class="ident">change_descriptor</span>()
- <span class="op">!</span><span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">change_descriptor</span>
- .<span class="ident">as_ref</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">d</span><span class="op">|</span> <span class="ident">d</span>.<span class="ident">to_string_with_secret</span>(<span class="kw-2">&</span><span class="ident">wallet</span>.<span class="ident">change_signers</span>.<span class="ident">as_key_map</span>()))
- {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="string">"Incompatible change descriptor"</span>);
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">export</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">is_compatible_with_core</span>(<span class="ident">descriptor</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">check_ms</span><span class="op"><</span><span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span>(
- <span class="ident">terminal</span>: <span class="ident">Terminal</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">Ctx</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span><span class="op">></span> {
- <span class="kw">if</span> <span class="kw">let</span> <span class="ident">Terminal</span>::<span class="ident">Multi</span>(<span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">terminal</span> {
- <span class="prelude-val">Ok</span>(())
- } <span class="kw">else</span> {
- <span class="prelude-val">Err</span>(<span class="string">"The descriptor contains operators not supported by Bitcoin Core"</span>)
- }
- }
-
- <span class="kw">match</span> <span class="ident">Descriptor</span>::<span class="op"><</span><span class="ident">String</span><span class="op">></span>::<span class="ident">from_str</span>(<span class="ident">descriptor</span>).<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="string">"Invalid descriptor"</span>)<span class="question-mark">?</span> {
- <span class="ident">Descriptor</span>::<span class="ident">Pk</span>(<span class="kw">_</span>)
- <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Pkh</span>(<span class="kw">_</span>)
- <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">Wpkh</span>(<span class="kw">_</span>)
- <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWpkh</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(()),
- <span class="ident">Descriptor</span>::<span class="ident">Sh</span>(<span class="ident">ms</span>) <span class="op">=</span><span class="op">></span> <span class="ident">check_ms</span>(<span class="ident">ms</span>.<span class="ident">node</span>),
- <span class="ident">Descriptor</span>::<span class="ident">Wsh</span>(<span class="ident">ms</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWsh</span>(<span class="ident">ms</span>) <span class="op">=</span><span class="op">></span> <span class="ident">check_ms</span>(<span class="ident">ms</span>.<span class="ident">node</span>),
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="string">"The descriptor is not compatible with Bitcoin Core"</span>),
- }
- }
-
- <span class="doccomment">/// Return the external descriptor</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">descriptor</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">String</span> {
- <span class="self">self</span>.<span class="ident">descriptor</span>.<span class="ident">clone</span>()
- }
-
- <span class="doccomment">/// Return the internal descriptor, if present</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">change_descriptor</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">replaced</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">descriptor</span>.<span class="ident">replace</span>(<span class="string">"/0/*"</span>, <span class="string">"/1/*"</span>);
-
- <span class="kw">if</span> <span class="ident">replaced</span> <span class="op">!</span><span class="op">=</span> <span class="self">self</span>.<span class="ident">descriptor</span> {
- <span class="prelude-val">Some</span>(<span class="ident">replaced</span>)
- } <span class="kw">else</span> {
- <span class="prelude-val">None</span>
- }
- }
-}
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="kw">mod</span> <span class="ident">test</span> {
- <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
-
- <span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Network</span>, <span class="ident">Txid</span>};
-
- <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
- <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::{<span class="ident">memory</span>::<span class="ident">MemoryDatabase</span>, <span class="ident">BatchOperations</span>};
- <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">TransactionDetails</span>;
- <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">wallet</span>::{<span class="ident">OfflineWallet</span>, <span class="ident">Wallet</span>};
-
- <span class="kw">fn</span> <span class="ident">get_test_db</span>() <span class="op">-</span><span class="op">></span> <span class="ident">MemoryDatabase</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">db</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">new</span>();
- <span class="ident">db</span>.<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">TransactionDetails</span> {
- <span class="ident">transaction</span>: <span class="prelude-val">None</span>,
- <span class="ident">txid</span>: <span class="ident">Txid</span>::<span class="ident">from_str</span>(
- <span class="string">"4ddff1fa33af17f377f62b72357b43107c19110a8009b36fb832af505efed98a"</span>,
- )
- .<span class="ident">unwrap</span>(),
- <span class="ident">timestamp</span>: <span class="number">12345678</span>,
- <span class="ident">received</span>: <span class="number">100_000</span>,
- <span class="ident">sent</span>: <span class="number">0</span>,
- <span class="ident">fees</span>: <span class="number">500</span>,
- <span class="ident">height</span>: <span class="prelude-val">Some</span>(<span class="number">5000</span>),
- })
- .<span class="ident">unwrap</span>();
-
- <span class="ident">db</span>
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_export_bip44</span>() {
- <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44'/0'/0'/0/*)"</span>;
- <span class="kw">let</span> <span class="ident">change_descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44'/0'/0'/1/*)"</span>;
-
- <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(
- <span class="ident">descriptor</span>,
- <span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>),
- <span class="ident">Network</span>::<span class="ident">Testnet</span>,
- <span class="ident">get_test_db</span>(),
- )
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">export</span> <span class="op">=</span> <span class="ident">WalletExport</span>::<span class="ident">export_wallet</span>(<span class="kw-2">&</span><span class="ident">wallet</span>, <span class="string">"Test Label"</span>, <span class="bool-val">true</span>).<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">descriptor</span>(), <span class="ident">descriptor</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">change_descriptor</span>(), <span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>.<span class="ident">into</span>()));
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">blockheight</span>, <span class="number">5000</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">label</span>, <span class="string">"Test Label"</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"Incompatible change descriptor"</span>)]</span>
- <span class="kw">fn</span> <span class="ident">test_export_no_change</span>() {
- <span class="comment">// This wallet explicitly doesn't have a change descriptor. It should be impossible to</span>
- <span class="comment">// export, because exporting this kind of external descriptor normally implies the</span>
- <span class="comment">// existence of an internal descriptor</span>
-
- <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44'/0'/0'/0/*)"</span>;
-
- <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span>
- <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(<span class="ident">descriptor</span>, <span class="prelude-val">None</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>, <span class="ident">get_test_db</span>()).<span class="ident">unwrap</span>();
- <span class="ident">WalletExport</span>::<span class="ident">export_wallet</span>(<span class="kw-2">&</span><span class="ident">wallet</span>, <span class="string">"Test Label"</span>, <span class="bool-val">true</span>).<span class="ident">unwrap</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"Incompatible change descriptor"</span>)]</span>
- <span class="kw">fn</span> <span class="ident">test_export_incompatible_change</span>() {
- <span class="comment">// This wallet has a change descriptor, but the derivation path is not in the "standard"</span>
- <span class="comment">// bip44/49/etc format</span>
-
- <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44'/0'/0'/0/*)"</span>;
- <span class="kw">let</span> <span class="ident">change_descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/50'/0'/1/*)"</span>;
-
- <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(
- <span class="ident">descriptor</span>,
- <span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>),
- <span class="ident">Network</span>::<span class="ident">Testnet</span>,
- <span class="ident">get_test_db</span>(),
- )
- .<span class="ident">unwrap</span>();
- <span class="ident">WalletExport</span>::<span class="ident">export_wallet</span>(<span class="kw-2">&</span><span class="ident">wallet</span>, <span class="string">"Test Label"</span>, <span class="bool-val">true</span>).<span class="ident">unwrap</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_export_multi</span>() {
- <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="string">"wsh(multi(2,\
- [73756c7f/48'/0'/0'/2']tpubDCKxNyM3bLgbEX13Mcd8mYxbVg9ajDkWXMh29hMWBurKfVmBfWAM96QVP3zaUcN51HvkZ3ar4VwP82kC8JZhhux8vFQoJintSpVBwpFvyU3/0/*,\
- [f9f62194/48'/0'/0'/2']tpubDDp3ZSH1yCwusRppH7zgSxq2t1VEUyXSeEp8E5aFS8m43MknUjiF1bSLo3CGWAxbDyhF1XowA5ukPzyJZjznYk3kYi6oe7QxtX2euvKWsk4/0/*,\
- [c98b1535/48'/0'/0'/2']tpubDCDi5W4sP6zSnzJeowy8rQDVhBdRARaPhK1axABi8V1661wEPeanpEXj4ZLAUEoikVtoWcyK26TKKJSecSfeKxwHCcRrge9k1ybuiL71z4a/0/*\
- ))"</span>;
- <span class="kw">let</span> <span class="ident">change_descriptor</span> <span class="op">=</span> <span class="string">"wsh(multi(2,\
- [73756c7f/48'/0'/0'/2']tpubDCKxNyM3bLgbEX13Mcd8mYxbVg9ajDkWXMh29hMWBurKfVmBfWAM96QVP3zaUcN51HvkZ3ar4VwP82kC8JZhhux8vFQoJintSpVBwpFvyU3/1/*,\
- [f9f62194/48'/0'/0'/2']tpubDDp3ZSH1yCwusRppH7zgSxq2t1VEUyXSeEp8E5aFS8m43MknUjiF1bSLo3CGWAxbDyhF1XowA5ukPzyJZjznYk3kYi6oe7QxtX2euvKWsk4/1/*,\
- [c98b1535/48'/0'/0'/2']tpubDCDi5W4sP6zSnzJeowy8rQDVhBdRARaPhK1axABi8V1661wEPeanpEXj4ZLAUEoikVtoWcyK26TKKJSecSfeKxwHCcRrge9k1ybuiL71z4a/1/*\
- ))"</span>;
-
- <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(
- <span class="ident">descriptor</span>,
- <span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>),
- <span class="ident">Network</span>::<span class="ident">Testnet</span>,
- <span class="ident">get_test_db</span>(),
- )
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">export</span> <span class="op">=</span> <span class="ident">WalletExport</span>::<span class="ident">export_wallet</span>(<span class="kw-2">&</span><span class="ident">wallet</span>, <span class="string">"Test Label"</span>, <span class="bool-val">true</span>).<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">descriptor</span>(), <span class="ident">descriptor</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">change_descriptor</span>(), <span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>.<span class="ident">into</span>()));
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">blockheight</span>, <span class="number">5000</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">label</span>, <span class="string">"Test Label"</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_export_to_json</span>() {
- <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44'/0'/0'/0/*)"</span>;
- <span class="kw">let</span> <span class="ident">change_descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44'/0'/0'/1/*)"</span>;
-
- <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(
- <span class="ident">descriptor</span>,
- <span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>),
- <span class="ident">Network</span>::<span class="ident">Testnet</span>,
- <span class="ident">get_test_db</span>(),
- )
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">export</span> <span class="op">=</span> <span class="ident">WalletExport</span>::<span class="ident">export_wallet</span>(<span class="kw-2">&</span><span class="ident">wallet</span>, <span class="string">"Test Label"</span>, <span class="bool-val">true</span>).<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">to_string</span>(), <span class="string">"{\"descriptor\":\"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44\'/0\'/0\'/0/*)\",\"blockheight\":5000,\"label\":\"Test Label\"}"</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_export_from_json</span>() {
- <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44'/0'/0'/0/*)"</span>;
- <span class="kw">let</span> <span class="ident">change_descriptor</span> <span class="op">=</span> <span class="string">"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44'/0'/0'/1/*)"</span>;
-
- <span class="kw">let</span> <span class="ident">import_str</span> <span class="op">=</span> <span class="string">"{\"descriptor\":\"wpkh(xprv9s21ZrQH143K4CTb63EaMxja1YiTnSEWKMbn23uoEnAzxjdUJRQkazCAtzxGm4LSoTSVTptoV9RbchnKPW9HxKtZumdyxyikZFDLhogJ5Uj/44\'/0\'/0\'/0/*)\",\"blockheight\":5000,\"label\":\"Test Label\"}"</span>;
- <span class="kw">let</span> <span class="ident">export</span> <span class="op">=</span> <span class="ident">WalletExport</span>::<span class="ident">from_str</span>(<span class="ident">import_str</span>).<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">descriptor</span>(), <span class="ident">descriptor</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">change_descriptor</span>(), <span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>.<span class="ident">into</span>()));
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">blockheight</span>, <span class="number">5000</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">export</span>.<span class="ident">label</span>, <span class="string">"Test Label"</span>);
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/wallet/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100"> 100</span>
-<span id="101"> 101</span>
-<span id="102"> 102</span>
-<span id="103"> 103</span>
-<span id="104"> 104</span>
-<span id="105"> 105</span>
-<span id="106"> 106</span>
-<span id="107"> 107</span>
-<span id="108"> 108</span>
-<span id="109"> 109</span>
-<span id="110"> 110</span>
-<span id="111"> 111</span>
-<span id="112"> 112</span>
-<span id="113"> 113</span>
-<span id="114"> 114</span>
-<span id="115"> 115</span>
-<span id="116"> 116</span>
-<span id="117"> 117</span>
-<span id="118"> 118</span>
-<span id="119"> 119</span>
-<span id="120"> 120</span>
-<span id="121"> 121</span>
-<span id="122"> 122</span>
-<span id="123"> 123</span>
-<span id="124"> 124</span>
-<span id="125"> 125</span>
-<span id="126"> 126</span>
-<span id="127"> 127</span>
-<span id="128"> 128</span>
-<span id="129"> 129</span>
-<span id="130"> 130</span>
-<span id="131"> 131</span>
-<span id="132"> 132</span>
-<span id="133"> 133</span>
-<span id="134"> 134</span>
-<span id="135"> 135</span>
-<span id="136"> 136</span>
-<span id="137"> 137</span>
-<span id="138"> 138</span>
-<span id="139"> 139</span>
-<span id="140"> 140</span>
-<span id="141"> 141</span>
-<span id="142"> 142</span>
-<span id="143"> 143</span>
-<span id="144"> 144</span>
-<span id="145"> 145</span>
-<span id="146"> 146</span>
-<span id="147"> 147</span>
-<span id="148"> 148</span>
-<span id="149"> 149</span>
-<span id="150"> 150</span>
-<span id="151"> 151</span>
-<span id="152"> 152</span>
-<span id="153"> 153</span>
-<span id="154"> 154</span>
-<span id="155"> 155</span>
-<span id="156"> 156</span>
-<span id="157"> 157</span>
-<span id="158"> 158</span>
-<span id="159"> 159</span>
-<span id="160"> 160</span>
-<span id="161"> 161</span>
-<span id="162"> 162</span>
-<span id="163"> 163</span>
-<span id="164"> 164</span>
-<span id="165"> 165</span>
-<span id="166"> 166</span>
-<span id="167"> 167</span>
-<span id="168"> 168</span>
-<span id="169"> 169</span>
-<span id="170"> 170</span>
-<span id="171"> 171</span>
-<span id="172"> 172</span>
-<span id="173"> 173</span>
-<span id="174"> 174</span>
-<span id="175"> 175</span>
-<span id="176"> 176</span>
-<span id="177"> 177</span>
-<span id="178"> 178</span>
-<span id="179"> 179</span>
-<span id="180"> 180</span>
-<span id="181"> 181</span>
-<span id="182"> 182</span>
-<span id="183"> 183</span>
-<span id="184"> 184</span>
-<span id="185"> 185</span>
-<span id="186"> 186</span>
-<span id="187"> 187</span>
-<span id="188"> 188</span>
-<span id="189"> 189</span>
-<span id="190"> 190</span>
-<span id="191"> 191</span>
-<span id="192"> 192</span>
-<span id="193"> 193</span>
-<span id="194"> 194</span>
-<span id="195"> 195</span>
-<span id="196"> 196</span>
-<span id="197"> 197</span>
-<span id="198"> 198</span>
-<span id="199"> 199</span>
-<span id="200"> 200</span>
-<span id="201"> 201</span>
-<span id="202"> 202</span>
-<span id="203"> 203</span>
-<span id="204"> 204</span>
-<span id="205"> 205</span>
-<span id="206"> 206</span>
-<span id="207"> 207</span>
-<span id="208"> 208</span>
-<span id="209"> 209</span>
-<span id="210"> 210</span>
-<span id="211"> 211</span>
-<span id="212"> 212</span>
-<span id="213"> 213</span>
-<span id="214"> 214</span>
-<span id="215"> 215</span>
-<span id="216"> 216</span>
-<span id="217"> 217</span>
-<span id="218"> 218</span>
-<span id="219"> 219</span>
-<span id="220"> 220</span>
-<span id="221"> 221</span>
-<span id="222"> 222</span>
-<span id="223"> 223</span>
-<span id="224"> 224</span>
-<span id="225"> 225</span>
-<span id="226"> 226</span>
-<span id="227"> 227</span>
-<span id="228"> 228</span>
-<span id="229"> 229</span>
-<span id="230"> 230</span>
-<span id="231"> 231</span>
-<span id="232"> 232</span>
-<span id="233"> 233</span>
-<span id="234"> 234</span>
-<span id="235"> 235</span>
-<span id="236"> 236</span>
-<span id="237"> 237</span>
-<span id="238"> 238</span>
-<span id="239"> 239</span>
-<span id="240"> 240</span>
-<span id="241"> 241</span>
-<span id="242"> 242</span>
-<span id="243"> 243</span>
-<span id="244"> 244</span>
-<span id="245"> 245</span>
-<span id="246"> 246</span>
-<span id="247"> 247</span>
-<span id="248"> 248</span>
-<span id="249"> 249</span>
-<span id="250"> 250</span>
-<span id="251"> 251</span>
-<span id="252"> 252</span>
-<span id="253"> 253</span>
-<span id="254"> 254</span>
-<span id="255"> 255</span>
-<span id="256"> 256</span>
-<span id="257"> 257</span>
-<span id="258"> 258</span>
-<span id="259"> 259</span>
-<span id="260"> 260</span>
-<span id="261"> 261</span>
-<span id="262"> 262</span>
-<span id="263"> 263</span>
-<span id="264"> 264</span>
-<span id="265"> 265</span>
-<span id="266"> 266</span>
-<span id="267"> 267</span>
-<span id="268"> 268</span>
-<span id="269"> 269</span>
-<span id="270"> 270</span>
-<span id="271"> 271</span>
-<span id="272"> 272</span>
-<span id="273"> 273</span>
-<span id="274"> 274</span>
-<span id="275"> 275</span>
-<span id="276"> 276</span>
-<span id="277"> 277</span>
-<span id="278"> 278</span>
-<span id="279"> 279</span>
-<span id="280"> 280</span>
-<span id="281"> 281</span>
-<span id="282"> 282</span>
-<span id="283"> 283</span>
-<span id="284"> 284</span>
-<span id="285"> 285</span>
-<span id="286"> 286</span>
-<span id="287"> 287</span>
-<span id="288"> 288</span>
-<span id="289"> 289</span>
-<span id="290"> 290</span>
-<span id="291"> 291</span>
-<span id="292"> 292</span>
-<span id="293"> 293</span>
-<span id="294"> 294</span>
-<span id="295"> 295</span>
-<span id="296"> 296</span>
-<span id="297"> 297</span>
-<span id="298"> 298</span>
-<span id="299"> 299</span>
-<span id="300"> 300</span>
-<span id="301"> 301</span>
-<span id="302"> 302</span>
-<span id="303"> 303</span>
-<span id="304"> 304</span>
-<span id="305"> 305</span>
-<span id="306"> 306</span>
-<span id="307"> 307</span>
-<span id="308"> 308</span>
-<span id="309"> 309</span>
-<span id="310"> 310</span>
-<span id="311"> 311</span>
-<span id="312"> 312</span>
-<span id="313"> 313</span>
-<span id="314"> 314</span>
-<span id="315"> 315</span>
-<span id="316"> 316</span>
-<span id="317"> 317</span>
-<span id="318"> 318</span>
-<span id="319"> 319</span>
-<span id="320"> 320</span>
-<span id="321"> 321</span>
-<span id="322"> 322</span>
-<span id="323"> 323</span>
-<span id="324"> 324</span>
-<span id="325"> 325</span>
-<span id="326"> 326</span>
-<span id="327"> 327</span>
-<span id="328"> 328</span>
-<span id="329"> 329</span>
-<span id="330"> 330</span>
-<span id="331"> 331</span>
-<span id="332"> 332</span>
-<span id="333"> 333</span>
-<span id="334"> 334</span>
-<span id="335"> 335</span>
-<span id="336"> 336</span>
-<span id="337"> 337</span>
-<span id="338"> 338</span>
-<span id="339"> 339</span>
-<span id="340"> 340</span>
-<span id="341"> 341</span>
-<span id="342"> 342</span>
-<span id="343"> 343</span>
-<span id="344"> 344</span>
-<span id="345"> 345</span>
-<span id="346"> 346</span>
-<span id="347"> 347</span>
-<span id="348"> 348</span>
-<span id="349"> 349</span>
-<span id="350"> 350</span>
-<span id="351"> 351</span>
-<span id="352"> 352</span>
-<span id="353"> 353</span>
-<span id="354"> 354</span>
-<span id="355"> 355</span>
-<span id="356"> 356</span>
-<span id="357"> 357</span>
-<span id="358"> 358</span>
-<span id="359"> 359</span>
-<span id="360"> 360</span>
-<span id="361"> 361</span>
-<span id="362"> 362</span>
-<span id="363"> 363</span>
-<span id="364"> 364</span>
-<span id="365"> 365</span>
-<span id="366"> 366</span>
-<span id="367"> 367</span>
-<span id="368"> 368</span>
-<span id="369"> 369</span>
-<span id="370"> 370</span>
-<span id="371"> 371</span>
-<span id="372"> 372</span>
-<span id="373"> 373</span>
-<span id="374"> 374</span>
-<span id="375"> 375</span>
-<span id="376"> 376</span>
-<span id="377"> 377</span>
-<span id="378"> 378</span>
-<span id="379"> 379</span>
-<span id="380"> 380</span>
-<span id="381"> 381</span>
-<span id="382"> 382</span>
-<span id="383"> 383</span>
-<span id="384"> 384</span>
-<span id="385"> 385</span>
-<span id="386"> 386</span>
-<span id="387"> 387</span>
-<span id="388"> 388</span>
-<span id="389"> 389</span>
-<span id="390"> 390</span>
-<span id="391"> 391</span>
-<span id="392"> 392</span>
-<span id="393"> 393</span>
-<span id="394"> 394</span>
-<span id="395"> 395</span>
-<span id="396"> 396</span>
-<span id="397"> 397</span>
-<span id="398"> 398</span>
-<span id="399"> 399</span>
-<span id="400"> 400</span>
-<span id="401"> 401</span>
-<span id="402"> 402</span>
-<span id="403"> 403</span>
-<span id="404"> 404</span>
-<span id="405"> 405</span>
-<span id="406"> 406</span>
-<span id="407"> 407</span>
-<span id="408"> 408</span>
-<span id="409"> 409</span>
-<span id="410"> 410</span>
-<span id="411"> 411</span>
-<span id="412"> 412</span>
-<span id="413"> 413</span>
-<span id="414"> 414</span>
-<span id="415"> 415</span>
-<span id="416"> 416</span>
-<span id="417"> 417</span>
-<span id="418"> 418</span>
-<span id="419"> 419</span>
-<span id="420"> 420</span>
-<span id="421"> 421</span>
-<span id="422"> 422</span>
-<span id="423"> 423</span>
-<span id="424"> 424</span>
-<span id="425"> 425</span>
-<span id="426"> 426</span>
-<span id="427"> 427</span>
-<span id="428"> 428</span>
-<span id="429"> 429</span>
-<span id="430"> 430</span>
-<span id="431"> 431</span>
-<span id="432"> 432</span>
-<span id="433"> 433</span>
-<span id="434"> 434</span>
-<span id="435"> 435</span>
-<span id="436"> 436</span>
-<span id="437"> 437</span>
-<span id="438"> 438</span>
-<span id="439"> 439</span>
-<span id="440"> 440</span>
-<span id="441"> 441</span>
-<span id="442"> 442</span>
-<span id="443"> 443</span>
-<span id="444"> 444</span>
-<span id="445"> 445</span>
-<span id="446"> 446</span>
-<span id="447"> 447</span>
-<span id="448"> 448</span>
-<span id="449"> 449</span>
-<span id="450"> 450</span>
-<span id="451"> 451</span>
-<span id="452"> 452</span>
-<span id="453"> 453</span>
-<span id="454"> 454</span>
-<span id="455"> 455</span>
-<span id="456"> 456</span>
-<span id="457"> 457</span>
-<span id="458"> 458</span>
-<span id="459"> 459</span>
-<span id="460"> 460</span>
-<span id="461"> 461</span>
-<span id="462"> 462</span>
-<span id="463"> 463</span>
-<span id="464"> 464</span>
-<span id="465"> 465</span>
-<span id="466"> 466</span>
-<span id="467"> 467</span>
-<span id="468"> 468</span>
-<span id="469"> 469</span>
-<span id="470"> 470</span>
-<span id="471"> 471</span>
-<span id="472"> 472</span>
-<span id="473"> 473</span>
-<span id="474"> 474</span>
-<span id="475"> 475</span>
-<span id="476"> 476</span>
-<span id="477"> 477</span>
-<span id="478"> 478</span>
-<span id="479"> 479</span>
-<span id="480"> 480</span>
-<span id="481"> 481</span>
-<span id="482"> 482</span>
-<span id="483"> 483</span>
-<span id="484"> 484</span>
-<span id="485"> 485</span>
-<span id="486"> 486</span>
-<span id="487"> 487</span>
-<span id="488"> 488</span>
-<span id="489"> 489</span>
-<span id="490"> 490</span>
-<span id="491"> 491</span>
-<span id="492"> 492</span>
-<span id="493"> 493</span>
-<span id="494"> 494</span>
-<span id="495"> 495</span>
-<span id="496"> 496</span>
-<span id="497"> 497</span>
-<span id="498"> 498</span>
-<span id="499"> 499</span>
-<span id="500"> 500</span>
-<span id="501"> 501</span>
-<span id="502"> 502</span>
-<span id="503"> 503</span>
-<span id="504"> 504</span>
-<span id="505"> 505</span>
-<span id="506"> 506</span>
-<span id="507"> 507</span>
-<span id="508"> 508</span>
-<span id="509"> 509</span>
-<span id="510"> 510</span>
-<span id="511"> 511</span>
-<span id="512"> 512</span>
-<span id="513"> 513</span>
-<span id="514"> 514</span>
-<span id="515"> 515</span>
-<span id="516"> 516</span>
-<span id="517"> 517</span>
-<span id="518"> 518</span>
-<span id="519"> 519</span>
-<span id="520"> 520</span>
-<span id="521"> 521</span>
-<span id="522"> 522</span>
-<span id="523"> 523</span>
-<span id="524"> 524</span>
-<span id="525"> 525</span>
-<span id="526"> 526</span>
-<span id="527"> 527</span>
-<span id="528"> 528</span>
-<span id="529"> 529</span>
-<span id="530"> 530</span>
-<span id="531"> 531</span>
-<span id="532"> 532</span>
-<span id="533"> 533</span>
-<span id="534"> 534</span>
-<span id="535"> 535</span>
-<span id="536"> 536</span>
-<span id="537"> 537</span>
-<span id="538"> 538</span>
-<span id="539"> 539</span>
-<span id="540"> 540</span>
-<span id="541"> 541</span>
-<span id="542"> 542</span>
-<span id="543"> 543</span>
-<span id="544"> 544</span>
-<span id="545"> 545</span>
-<span id="546"> 546</span>
-<span id="547"> 547</span>
-<span id="548"> 548</span>
-<span id="549"> 549</span>
-<span id="550"> 550</span>
-<span id="551"> 551</span>
-<span id="552"> 552</span>
-<span id="553"> 553</span>
-<span id="554"> 554</span>
-<span id="555"> 555</span>
-<span id="556"> 556</span>
-<span id="557"> 557</span>
-<span id="558"> 558</span>
-<span id="559"> 559</span>
-<span id="560"> 560</span>
-<span id="561"> 561</span>
-<span id="562"> 562</span>
-<span id="563"> 563</span>
-<span id="564"> 564</span>
-<span id="565"> 565</span>
-<span id="566"> 566</span>
-<span id="567"> 567</span>
-<span id="568"> 568</span>
-<span id="569"> 569</span>
-<span id="570"> 570</span>
-<span id="571"> 571</span>
-<span id="572"> 572</span>
-<span id="573"> 573</span>
-<span id="574"> 574</span>
-<span id="575"> 575</span>
-<span id="576"> 576</span>
-<span id="577"> 577</span>
-<span id="578"> 578</span>
-<span id="579"> 579</span>
-<span id="580"> 580</span>
-<span id="581"> 581</span>
-<span id="582"> 582</span>
-<span id="583"> 583</span>
-<span id="584"> 584</span>
-<span id="585"> 585</span>
-<span id="586"> 586</span>
-<span id="587"> 587</span>
-<span id="588"> 588</span>
-<span id="589"> 589</span>
-<span id="590"> 590</span>
-<span id="591"> 591</span>
-<span id="592"> 592</span>
-<span id="593"> 593</span>
-<span id="594"> 594</span>
-<span id="595"> 595</span>
-<span id="596"> 596</span>
-<span id="597"> 597</span>
-<span id="598"> 598</span>
-<span id="599"> 599</span>
-<span id="600"> 600</span>
-<span id="601"> 601</span>
-<span id="602"> 602</span>
-<span id="603"> 603</span>
-<span id="604"> 604</span>
-<span id="605"> 605</span>
-<span id="606"> 606</span>
-<span id="607"> 607</span>
-<span id="608"> 608</span>
-<span id="609"> 609</span>
-<span id="610"> 610</span>
-<span id="611"> 611</span>
-<span id="612"> 612</span>
-<span id="613"> 613</span>
-<span id="614"> 614</span>
-<span id="615"> 615</span>
-<span id="616"> 616</span>
-<span id="617"> 617</span>
-<span id="618"> 618</span>
-<span id="619"> 619</span>
-<span id="620"> 620</span>
-<span id="621"> 621</span>
-<span id="622"> 622</span>
-<span id="623"> 623</span>
-<span id="624"> 624</span>
-<span id="625"> 625</span>
-<span id="626"> 626</span>
-<span id="627"> 627</span>
-<span id="628"> 628</span>
-<span id="629"> 629</span>
-<span id="630"> 630</span>
-<span id="631"> 631</span>
-<span id="632"> 632</span>
-<span id="633"> 633</span>
-<span id="634"> 634</span>
-<span id="635"> 635</span>
-<span id="636"> 636</span>
-<span id="637"> 637</span>
-<span id="638"> 638</span>
-<span id="639"> 639</span>
-<span id="640"> 640</span>
-<span id="641"> 641</span>
-<span id="642"> 642</span>
-<span id="643"> 643</span>
-<span id="644"> 644</span>
-<span id="645"> 645</span>
-<span id="646"> 646</span>
-<span id="647"> 647</span>
-<span id="648"> 648</span>
-<span id="649"> 649</span>
-<span id="650"> 650</span>
-<span id="651"> 651</span>
-<span id="652"> 652</span>
-<span id="653"> 653</span>
-<span id="654"> 654</span>
-<span id="655"> 655</span>
-<span id="656"> 656</span>
-<span id="657"> 657</span>
-<span id="658"> 658</span>
-<span id="659"> 659</span>
-<span id="660"> 660</span>
-<span id="661"> 661</span>
-<span id="662"> 662</span>
-<span id="663"> 663</span>
-<span id="664"> 664</span>
-<span id="665"> 665</span>
-<span id="666"> 666</span>
-<span id="667"> 667</span>
-<span id="668"> 668</span>
-<span id="669"> 669</span>
-<span id="670"> 670</span>
-<span id="671"> 671</span>
-<span id="672"> 672</span>
-<span id="673"> 673</span>
-<span id="674"> 674</span>
-<span id="675"> 675</span>
-<span id="676"> 676</span>
-<span id="677"> 677</span>
-<span id="678"> 678</span>
-<span id="679"> 679</span>
-<span id="680"> 680</span>
-<span id="681"> 681</span>
-<span id="682"> 682</span>
-<span id="683"> 683</span>
-<span id="684"> 684</span>
-<span id="685"> 685</span>
-<span id="686"> 686</span>
-<span id="687"> 687</span>
-<span id="688"> 688</span>
-<span id="689"> 689</span>
-<span id="690"> 690</span>
-<span id="691"> 691</span>
-<span id="692"> 692</span>
-<span id="693"> 693</span>
-<span id="694"> 694</span>
-<span id="695"> 695</span>
-<span id="696"> 696</span>
-<span id="697"> 697</span>
-<span id="698"> 698</span>
-<span id="699"> 699</span>
-<span id="700"> 700</span>
-<span id="701"> 701</span>
-<span id="702"> 702</span>
-<span id="703"> 703</span>
-<span id="704"> 704</span>
-<span id="705"> 705</span>
-<span id="706"> 706</span>
-<span id="707"> 707</span>
-<span id="708"> 708</span>
-<span id="709"> 709</span>
-<span id="710"> 710</span>
-<span id="711"> 711</span>
-<span id="712"> 712</span>
-<span id="713"> 713</span>
-<span id="714"> 714</span>
-<span id="715"> 715</span>
-<span id="716"> 716</span>
-<span id="717"> 717</span>
-<span id="718"> 718</span>
-<span id="719"> 719</span>
-<span id="720"> 720</span>
-<span id="721"> 721</span>
-<span id="722"> 722</span>
-<span id="723"> 723</span>
-<span id="724"> 724</span>
-<span id="725"> 725</span>
-<span id="726"> 726</span>
-<span id="727"> 727</span>
-<span id="728"> 728</span>
-<span id="729"> 729</span>
-<span id="730"> 730</span>
-<span id="731"> 731</span>
-<span id="732"> 732</span>
-<span id="733"> 733</span>
-<span id="734"> 734</span>
-<span id="735"> 735</span>
-<span id="736"> 736</span>
-<span id="737"> 737</span>
-<span id="738"> 738</span>
-<span id="739"> 739</span>
-<span id="740"> 740</span>
-<span id="741"> 741</span>
-<span id="742"> 742</span>
-<span id="743"> 743</span>
-<span id="744"> 744</span>
-<span id="745"> 745</span>
-<span id="746"> 746</span>
-<span id="747"> 747</span>
-<span id="748"> 748</span>
-<span id="749"> 749</span>
-<span id="750"> 750</span>
-<span id="751"> 751</span>
-<span id="752"> 752</span>
-<span id="753"> 753</span>
-<span id="754"> 754</span>
-<span id="755"> 755</span>
-<span id="756"> 756</span>
-<span id="757"> 757</span>
-<span id="758"> 758</span>
-<span id="759"> 759</span>
-<span id="760"> 760</span>
-<span id="761"> 761</span>
-<span id="762"> 762</span>
-<span id="763"> 763</span>
-<span id="764"> 764</span>
-<span id="765"> 765</span>
-<span id="766"> 766</span>
-<span id="767"> 767</span>
-<span id="768"> 768</span>
-<span id="769"> 769</span>
-<span id="770"> 770</span>
-<span id="771"> 771</span>
-<span id="772"> 772</span>
-<span id="773"> 773</span>
-<span id="774"> 774</span>
-<span id="775"> 775</span>
-<span id="776"> 776</span>
-<span id="777"> 777</span>
-<span id="778"> 778</span>
-<span id="779"> 779</span>
-<span id="780"> 780</span>
-<span id="781"> 781</span>
-<span id="782"> 782</span>
-<span id="783"> 783</span>
-<span id="784"> 784</span>
-<span id="785"> 785</span>
-<span id="786"> 786</span>
-<span id="787"> 787</span>
-<span id="788"> 788</span>
-<span id="789"> 789</span>
-<span id="790"> 790</span>
-<span id="791"> 791</span>
-<span id="792"> 792</span>
-<span id="793"> 793</span>
-<span id="794"> 794</span>
-<span id="795"> 795</span>
-<span id="796"> 796</span>
-<span id="797"> 797</span>
-<span id="798"> 798</span>
-<span id="799"> 799</span>
-<span id="800"> 800</span>
-<span id="801"> 801</span>
-<span id="802"> 802</span>
-<span id="803"> 803</span>
-<span id="804"> 804</span>
-<span id="805"> 805</span>
-<span id="806"> 806</span>
-<span id="807"> 807</span>
-<span id="808"> 808</span>
-<span id="809"> 809</span>
-<span id="810"> 810</span>
-<span id="811"> 811</span>
-<span id="812"> 812</span>
-<span id="813"> 813</span>
-<span id="814"> 814</span>
-<span id="815"> 815</span>
-<span id="816"> 816</span>
-<span id="817"> 817</span>
-<span id="818"> 818</span>
-<span id="819"> 819</span>
-<span id="820"> 820</span>
-<span id="821"> 821</span>
-<span id="822"> 822</span>
-<span id="823"> 823</span>
-<span id="824"> 824</span>
-<span id="825"> 825</span>
-<span id="826"> 826</span>
-<span id="827"> 827</span>
-<span id="828"> 828</span>
-<span id="829"> 829</span>
-<span id="830"> 830</span>
-<span id="831"> 831</span>
-<span id="832"> 832</span>
-<span id="833"> 833</span>
-<span id="834"> 834</span>
-<span id="835"> 835</span>
-<span id="836"> 836</span>
-<span id="837"> 837</span>
-<span id="838"> 838</span>
-<span id="839"> 839</span>
-<span id="840"> 840</span>
-<span id="841"> 841</span>
-<span id="842"> 842</span>
-<span id="843"> 843</span>
-<span id="844"> 844</span>
-<span id="845"> 845</span>
-<span id="846"> 846</span>
-<span id="847"> 847</span>
-<span id="848"> 848</span>
-<span id="849"> 849</span>
-<span id="850"> 850</span>
-<span id="851"> 851</span>
-<span id="852"> 852</span>
-<span id="853"> 853</span>
-<span id="854"> 854</span>
-<span id="855"> 855</span>
-<span id="856"> 856</span>
-<span id="857"> 857</span>
-<span id="858"> 858</span>
-<span id="859"> 859</span>
-<span id="860"> 860</span>
-<span id="861"> 861</span>
-<span id="862"> 862</span>
-<span id="863"> 863</span>
-<span id="864"> 864</span>
-<span id="865"> 865</span>
-<span id="866"> 866</span>
-<span id="867"> 867</span>
-<span id="868"> 868</span>
-<span id="869"> 869</span>
-<span id="870"> 870</span>
-<span id="871"> 871</span>
-<span id="872"> 872</span>
-<span id="873"> 873</span>
-<span id="874"> 874</span>
-<span id="875"> 875</span>
-<span id="876"> 876</span>
-<span id="877"> 877</span>
-<span id="878"> 878</span>
-<span id="879"> 879</span>
-<span id="880"> 880</span>
-<span id="881"> 881</span>
-<span id="882"> 882</span>
-<span id="883"> 883</span>
-<span id="884"> 884</span>
-<span id="885"> 885</span>
-<span id="886"> 886</span>
-<span id="887"> 887</span>
-<span id="888"> 888</span>
-<span id="889"> 889</span>
-<span id="890"> 890</span>
-<span id="891"> 891</span>
-<span id="892"> 892</span>
-<span id="893"> 893</span>
-<span id="894"> 894</span>
-<span id="895"> 895</span>
-<span id="896"> 896</span>
-<span id="897"> 897</span>
-<span id="898"> 898</span>
-<span id="899"> 899</span>
-<span id="900"> 900</span>
-<span id="901"> 901</span>
-<span id="902"> 902</span>
-<span id="903"> 903</span>
-<span id="904"> 904</span>
-<span id="905"> 905</span>
-<span id="906"> 906</span>
-<span id="907"> 907</span>
-<span id="908"> 908</span>
-<span id="909"> 909</span>
-<span id="910"> 910</span>
-<span id="911"> 911</span>
-<span id="912"> 912</span>
-<span id="913"> 913</span>
-<span id="914"> 914</span>
-<span id="915"> 915</span>
-<span id="916"> 916</span>
-<span id="917"> 917</span>
-<span id="918"> 918</span>
-<span id="919"> 919</span>
-<span id="920"> 920</span>
-<span id="921"> 921</span>
-<span id="922"> 922</span>
-<span id="923"> 923</span>
-<span id="924"> 924</span>
-<span id="925"> 925</span>
-<span id="926"> 926</span>
-<span id="927"> 927</span>
-<span id="928"> 928</span>
-<span id="929"> 929</span>
-<span id="930"> 930</span>
-<span id="931"> 931</span>
-<span id="932"> 932</span>
-<span id="933"> 933</span>
-<span id="934"> 934</span>
-<span id="935"> 935</span>
-<span id="936"> 936</span>
-<span id="937"> 937</span>
-<span id="938"> 938</span>
-<span id="939"> 939</span>
-<span id="940"> 940</span>
-<span id="941"> 941</span>
-<span id="942"> 942</span>
-<span id="943"> 943</span>
-<span id="944"> 944</span>
-<span id="945"> 945</span>
-<span id="946"> 946</span>
-<span id="947"> 947</span>
-<span id="948"> 948</span>
-<span id="949"> 949</span>
-<span id="950"> 950</span>
-<span id="951"> 951</span>
-<span id="952"> 952</span>
-<span id="953"> 953</span>
-<span id="954"> 954</span>
-<span id="955"> 955</span>
-<span id="956"> 956</span>
-<span id="957"> 957</span>
-<span id="958"> 958</span>
-<span id="959"> 959</span>
-<span id="960"> 960</span>
-<span id="961"> 961</span>
-<span id="962"> 962</span>
-<span id="963"> 963</span>
-<span id="964"> 964</span>
-<span id="965"> 965</span>
-<span id="966"> 966</span>
-<span id="967"> 967</span>
-<span id="968"> 968</span>
-<span id="969"> 969</span>
-<span id="970"> 970</span>
-<span id="971"> 971</span>
-<span id="972"> 972</span>
-<span id="973"> 973</span>
-<span id="974"> 974</span>
-<span id="975"> 975</span>
-<span id="976"> 976</span>
-<span id="977"> 977</span>
-<span id="978"> 978</span>
-<span id="979"> 979</span>
-<span id="980"> 980</span>
-<span id="981"> 981</span>
-<span id="982"> 982</span>
-<span id="983"> 983</span>
-<span id="984"> 984</span>
-<span id="985"> 985</span>
-<span id="986"> 986</span>
-<span id="987"> 987</span>
-<span id="988"> 988</span>
-<span id="989"> 989</span>
-<span id="990"> 990</span>
-<span id="991"> 991</span>
-<span id="992"> 992</span>
-<span id="993"> 993</span>
-<span id="994"> 994</span>
-<span id="995"> 995</span>
-<span id="996"> 996</span>
-<span id="997"> 997</span>
-<span id="998"> 998</span>
-<span id="999"> 999</span>
-<span id="1000">1000</span>
-<span id="1001">1001</span>
-<span id="1002">1002</span>
-<span id="1003">1003</span>
-<span id="1004">1004</span>
-<span id="1005">1005</span>
-<span id="1006">1006</span>
-<span id="1007">1007</span>
-<span id="1008">1008</span>
-<span id="1009">1009</span>
-<span id="1010">1010</span>
-<span id="1011">1011</span>
-<span id="1012">1012</span>
-<span id="1013">1013</span>
-<span id="1014">1014</span>
-<span id="1015">1015</span>
-<span id="1016">1016</span>
-<span id="1017">1017</span>
-<span id="1018">1018</span>
-<span id="1019">1019</span>
-<span id="1020">1020</span>
-<span id="1021">1021</span>
-<span id="1022">1022</span>
-<span id="1023">1023</span>
-<span id="1024">1024</span>
-<span id="1025">1025</span>
-<span id="1026">1026</span>
-<span id="1027">1027</span>
-<span id="1028">1028</span>
-<span id="1029">1029</span>
-<span id="1030">1030</span>
-<span id="1031">1031</span>
-<span id="1032">1032</span>
-<span id="1033">1033</span>
-<span id="1034">1034</span>
-<span id="1035">1035</span>
-<span id="1036">1036</span>
-<span id="1037">1037</span>
-<span id="1038">1038</span>
-<span id="1039">1039</span>
-<span id="1040">1040</span>
-<span id="1041">1041</span>
-<span id="1042">1042</span>
-<span id="1043">1043</span>
-<span id="1044">1044</span>
-<span id="1045">1045</span>
-<span id="1046">1046</span>
-<span id="1047">1047</span>
-<span id="1048">1048</span>
-<span id="1049">1049</span>
-<span id="1050">1050</span>
-<span id="1051">1051</span>
-<span id="1052">1052</span>
-<span id="1053">1053</span>
-<span id="1054">1054</span>
-<span id="1055">1055</span>
-<span id="1056">1056</span>
-<span id="1057">1057</span>
-<span id="1058">1058</span>
-<span id="1059">1059</span>
-<span id="1060">1060</span>
-<span id="1061">1061</span>
-<span id="1062">1062</span>
-<span id="1063">1063</span>
-<span id="1064">1064</span>
-<span id="1065">1065</span>
-<span id="1066">1066</span>
-<span id="1067">1067</span>
-<span id="1068">1068</span>
-<span id="1069">1069</span>
-<span id="1070">1070</span>
-<span id="1071">1071</span>
-<span id="1072">1072</span>
-<span id="1073">1073</span>
-<span id="1074">1074</span>
-<span id="1075">1075</span>
-<span id="1076">1076</span>
-<span id="1077">1077</span>
-<span id="1078">1078</span>
-<span id="1079">1079</span>
-<span id="1080">1080</span>
-<span id="1081">1081</span>
-<span id="1082">1082</span>
-<span id="1083">1083</span>
-<span id="1084">1084</span>
-<span id="1085">1085</span>
-<span id="1086">1086</span>
-<span id="1087">1087</span>
-<span id="1088">1088</span>
-<span id="1089">1089</span>
-<span id="1090">1090</span>
-<span id="1091">1091</span>
-<span id="1092">1092</span>
-<span id="1093">1093</span>
-<span id="1094">1094</span>
-<span id="1095">1095</span>
-<span id="1096">1096</span>
-<span id="1097">1097</span>
-<span id="1098">1098</span>
-<span id="1099">1099</span>
-<span id="1100">1100</span>
-<span id="1101">1101</span>
-<span id="1102">1102</span>
-<span id="1103">1103</span>
-<span id="1104">1104</span>
-<span id="1105">1105</span>
-<span id="1106">1106</span>
-<span id="1107">1107</span>
-<span id="1108">1108</span>
-<span id="1109">1109</span>
-<span id="1110">1110</span>
-<span id="1111">1111</span>
-<span id="1112">1112</span>
-<span id="1113">1113</span>
-<span id="1114">1114</span>
-<span id="1115">1115</span>
-<span id="1116">1116</span>
-<span id="1117">1117</span>
-<span id="1118">1118</span>
-<span id="1119">1119</span>
-<span id="1120">1120</span>
-<span id="1121">1121</span>
-<span id="1122">1122</span>
-<span id="1123">1123</span>
-<span id="1124">1124</span>
-<span id="1125">1125</span>
-<span id="1126">1126</span>
-<span id="1127">1127</span>
-<span id="1128">1128</span>
-<span id="1129">1129</span>
-<span id="1130">1130</span>
-<span id="1131">1131</span>
-<span id="1132">1132</span>
-<span id="1133">1133</span>
-<span id="1134">1134</span>
-<span id="1135">1135</span>
-<span id="1136">1136</span>
-<span id="1137">1137</span>
-<span id="1138">1138</span>
-<span id="1139">1139</span>
-<span id="1140">1140</span>
-<span id="1141">1141</span>
-<span id="1142">1142</span>
-<span id="1143">1143</span>
-<span id="1144">1144</span>
-<span id="1145">1145</span>
-<span id="1146">1146</span>
-<span id="1147">1147</span>
-<span id="1148">1148</span>
-<span id="1149">1149</span>
-<span id="1150">1150</span>
-<span id="1151">1151</span>
-<span id="1152">1152</span>
-<span id="1153">1153</span>
-<span id="1154">1154</span>
-<span id="1155">1155</span>
-<span id="1156">1156</span>
-<span id="1157">1157</span>
-<span id="1158">1158</span>
-<span id="1159">1159</span>
-<span id="1160">1160</span>
-<span id="1161">1161</span>
-<span id="1162">1162</span>
-<span id="1163">1163</span>
-<span id="1164">1164</span>
-<span id="1165">1165</span>
-<span id="1166">1166</span>
-<span id="1167">1167</span>
-<span id="1168">1168</span>
-<span id="1169">1169</span>
-<span id="1170">1170</span>
-<span id="1171">1171</span>
-<span id="1172">1172</span>
-<span id="1173">1173</span>
-<span id="1174">1174</span>
-<span id="1175">1175</span>
-<span id="1176">1176</span>
-<span id="1177">1177</span>
-<span id="1178">1178</span>
-<span id="1179">1179</span>
-<span id="1180">1180</span>
-<span id="1181">1181</span>
-<span id="1182">1182</span>
-<span id="1183">1183</span>
-<span id="1184">1184</span>
-<span id="1185">1185</span>
-<span id="1186">1186</span>
-<span id="1187">1187</span>
-<span id="1188">1188</span>
-<span id="1189">1189</span>
-<span id="1190">1190</span>
-<span id="1191">1191</span>
-<span id="1192">1192</span>
-<span id="1193">1193</span>
-<span id="1194">1194</span>
-<span id="1195">1195</span>
-<span id="1196">1196</span>
-<span id="1197">1197</span>
-<span id="1198">1198</span>
-<span id="1199">1199</span>
-<span id="1200">1200</span>
-<span id="1201">1201</span>
-<span id="1202">1202</span>
-<span id="1203">1203</span>
-<span id="1204">1204</span>
-<span id="1205">1205</span>
-<span id="1206">1206</span>
-<span id="1207">1207</span>
-<span id="1208">1208</span>
-<span id="1209">1209</span>
-<span id="1210">1210</span>
-<span id="1211">1211</span>
-<span id="1212">1212</span>
-<span id="1213">1213</span>
-<span id="1214">1214</span>
-<span id="1215">1215</span>
-<span id="1216">1216</span>
-<span id="1217">1217</span>
-<span id="1218">1218</span>
-<span id="1219">1219</span>
-<span id="1220">1220</span>
-<span id="1221">1221</span>
-<span id="1222">1222</span>
-<span id="1223">1223</span>
-<span id="1224">1224</span>
-<span id="1225">1225</span>
-<span id="1226">1226</span>
-<span id="1227">1227</span>
-<span id="1228">1228</span>
-<span id="1229">1229</span>
-<span id="1230">1230</span>
-<span id="1231">1231</span>
-<span id="1232">1232</span>
-<span id="1233">1233</span>
-<span id="1234">1234</span>
-<span id="1235">1235</span>
-<span id="1236">1236</span>
-<span id="1237">1237</span>
-<span id="1238">1238</span>
-<span id="1239">1239</span>
-<span id="1240">1240</span>
-<span id="1241">1241</span>
-<span id="1242">1242</span>
-<span id="1243">1243</span>
-<span id="1244">1244</span>
-<span id="1245">1245</span>
-<span id="1246">1246</span>
-<span id="1247">1247</span>
-<span id="1248">1248</span>
-<span id="1249">1249</span>
-<span id="1250">1250</span>
-<span id="1251">1251</span>
-<span id="1252">1252</span>
-<span id="1253">1253</span>
-<span id="1254">1254</span>
-<span id="1255">1255</span>
-<span id="1256">1256</span>
-<span id="1257">1257</span>
-<span id="1258">1258</span>
-<span id="1259">1259</span>
-<span id="1260">1260</span>
-<span id="1261">1261</span>
-<span id="1262">1262</span>
-<span id="1263">1263</span>
-<span id="1264">1264</span>
-<span id="1265">1265</span>
-<span id="1266">1266</span>
-<span id="1267">1267</span>
-<span id="1268">1268</span>
-<span id="1269">1269</span>
-<span id="1270">1270</span>
-<span id="1271">1271</span>
-<span id="1272">1272</span>
-<span id="1273">1273</span>
-<span id="1274">1274</span>
-<span id="1275">1275</span>
-<span id="1276">1276</span>
-<span id="1277">1277</span>
-<span id="1278">1278</span>
-<span id="1279">1279</span>
-<span id="1280">1280</span>
-<span id="1281">1281</span>
-<span id="1282">1282</span>
-<span id="1283">1283</span>
-<span id="1284">1284</span>
-<span id="1285">1285</span>
-<span id="1286">1286</span>
-<span id="1287">1287</span>
-<span id="1288">1288</span>
-<span id="1289">1289</span>
-<span id="1290">1290</span>
-<span id="1291">1291</span>
-<span id="1292">1292</span>
-<span id="1293">1293</span>
-<span id="1294">1294</span>
-<span id="1295">1295</span>
-<span id="1296">1296</span>
-<span id="1297">1297</span>
-<span id="1298">1298</span>
-<span id="1299">1299</span>
-<span id="1300">1300</span>
-<span id="1301">1301</span>
-<span id="1302">1302</span>
-<span id="1303">1303</span>
-<span id="1304">1304</span>
-<span id="1305">1305</span>
-<span id="1306">1306</span>
-<span id="1307">1307</span>
-<span id="1308">1308</span>
-<span id="1309">1309</span>
-<span id="1310">1310</span>
-<span id="1311">1311</span>
-<span id="1312">1312</span>
-<span id="1313">1313</span>
-<span id="1314">1314</span>
-<span id="1315">1315</span>
-<span id="1316">1316</span>
-<span id="1317">1317</span>
-<span id="1318">1318</span>
-<span id="1319">1319</span>
-<span id="1320">1320</span>
-<span id="1321">1321</span>
-<span id="1322">1322</span>
-<span id="1323">1323</span>
-<span id="1324">1324</span>
-<span id="1325">1325</span>
-<span id="1326">1326</span>
-<span id="1327">1327</span>
-<span id="1328">1328</span>
-<span id="1329">1329</span>
-<span id="1330">1330</span>
-<span id="1331">1331</span>
-<span id="1332">1332</span>
-<span id="1333">1333</span>
-<span id="1334">1334</span>
-<span id="1335">1335</span>
-<span id="1336">1336</span>
-<span id="1337">1337</span>
-<span id="1338">1338</span>
-<span id="1339">1339</span>
-<span id="1340">1340</span>
-<span id="1341">1341</span>
-<span id="1342">1342</span>
-<span id="1343">1343</span>
-<span id="1344">1344</span>
-<span id="1345">1345</span>
-<span id="1346">1346</span>
-<span id="1347">1347</span>
-<span id="1348">1348</span>
-<span id="1349">1349</span>
-<span id="1350">1350</span>
-<span id="1351">1351</span>
-<span id="1352">1352</span>
-<span id="1353">1353</span>
-<span id="1354">1354</span>
-<span id="1355">1355</span>
-<span id="1356">1356</span>
-<span id="1357">1357</span>
-<span id="1358">1358</span>
-<span id="1359">1359</span>
-<span id="1360">1360</span>
-<span id="1361">1361</span>
-<span id="1362">1362</span>
-<span id="1363">1363</span>
-<span id="1364">1364</span>
-<span id="1365">1365</span>
-<span id="1366">1366</span>
-<span id="1367">1367</span>
-<span id="1368">1368</span>
-<span id="1369">1369</span>
-<span id="1370">1370</span>
-<span id="1371">1371</span>
-<span id="1372">1372</span>
-<span id="1373">1373</span>
-<span id="1374">1374</span>
-<span id="1375">1375</span>
-<span id="1376">1376</span>
-<span id="1377">1377</span>
-<span id="1378">1378</span>
-<span id="1379">1379</span>
-<span id="1380">1380</span>
-<span id="1381">1381</span>
-<span id="1382">1382</span>
-<span id="1383">1383</span>
-<span id="1384">1384</span>
-<span id="1385">1385</span>
-<span id="1386">1386</span>
-<span id="1387">1387</span>
-<span id="1388">1388</span>
-<span id="1389">1389</span>
-<span id="1390">1390</span>
-<span id="1391">1391</span>
-<span id="1392">1392</span>
-<span id="1393">1393</span>
-<span id="1394">1394</span>
-<span id="1395">1395</span>
-<span id="1396">1396</span>
-<span id="1397">1397</span>
-<span id="1398">1398</span>
-<span id="1399">1399</span>
-<span id="1400">1400</span>
-<span id="1401">1401</span>
-<span id="1402">1402</span>
-<span id="1403">1403</span>
-<span id="1404">1404</span>
-<span id="1405">1405</span>
-<span id="1406">1406</span>
-<span id="1407">1407</span>
-<span id="1408">1408</span>
-<span id="1409">1409</span>
-<span id="1410">1410</span>
-<span id="1411">1411</span>
-<span id="1412">1412</span>
-<span id="1413">1413</span>
-<span id="1414">1414</span>
-<span id="1415">1415</span>
-<span id="1416">1416</span>
-<span id="1417">1417</span>
-<span id="1418">1418</span>
-<span id="1419">1419</span>
-<span id="1420">1420</span>
-<span id="1421">1421</span>
-<span id="1422">1422</span>
-<span id="1423">1423</span>
-<span id="1424">1424</span>
-<span id="1425">1425</span>
-<span id="1426">1426</span>
-<span id="1427">1427</span>
-<span id="1428">1428</span>
-<span id="1429">1429</span>
-<span id="1430">1430</span>
-<span id="1431">1431</span>
-<span id="1432">1432</span>
-<span id="1433">1433</span>
-<span id="1434">1434</span>
-<span id="1435">1435</span>
-<span id="1436">1436</span>
-<span id="1437">1437</span>
-<span id="1438">1438</span>
-<span id="1439">1439</span>
-<span id="1440">1440</span>
-<span id="1441">1441</span>
-<span id="1442">1442</span>
-<span id="1443">1443</span>
-<span id="1444">1444</span>
-<span id="1445">1445</span>
-<span id="1446">1446</span>
-<span id="1447">1447</span>
-<span id="1448">1448</span>
-<span id="1449">1449</span>
-<span id="1450">1450</span>
-<span id="1451">1451</span>
-<span id="1452">1452</span>
-<span id="1453">1453</span>
-<span id="1454">1454</span>
-<span id="1455">1455</span>
-<span id="1456">1456</span>
-<span id="1457">1457</span>
-<span id="1458">1458</span>
-<span id="1459">1459</span>
-<span id="1460">1460</span>
-<span id="1461">1461</span>
-<span id="1462">1462</span>
-<span id="1463">1463</span>
-<span id="1464">1464</span>
-<span id="1465">1465</span>
-<span id="1466">1466</span>
-<span id="1467">1467</span>
-<span id="1468">1468</span>
-<span id="1469">1469</span>
-<span id="1470">1470</span>
-<span id="1471">1471</span>
-<span id="1472">1472</span>
-<span id="1473">1473</span>
-<span id="1474">1474</span>
-<span id="1475">1475</span>
-<span id="1476">1476</span>
-<span id="1477">1477</span>
-<span id="1478">1478</span>
-<span id="1479">1479</span>
-<span id="1480">1480</span>
-<span id="1481">1481</span>
-<span id="1482">1482</span>
-<span id="1483">1483</span>
-<span id="1484">1484</span>
-<span id="1485">1485</span>
-<span id="1486">1486</span>
-<span id="1487">1487</span>
-<span id="1488">1488</span>
-<span id="1489">1489</span>
-<span id="1490">1490</span>
-<span id="1491">1491</span>
-<span id="1492">1492</span>
-<span id="1493">1493</span>
-<span id="1494">1494</span>
-<span id="1495">1495</span>
-<span id="1496">1496</span>
-<span id="1497">1497</span>
-<span id="1498">1498</span>
-<span id="1499">1499</span>
-<span id="1500">1500</span>
-<span id="1501">1501</span>
-<span id="1502">1502</span>
-<span id="1503">1503</span>
-<span id="1504">1504</span>
-<span id="1505">1505</span>
-<span id="1506">1506</span>
-<span id="1507">1507</span>
-<span id="1508">1508</span>
-<span id="1509">1509</span>
-<span id="1510">1510</span>
-<span id="1511">1511</span>
-<span id="1512">1512</span>
-<span id="1513">1513</span>
-<span id="1514">1514</span>
-<span id="1515">1515</span>
-<span id="1516">1516</span>
-<span id="1517">1517</span>
-<span id="1518">1518</span>
-<span id="1519">1519</span>
-<span id="1520">1520</span>
-<span id="1521">1521</span>
-<span id="1522">1522</span>
-<span id="1523">1523</span>
-<span id="1524">1524</span>
-<span id="1525">1525</span>
-<span id="1526">1526</span>
-<span id="1527">1527</span>
-<span id="1528">1528</span>
-<span id="1529">1529</span>
-<span id="1530">1530</span>
-<span id="1531">1531</span>
-<span id="1532">1532</span>
-<span id="1533">1533</span>
-<span id="1534">1534</span>
-<span id="1535">1535</span>
-<span id="1536">1536</span>
-<span id="1537">1537</span>
-<span id="1538">1538</span>
-<span id="1539">1539</span>
-<span id="1540">1540</span>
-<span id="1541">1541</span>
-<span id="1542">1542</span>
-<span id="1543">1543</span>
-<span id="1544">1544</span>
-<span id="1545">1545</span>
-<span id="1546">1546</span>
-<span id="1547">1547</span>
-<span id="1548">1548</span>
-<span id="1549">1549</span>
-<span id="1550">1550</span>
-<span id="1551">1551</span>
-<span id="1552">1552</span>
-<span id="1553">1553</span>
-<span id="1554">1554</span>
-<span id="1555">1555</span>
-<span id="1556">1556</span>
-<span id="1557">1557</span>
-<span id="1558">1558</span>
-<span id="1559">1559</span>
-<span id="1560">1560</span>
-<span id="1561">1561</span>
-<span id="1562">1562</span>
-<span id="1563">1563</span>
-<span id="1564">1564</span>
-<span id="1565">1565</span>
-<span id="1566">1566</span>
-<span id="1567">1567</span>
-<span id="1568">1568</span>
-<span id="1569">1569</span>
-<span id="1570">1570</span>
-<span id="1571">1571</span>
-<span id="1572">1572</span>
-<span id="1573">1573</span>
-<span id="1574">1574</span>
-<span id="1575">1575</span>
-<span id="1576">1576</span>
-<span id="1577">1577</span>
-<span id="1578">1578</span>
-<span id="1579">1579</span>
-<span id="1580">1580</span>
-<span id="1581">1581</span>
-<span id="1582">1582</span>
-<span id="1583">1583</span>
-<span id="1584">1584</span>
-<span id="1585">1585</span>
-<span id="1586">1586</span>
-<span id="1587">1587</span>
-<span id="1588">1588</span>
-<span id="1589">1589</span>
-<span id="1590">1590</span>
-<span id="1591">1591</span>
-<span id="1592">1592</span>
-<span id="1593">1593</span>
-<span id="1594">1594</span>
-<span id="1595">1595</span>
-<span id="1596">1596</span>
-<span id="1597">1597</span>
-<span id="1598">1598</span>
-<span id="1599">1599</span>
-<span id="1600">1600</span>
-<span id="1601">1601</span>
-<span id="1602">1602</span>
-<span id="1603">1603</span>
-<span id="1604">1604</span>
-<span id="1605">1605</span>
-<span id="1606">1606</span>
-<span id="1607">1607</span>
-<span id="1608">1608</span>
-<span id="1609">1609</span>
-<span id="1610">1610</span>
-<span id="1611">1611</span>
-<span id="1612">1612</span>
-<span id="1613">1613</span>
-<span id="1614">1614</span>
-<span id="1615">1615</span>
-<span id="1616">1616</span>
-<span id="1617">1617</span>
-<span id="1618">1618</span>
-<span id="1619">1619</span>
-<span id="1620">1620</span>
-<span id="1621">1621</span>
-<span id="1622">1622</span>
-<span id="1623">1623</span>
-<span id="1624">1624</span>
-<span id="1625">1625</span>
-<span id="1626">1626</span>
-<span id="1627">1627</span>
-<span id="1628">1628</span>
-<span id="1629">1629</span>
-<span id="1630">1630</span>
-<span id="1631">1631</span>
-<span id="1632">1632</span>
-<span id="1633">1633</span>
-<span id="1634">1634</span>
-<span id="1635">1635</span>
-<span id="1636">1636</span>
-<span id="1637">1637</span>
-<span id="1638">1638</span>
-<span id="1639">1639</span>
-<span id="1640">1640</span>
-<span id="1641">1641</span>
-<span id="1642">1642</span>
-<span id="1643">1643</span>
-<span id="1644">1644</span>
-<span id="1645">1645</span>
-<span id="1646">1646</span>
-<span id="1647">1647</span>
-<span id="1648">1648</span>
-<span id="1649">1649</span>
-<span id="1650">1650</span>
-<span id="1651">1651</span>
-<span id="1652">1652</span>
-<span id="1653">1653</span>
-<span id="1654">1654</span>
-<span id="1655">1655</span>
-<span id="1656">1656</span>
-<span id="1657">1657</span>
-<span id="1658">1658</span>
-<span id="1659">1659</span>
-<span id="1660">1660</span>
-<span id="1661">1661</span>
-<span id="1662">1662</span>
-<span id="1663">1663</span>
-<span id="1664">1664</span>
-<span id="1665">1665</span>
-<span id="1666">1666</span>
-<span id="1667">1667</span>
-<span id="1668">1668</span>
-<span id="1669">1669</span>
-<span id="1670">1670</span>
-<span id="1671">1671</span>
-<span id="1672">1672</span>
-<span id="1673">1673</span>
-<span id="1674">1674</span>
-<span id="1675">1675</span>
-<span id="1676">1676</span>
-<span id="1677">1677</span>
-<span id="1678">1678</span>
-<span id="1679">1679</span>
-<span id="1680">1680</span>
-<span id="1681">1681</span>
-<span id="1682">1682</span>
-<span id="1683">1683</span>
-<span id="1684">1684</span>
-<span id="1685">1685</span>
-<span id="1686">1686</span>
-<span id="1687">1687</span>
-<span id="1688">1688</span>
-<span id="1689">1689</span>
-<span id="1690">1690</span>
-<span id="1691">1691</span>
-<span id="1692">1692</span>
-<span id="1693">1693</span>
-<span id="1694">1694</span>
-<span id="1695">1695</span>
-<span id="1696">1696</span>
-<span id="1697">1697</span>
-<span id="1698">1698</span>
-<span id="1699">1699</span>
-<span id="1700">1700</span>
-<span id="1701">1701</span>
-<span id="1702">1702</span>
-<span id="1703">1703</span>
-<span id="1704">1704</span>
-<span id="1705">1705</span>
-<span id="1706">1706</span>
-<span id="1707">1707</span>
-<span id="1708">1708</span>
-<span id="1709">1709</span>
-<span id="1710">1710</span>
-<span id="1711">1711</span>
-<span id="1712">1712</span>
-<span id="1713">1713</span>
-<span id="1714">1714</span>
-<span id="1715">1715</span>
-<span id="1716">1716</span>
-<span id="1717">1717</span>
-<span id="1718">1718</span>
-<span id="1719">1719</span>
-<span id="1720">1720</span>
-<span id="1721">1721</span>
-<span id="1722">1722</span>
-<span id="1723">1723</span>
-<span id="1724">1724</span>
-<span id="1725">1725</span>
-<span id="1726">1726</span>
-<span id="1727">1727</span>
-<span id="1728">1728</span>
-<span id="1729">1729</span>
-<span id="1730">1730</span>
-<span id="1731">1731</span>
-<span id="1732">1732</span>
-<span id="1733">1733</span>
-<span id="1734">1734</span>
-<span id="1735">1735</span>
-<span id="1736">1736</span>
-<span id="1737">1737</span>
-<span id="1738">1738</span>
-<span id="1739">1739</span>
-<span id="1740">1740</span>
-<span id="1741">1741</span>
-<span id="1742">1742</span>
-<span id="1743">1743</span>
-<span id="1744">1744</span>
-<span id="1745">1745</span>
-<span id="1746">1746</span>
-<span id="1747">1747</span>
-<span id="1748">1748</span>
-<span id="1749">1749</span>
-<span id="1750">1750</span>
-<span id="1751">1751</span>
-<span id="1752">1752</span>
-<span id="1753">1753</span>
-<span id="1754">1754</span>
-<span id="1755">1755</span>
-<span id="1756">1756</span>
-<span id="1757">1757</span>
-<span id="1758">1758</span>
-<span id="1759">1759</span>
-<span id="1760">1760</span>
-<span id="1761">1761</span>
-<span id="1762">1762</span>
-<span id="1763">1763</span>
-<span id="1764">1764</span>
-<span id="1765">1765</span>
-<span id="1766">1766</span>
-<span id="1767">1767</span>
-<span id="1768">1768</span>
-<span id="1769">1769</span>
-<span id="1770">1770</span>
-<span id="1771">1771</span>
-<span id="1772">1772</span>
-<span id="1773">1773</span>
-<span id="1774">1774</span>
-<span id="1775">1775</span>
-<span id="1776">1776</span>
-<span id="1777">1777</span>
-<span id="1778">1778</span>
-<span id="1779">1779</span>
-<span id="1780">1780</span>
-<span id="1781">1781</span>
-<span id="1782">1782</span>
-<span id="1783">1783</span>
-<span id="1784">1784</span>
-<span id="1785">1785</span>
-<span id="1786">1786</span>
-<span id="1787">1787</span>
-<span id="1788">1788</span>
-<span id="1789">1789</span>
-<span id="1790">1790</span>
-<span id="1791">1791</span>
-<span id="1792">1792</span>
-<span id="1793">1793</span>
-<span id="1794">1794</span>
-<span id="1795">1795</span>
-<span id="1796">1796</span>
-<span id="1797">1797</span>
-<span id="1798">1798</span>
-<span id="1799">1799</span>
-<span id="1800">1800</span>
-<span id="1801">1801</span>
-<span id="1802">1802</span>
-<span id="1803">1803</span>
-<span id="1804">1804</span>
-<span id="1805">1805</span>
-<span id="1806">1806</span>
-<span id="1807">1807</span>
-<span id="1808">1808</span>
-<span id="1809">1809</span>
-<span id="1810">1810</span>
-<span id="1811">1811</span>
-<span id="1812">1812</span>
-<span id="1813">1813</span>
-<span id="1814">1814</span>
-<span id="1815">1815</span>
-<span id="1816">1816</span>
-<span id="1817">1817</span>
-<span id="1818">1818</span>
-<span id="1819">1819</span>
-<span id="1820">1820</span>
-<span id="1821">1821</span>
-<span id="1822">1822</span>
-<span id="1823">1823</span>
-<span id="1824">1824</span>
-<span id="1825">1825</span>
-<span id="1826">1826</span>
-<span id="1827">1827</span>
-<span id="1828">1828</span>
-<span id="1829">1829</span>
-<span id="1830">1830</span>
-<span id="1831">1831</span>
-<span id="1832">1832</span>
-<span id="1833">1833</span>
-<span id="1834">1834</span>
-<span id="1835">1835</span>
-<span id="1836">1836</span>
-<span id="1837">1837</span>
-<span id="1838">1838</span>
-<span id="1839">1839</span>
-<span id="1840">1840</span>
-<span id="1841">1841</span>
-<span id="1842">1842</span>
-<span id="1843">1843</span>
-<span id="1844">1844</span>
-<span id="1845">1845</span>
-<span id="1846">1846</span>
-<span id="1847">1847</span>
-<span id="1848">1848</span>
-<span id="1849">1849</span>
-<span id="1850">1850</span>
-<span id="1851">1851</span>
-<span id="1852">1852</span>
-<span id="1853">1853</span>
-<span id="1854">1854</span>
-<span id="1855">1855</span>
-<span id="1856">1856</span>
-<span id="1857">1857</span>
-<span id="1858">1858</span>
-<span id="1859">1859</span>
-<span id="1860">1860</span>
-<span id="1861">1861</span>
-<span id="1862">1862</span>
-<span id="1863">1863</span>
-<span id="1864">1864</span>
-<span id="1865">1865</span>
-<span id="1866">1866</span>
-<span id="1867">1867</span>
-<span id="1868">1868</span>
-<span id="1869">1869</span>
-<span id="1870">1870</span>
-<span id="1871">1871</span>
-<span id="1872">1872</span>
-<span id="1873">1873</span>
-<span id="1874">1874</span>
-<span id="1875">1875</span>
-<span id="1876">1876</span>
-<span id="1877">1877</span>
-<span id="1878">1878</span>
-<span id="1879">1879</span>
-<span id="1880">1880</span>
-<span id="1881">1881</span>
-<span id="1882">1882</span>
-<span id="1883">1883</span>
-<span id="1884">1884</span>
-<span id="1885">1885</span>
-<span id="1886">1886</span>
-<span id="1887">1887</span>
-<span id="1888">1888</span>
-<span id="1889">1889</span>
-<span id="1890">1890</span>
-<span id="1891">1891</span>
-<span id="1892">1892</span>
-<span id="1893">1893</span>
-<span id="1894">1894</span>
-<span id="1895">1895</span>
-<span id="1896">1896</span>
-<span id="1897">1897</span>
-<span id="1898">1898</span>
-<span id="1899">1899</span>
-<span id="1900">1900</span>
-<span id="1901">1901</span>
-<span id="1902">1902</span>
-<span id="1903">1903</span>
-<span id="1904">1904</span>
-<span id="1905">1905</span>
-<span id="1906">1906</span>
-<span id="1907">1907</span>
-<span id="1908">1908</span>
-<span id="1909">1909</span>
-<span id="1910">1910</span>
-<span id="1911">1911</span>
-<span id="1912">1912</span>
-<span id="1913">1913</span>
-<span id="1914">1914</span>
-<span id="1915">1915</span>
-<span id="1916">1916</span>
-<span id="1917">1917</span>
-<span id="1918">1918</span>
-<span id="1919">1919</span>
-<span id="1920">1920</span>
-<span id="1921">1921</span>
-<span id="1922">1922</span>
-<span id="1923">1923</span>
-<span id="1924">1924</span>
-<span id="1925">1925</span>
-<span id="1926">1926</span>
-<span id="1927">1927</span>
-<span id="1928">1928</span>
-<span id="1929">1929</span>
-<span id="1930">1930</span>
-<span id="1931">1931</span>
-<span id="1932">1932</span>
-<span id="1933">1933</span>
-<span id="1934">1934</span>
-<span id="1935">1935</span>
-<span id="1936">1936</span>
-<span id="1937">1937</span>
-<span id="1938">1938</span>
-<span id="1939">1939</span>
-<span id="1940">1940</span>
-<span id="1941">1941</span>
-<span id="1942">1942</span>
-<span id="1943">1943</span>
-<span id="1944">1944</span>
-<span id="1945">1945</span>
-<span id="1946">1946</span>
-<span id="1947">1947</span>
-<span id="1948">1948</span>
-<span id="1949">1949</span>
-<span id="1950">1950</span>
-<span id="1951">1951</span>
-<span id="1952">1952</span>
-<span id="1953">1953</span>
-<span id="1954">1954</span>
-<span id="1955">1955</span>
-<span id="1956">1956</span>
-<span id="1957">1957</span>
-<span id="1958">1958</span>
-<span id="1959">1959</span>
-<span id="1960">1960</span>
-<span id="1961">1961</span>
-<span id="1962">1962</span>
-<span id="1963">1963</span>
-<span id="1964">1964</span>
-<span id="1965">1965</span>
-<span id="1966">1966</span>
-<span id="1967">1967</span>
-<span id="1968">1968</span>
-<span id="1969">1969</span>
-<span id="1970">1970</span>
-<span id="1971">1971</span>
-<span id="1972">1972</span>
-<span id="1973">1973</span>
-<span id="1974">1974</span>
-<span id="1975">1975</span>
-<span id="1976">1976</span>
-<span id="1977">1977</span>
-<span id="1978">1978</span>
-<span id="1979">1979</span>
-<span id="1980">1980</span>
-<span id="1981">1981</span>
-<span id="1982">1982</span>
-<span id="1983">1983</span>
-<span id="1984">1984</span>
-<span id="1985">1985</span>
-<span id="1986">1986</span>
-<span id="1987">1987</span>
-<span id="1988">1988</span>
-<span id="1989">1989</span>
-<span id="1990">1990</span>
-<span id="1991">1991</span>
-<span id="1992">1992</span>
-<span id="1993">1993</span>
-<span id="1994">1994</span>
-<span id="1995">1995</span>
-<span id="1996">1996</span>
-<span id="1997">1997</span>
-<span id="1998">1998</span>
-<span id="1999">1999</span>
-<span id="2000">2000</span>
-<span id="2001">2001</span>
-<span id="2002">2002</span>
-<span id="2003">2003</span>
-<span id="2004">2004</span>
-<span id="2005">2005</span>
-<span id="2006">2006</span>
-<span id="2007">2007</span>
-<span id="2008">2008</span>
-<span id="2009">2009</span>
-<span id="2010">2010</span>
-<span id="2011">2011</span>
-<span id="2012">2012</span>
-<span id="2013">2013</span>
-<span id="2014">2014</span>
-<span id="2015">2015</span>
-<span id="2016">2016</span>
-<span id="2017">2017</span>
-<span id="2018">2018</span>
-<span id="2019">2019</span>
-<span id="2020">2020</span>
-<span id="2021">2021</span>
-<span id="2022">2022</span>
-<span id="2023">2023</span>
-<span id="2024">2024</span>
-<span id="2025">2025</span>
-<span id="2026">2026</span>
-<span id="2027">2027</span>
-<span id="2028">2028</span>
-<span id="2029">2029</span>
-<span id="2030">2030</span>
-<span id="2031">2031</span>
-<span id="2032">2032</span>
-<span id="2033">2033</span>
-<span id="2034">2034</span>
-<span id="2035">2035</span>
-<span id="2036">2036</span>
-<span id="2037">2037</span>
-<span id="2038">2038</span>
-<span id="2039">2039</span>
-<span id="2040">2040</span>
-<span id="2041">2041</span>
-<span id="2042">2042</span>
-<span id="2043">2043</span>
-<span id="2044">2044</span>
-<span id="2045">2045</span>
-<span id="2046">2046</span>
-<span id="2047">2047</span>
-<span id="2048">2048</span>
-<span id="2049">2049</span>
-<span id="2050">2050</span>
-<span id="2051">2051</span>
-<span id="2052">2052</span>
-<span id="2053">2053</span>
-<span id="2054">2054</span>
-<span id="2055">2055</span>
-<span id="2056">2056</span>
-<span id="2057">2057</span>
-<span id="2058">2058</span>
-<span id="2059">2059</span>
-<span id="2060">2060</span>
-<span id="2061">2061</span>
-<span id="2062">2062</span>
-<span id="2063">2063</span>
-<span id="2064">2064</span>
-<span id="2065">2065</span>
-<span id="2066">2066</span>
-<span id="2067">2067</span>
-<span id="2068">2068</span>
-<span id="2069">2069</span>
-<span id="2070">2070</span>
-<span id="2071">2071</span>
-<span id="2072">2072</span>
-<span id="2073">2073</span>
-<span id="2074">2074</span>
-<span id="2075">2075</span>
-<span id="2076">2076</span>
-<span id="2077">2077</span>
-<span id="2078">2078</span>
-<span id="2079">2079</span>
-<span id="2080">2080</span>
-<span id="2081">2081</span>
-<span id="2082">2082</span>
-<span id="2083">2083</span>
-<span id="2084">2084</span>
-<span id="2085">2085</span>
-<span id="2086">2086</span>
-<span id="2087">2087</span>
-<span id="2088">2088</span>
-<span id="2089">2089</span>
-<span id="2090">2090</span>
-<span id="2091">2091</span>
-<span id="2092">2092</span>
-<span id="2093">2093</span>
-<span id="2094">2094</span>
-<span id="2095">2095</span>
-<span id="2096">2096</span>
-<span id="2097">2097</span>
-<span id="2098">2098</span>
-<span id="2099">2099</span>
-<span id="2100">2100</span>
-<span id="2101">2101</span>
-<span id="2102">2102</span>
-<span id="2103">2103</span>
-<span id="2104">2104</span>
-<span id="2105">2105</span>
-<span id="2106">2106</span>
-<span id="2107">2107</span>
-<span id="2108">2108</span>
-<span id="2109">2109</span>
-<span id="2110">2110</span>
-<span id="2111">2111</span>
-<span id="2112">2112</span>
-<span id="2113">2113</span>
-<span id="2114">2114</span>
-<span id="2115">2115</span>
-<span id="2116">2116</span>
-<span id="2117">2117</span>
-<span id="2118">2118</span>
-<span id="2119">2119</span>
-<span id="2120">2120</span>
-<span id="2121">2121</span>
-<span id="2122">2122</span>
-<span id="2123">2123</span>
-<span id="2124">2124</span>
-<span id="2125">2125</span>
-<span id="2126">2126</span>
-<span id="2127">2127</span>
-<span id="2128">2128</span>
-<span id="2129">2129</span>
-<span id="2130">2130</span>
-<span id="2131">2131</span>
-<span id="2132">2132</span>
-<span id="2133">2133</span>
-<span id="2134">2134</span>
-<span id="2135">2135</span>
-<span id="2136">2136</span>
-<span id="2137">2137</span>
-<span id="2138">2138</span>
-<span id="2139">2139</span>
-<span id="2140">2140</span>
-<span id="2141">2141</span>
-<span id="2142">2142</span>
-<span id="2143">2143</span>
-<span id="2144">2144</span>
-<span id="2145">2145</span>
-<span id="2146">2146</span>
-<span id="2147">2147</span>
-<span id="2148">2148</span>
-<span id="2149">2149</span>
-<span id="2150">2150</span>
-<span id="2151">2151</span>
-<span id="2152">2152</span>
-<span id="2153">2153</span>
-<span id="2154">2154</span>
-<span id="2155">2155</span>
-<span id="2156">2156</span>
-<span id="2157">2157</span>
-<span id="2158">2158</span>
-<span id="2159">2159</span>
-<span id="2160">2160</span>
-<span id="2161">2161</span>
-<span id="2162">2162</span>
-<span id="2163">2163</span>
-<span id="2164">2164</span>
-<span id="2165">2165</span>
-<span id="2166">2166</span>
-<span id="2167">2167</span>
-<span id="2168">2168</span>
-<span id="2169">2169</span>
-<span id="2170">2170</span>
-<span id="2171">2171</span>
-<span id="2172">2172</span>
-<span id="2173">2173</span>
-<span id="2174">2174</span>
-<span id="2175">2175</span>
-<span id="2176">2176</span>
-<span id="2177">2177</span>
-<span id="2178">2178</span>
-<span id="2179">2179</span>
-<span id="2180">2180</span>
-<span id="2181">2181</span>
-<span id="2182">2182</span>
-<span id="2183">2183</span>
-<span id="2184">2184</span>
-<span id="2185">2185</span>
-<span id="2186">2186</span>
-<span id="2187">2187</span>
-<span id="2188">2188</span>
-<span id="2189">2189</span>
-<span id="2190">2190</span>
-<span id="2191">2191</span>
-<span id="2192">2192</span>
-<span id="2193">2193</span>
-<span id="2194">2194</span>
-<span id="2195">2195</span>
-<span id="2196">2196</span>
-<span id="2197">2197</span>
-<span id="2198">2198</span>
-<span id="2199">2199</span>
-<span id="2200">2200</span>
-<span id="2201">2201</span>
-<span id="2202">2202</span>
-<span id="2203">2203</span>
-<span id="2204">2204</span>
-<span id="2205">2205</span>
-<span id="2206">2206</span>
-<span id="2207">2207</span>
-<span id="2208">2208</span>
-<span id="2209">2209</span>
-<span id="2210">2210</span>
-<span id="2211">2211</span>
-<span id="2212">2212</span>
-<span id="2213">2213</span>
-<span id="2214">2214</span>
-<span id="2215">2215</span>
-<span id="2216">2216</span>
-<span id="2217">2217</span>
-<span id="2218">2218</span>
-<span id="2219">2219</span>
-<span id="2220">2220</span>
-<span id="2221">2221</span>
-<span id="2222">2222</span>
-<span id="2223">2223</span>
-<span id="2224">2224</span>
-<span id="2225">2225</span>
-<span id="2226">2226</span>
-<span id="2227">2227</span>
-<span id="2228">2228</span>
-<span id="2229">2229</span>
-<span id="2230">2230</span>
-<span id="2231">2231</span>
-<span id="2232">2232</span>
-<span id="2233">2233</span>
-<span id="2234">2234</span>
-<span id="2235">2235</span>
-<span id="2236">2236</span>
-<span id="2237">2237</span>
-<span id="2238">2238</span>
-<span id="2239">2239</span>
-<span id="2240">2240</span>
-<span id="2241">2241</span>
-<span id="2242">2242</span>
-<span id="2243">2243</span>
-<span id="2244">2244</span>
-<span id="2245">2245</span>
-<span id="2246">2246</span>
-<span id="2247">2247</span>
-<span id="2248">2248</span>
-<span id="2249">2249</span>
-<span id="2250">2250</span>
-<span id="2251">2251</span>
-<span id="2252">2252</span>
-<span id="2253">2253</span>
-<span id="2254">2254</span>
-<span id="2255">2255</span>
-<span id="2256">2256</span>
-<span id="2257">2257</span>
-<span id="2258">2258</span>
-<span id="2259">2259</span>
-<span id="2260">2260</span>
-<span id="2261">2261</span>
-<span id="2262">2262</span>
-<span id="2263">2263</span>
-<span id="2264">2264</span>
-<span id="2265">2265</span>
-<span id="2266">2266</span>
-<span id="2267">2267</span>
-<span id="2268">2268</span>
-<span id="2269">2269</span>
-<span id="2270">2270</span>
-<span id="2271">2271</span>
-<span id="2272">2272</span>
-<span id="2273">2273</span>
-<span id="2274">2274</span>
-<span id="2275">2275</span>
-<span id="2276">2276</span>
-<span id="2277">2277</span>
-<span id="2278">2278</span>
-<span id="2279">2279</span>
-<span id="2280">2280</span>
-<span id="2281">2281</span>
-<span id="2282">2282</span>
-<span id="2283">2283</span>
-<span id="2284">2284</span>
-<span id="2285">2285</span>
-<span id="2286">2286</span>
-<span id="2287">2287</span>
-<span id="2288">2288</span>
-<span id="2289">2289</span>
-<span id="2290">2290</span>
-<span id="2291">2291</span>
-<span id="2292">2292</span>
-<span id="2293">2293</span>
-<span id="2294">2294</span>
-<span id="2295">2295</span>
-<span id="2296">2296</span>
-<span id="2297">2297</span>
-<span id="2298">2298</span>
-<span id="2299">2299</span>
-<span id="2300">2300</span>
-<span id="2301">2301</span>
-<span id="2302">2302</span>
-<span id="2303">2303</span>
-<span id="2304">2304</span>
-<span id="2305">2305</span>
-<span id="2306">2306</span>
-<span id="2307">2307</span>
-<span id="2308">2308</span>
-<span id="2309">2309</span>
-<span id="2310">2310</span>
-<span id="2311">2311</span>
-<span id="2312">2312</span>
-<span id="2313">2313</span>
-<span id="2314">2314</span>
-<span id="2315">2315</span>
-<span id="2316">2316</span>
-<span id="2317">2317</span>
-<span id="2318">2318</span>
-<span id="2319">2319</span>
-<span id="2320">2320</span>
-<span id="2321">2321</span>
-<span id="2322">2322</span>
-<span id="2323">2323</span>
-<span id="2324">2324</span>
-<span id="2325">2325</span>
-<span id="2326">2326</span>
-<span id="2327">2327</span>
-<span id="2328">2328</span>
-<span id="2329">2329</span>
-<span id="2330">2330</span>
-<span id="2331">2331</span>
-<span id="2332">2332</span>
-<span id="2333">2333</span>
-<span id="2334">2334</span>
-<span id="2335">2335</span>
-<span id="2336">2336</span>
-<span id="2337">2337</span>
-<span id="2338">2338</span>
-<span id="2339">2339</span>
-<span id="2340">2340</span>
-<span id="2341">2341</span>
-<span id="2342">2342</span>
-<span id="2343">2343</span>
-<span id="2344">2344</span>
-<span id="2345">2345</span>
-<span id="2346">2346</span>
-<span id="2347">2347</span>
-<span id="2348">2348</span>
-<span id="2349">2349</span>
-<span id="2350">2350</span>
-<span id="2351">2351</span>
-<span id="2352">2352</span>
-<span id="2353">2353</span>
-<span id="2354">2354</span>
-<span id="2355">2355</span>
-<span id="2356">2356</span>
-<span id="2357">2357</span>
-<span id="2358">2358</span>
-<span id="2359">2359</span>
-<span id="2360">2360</span>
-<span id="2361">2361</span>
-<span id="2362">2362</span>
-<span id="2363">2363</span>
-<span id="2364">2364</span>
-<span id="2365">2365</span>
-<span id="2366">2366</span>
-<span id="2367">2367</span>
-<span id="2368">2368</span>
-<span id="2369">2369</span>
-<span id="2370">2370</span>
-<span id="2371">2371</span>
-<span id="2372">2372</span>
-<span id="2373">2373</span>
-<span id="2374">2374</span>
-<span id="2375">2375</span>
-<span id="2376">2376</span>
-<span id="2377">2377</span>
-<span id="2378">2378</span>
-<span id="2379">2379</span>
-<span id="2380">2380</span>
-<span id="2381">2381</span>
-<span id="2382">2382</span>
-<span id="2383">2383</span>
-<span id="2384">2384</span>
-<span id="2385">2385</span>
-<span id="2386">2386</span>
-<span id="2387">2387</span>
-<span id="2388">2388</span>
-<span id="2389">2389</span>
-<span id="2390">2390</span>
-<span id="2391">2391</span>
-<span id="2392">2392</span>
-<span id="2393">2393</span>
-<span id="2394">2394</span>
-<span id="2395">2395</span>
-<span id="2396">2396</span>
-<span id="2397">2397</span>
-<span id="2398">2398</span>
-<span id="2399">2399</span>
-<span id="2400">2400</span>
-<span id="2401">2401</span>
-<span id="2402">2402</span>
-<span id="2403">2403</span>
-<span id="2404">2404</span>
-<span id="2405">2405</span>
-<span id="2406">2406</span>
-<span id="2407">2407</span>
-<span id="2408">2408</span>
-<span id="2409">2409</span>
-<span id="2410">2410</span>
-<span id="2411">2411</span>
-<span id="2412">2412</span>
-<span id="2413">2413</span>
-<span id="2414">2414</span>
-<span id="2415">2415</span>
-<span id="2416">2416</span>
-<span id="2417">2417</span>
-<span id="2418">2418</span>
-<span id="2419">2419</span>
-<span id="2420">2420</span>
-<span id="2421">2421</span>
-<span id="2422">2422</span>
-<span id="2423">2423</span>
-<span id="2424">2424</span>
-<span id="2425">2425</span>
-<span id="2426">2426</span>
-<span id="2427">2427</span>
-<span id="2428">2428</span>
-<span id="2429">2429</span>
-<span id="2430">2430</span>
-<span id="2431">2431</span>
-<span id="2432">2432</span>
-<span id="2433">2433</span>
-<span id="2434">2434</span>
-<span id="2435">2435</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="doccomment">//! Wallet</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! This module defines the [`Wallet`] structure.</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">cell</span>::<span class="ident">RefCell</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashMap</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::{<span class="ident">BTreeMap</span>, <span class="ident">HashSet</span>};
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ops</span>::{<span class="ident">Deref</span>, <span class="ident">DerefMut</span>};
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>;
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">serialize</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">ChildNumber</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span> <span class="kw">as</span> <span class="ident">PSBT</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Address</span>, <span class="ident">Network</span>, <span class="ident">OutPoint</span>, <span class="ident">Script</span>, <span class="ident">SigHashType</span>, <span class="ident">Transaction</span>, <span class="ident">TxOut</span>, <span class="ident">Txid</span>};
-
-<span class="kw">use</span> <span class="ident">miniscript</span>::<span class="ident">descriptor</span>::<span class="ident">DescriptorPublicKey</span>;
-
-<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_imports</span>)]</span>
-<span class="kw">use</span> <span class="ident">log</span>::{<span class="ident">debug</span>, <span class="ident">error</span>, <span class="ident">info</span>, <span class="ident">trace</span>};
-
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">address_validator</span>;
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">coin_selection</span>;
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">export</span>;
-<span class="kw">mod</span> <span class="ident">rbf</span>;
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">signer</span>;
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">time</span>;
-<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">tx_builder</span>;
-<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">mod</span> <span class="ident">utils</span>;
-
-<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">utils</span>::<span class="ident">IsDust</span>;
-
-<span class="kw">use</span> <span class="ident">address_validator</span>::<span class="ident">AddressValidator</span>;
-<span class="kw">use</span> <span class="ident">signer</span>::{<span class="ident">Signer</span>, <span class="ident">SignerId</span>, <span class="ident">SignerOrdering</span>, <span class="ident">SignersContainer</span>};
-<span class="kw">use</span> <span class="ident">tx_builder</span>::<span class="ident">TxBuilder</span>;
-<span class="kw">use</span> <span class="ident">utils</span>::{<span class="ident">After</span>, <span class="ident">Older</span>};
-
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">blockchain</span>::{<span class="ident">Blockchain</span>, <span class="ident">OfflineBlockchain</span>, <span class="ident">OnlineBlockchain</span>, <span class="ident">Progress</span>};
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::{<span class="ident">BatchDatabase</span>, <span class="ident">BatchOperations</span>, <span class="ident">DatabaseUtils</span>};
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">descriptor</span>::{
- <span class="ident">get_checksum</span>, <span class="ident">DescriptorMeta</span>, <span class="ident">DescriptorScripts</span>, <span class="ident">ExtendedDescriptor</span>, <span class="ident">ExtractPolicy</span>, <span class="ident">Policy</span>,
-};
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">psbt</span>::<span class="ident">PSBTUtils</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="kw-2">*</span>;
-
-<span class="kw">const</span> <span class="ident">CACHE_ADDR_BATCH_SIZE</span>: <span class="ident">u32</span> <span class="op">=</span> <span class="number">100</span>;
-
-<span class="doccomment">/// Type alias for a [`Wallet`] that uses [`OfflineBlockchain`]</span>
-<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">OfflineWallet</span><span class="op"><</span><span class="ident">D</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span><span class="op"><</span><span class="ident">OfflineBlockchain</span>, <span class="ident">D</span><span class="op">></span>;
-
-<span class="doccomment">/// A Bitcoin wallet</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// A wallet takes descriptors, a [`database`](crate::database) and a</span>
-<span class="doccomment">/// [`blockchain`](crate::blockchain) and implements the basic functions that a Bitcoin wallets</span>
-<span class="doccomment">/// needs to operate, like [generating addresses](Wallet::get_new_address), [returning the balance](Wallet::get_balance),</span>
-<span class="doccomment">/// [creating transactions](Wallet::create_tx), etc.</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// A wallet can be either "online" if the [`blockchain`](crate::blockchain) type provided</span>
-<span class="doccomment">/// implements [`OnlineBlockchain`], or "offline" if it doesn't. Offline wallets only expose</span>
-<span class="doccomment">/// methods that don't need any interaction with the blockchain to work.</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Wallet</span><span class="op"><</span><span class="ident">B</span>: <span class="ident">Blockchain</span>, <span class="ident">D</span>: <span class="ident">BatchDatabase</span><span class="op">></span> {
- <span class="ident">descriptor</span>: <span class="ident">ExtendedDescriptor</span>,
- <span class="ident">change_descriptor</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">ExtendedDescriptor</span><span class="op">></span>,
-
- <span class="ident">signers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span><span class="op">></span>,
- <span class="ident">change_signers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span><span class="op">></span>,
-
- <span class="ident">address_validators</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">AddressValidator</span><span class="op">></span><span class="op">></span><span class="op">></span>,
-
- <span class="ident">network</span>: <span class="ident">Network</span>,
-
- <span class="ident">current_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
-
- <span class="ident">client</span>: <span class="ident">B</span>,
- <span class="ident">database</span>: <span class="ident">RefCell</span><span class="op"><</span><span class="ident">D</span><span class="op">></span>,
-}
-
-<span class="comment">// offline actions, always available</span>
-<span class="kw">impl</span><span class="op"><</span><span class="ident">B</span>, <span class="ident">D</span><span class="op">></span> <span class="ident">Wallet</span><span class="op"><</span><span class="ident">B</span>, <span class="ident">D</span><span class="op">></span>
-<span class="kw">where</span>
- <span class="ident">B</span>: <span class="ident">Blockchain</span>,
- <span class="ident">D</span>: <span class="ident">BatchDatabase</span>,
-{
- <span class="doccomment">/// Create a new "offline" wallet</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new_offline</span>(
- <span class="ident">descriptor</span>: <span class="kw-2">&</span><span class="ident">str</span>,
- <span class="ident">change_descriptor</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">str</span><span class="op">></span>,
- <span class="ident">network</span>: <span class="ident">Network</span>,
- <span class="kw-2">mut</span> <span class="ident">database</span>: <span class="ident">D</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="ident">database</span>.<span class="ident">check_descriptor_checksum</span>(
- <span class="ident">ScriptType</span>::<span class="ident">External</span>,
- <span class="ident">get_checksum</span>(<span class="ident">descriptor</span>)<span class="question-mark">?</span>.<span class="ident">as_bytes</span>(),
- )<span class="question-mark">?</span>;
- <span class="kw">let</span> (<span class="ident">descriptor</span>, <span class="ident">keymap</span>) <span class="op">=</span> <span class="ident">ExtendedDescriptor</span>::<span class="ident">parse_secret</span>(<span class="ident">descriptor</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">signers</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">SignersContainer</span>::<span class="ident">from</span>(<span class="ident">keymap</span>));
- <span class="kw">let</span> (<span class="ident">change_descriptor</span>, <span class="ident">change_signers</span>) <span class="op">=</span> <span class="kw">match</span> <span class="ident">change_descriptor</span> {
- <span class="prelude-val">Some</span>(<span class="ident">desc</span>) <span class="op">=</span><span class="op">></span> {
- <span class="ident">database</span>.<span class="ident">check_descriptor_checksum</span>(
- <span class="ident">ScriptType</span>::<span class="ident">Internal</span>,
- <span class="ident">get_checksum</span>(<span class="ident">desc</span>)<span class="question-mark">?</span>.<span class="ident">as_bytes</span>(),
- )<span class="question-mark">?</span>;
-
- <span class="kw">let</span> (<span class="ident">change_descriptor</span>, <span class="ident">change_keymap</span>) <span class="op">=</span> <span class="ident">ExtendedDescriptor</span>::<span class="ident">parse_secret</span>(<span class="ident">desc</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">change_signers</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">SignersContainer</span>::<span class="ident">from</span>(<span class="ident">change_keymap</span>));
- <span class="comment">// if !parsed.same_structure(descriptor.as_ref()) {</span>
- <span class="comment">// return Err(Error::DifferentDescriptorStructure);</span>
- <span class="comment">// }</span>
-
- (<span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>), <span class="ident">change_signers</span>)
- }
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> (<span class="prelude-val">None</span>, <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">SignersContainer</span>::<span class="ident">new</span>())),
- };
-
- <span class="prelude-val">Ok</span>(<span class="ident">Wallet</span> {
- <span class="ident">descriptor</span>,
- <span class="ident">change_descriptor</span>,
- <span class="ident">signers</span>,
- <span class="ident">change_signers</span>,
- <span class="ident">address_validators</span>: <span class="ident">Vec</span>::<span class="ident">new</span>(),
-
- <span class="ident">network</span>,
-
- <span class="ident">current_height</span>: <span class="prelude-val">None</span>,
-
- <span class="ident">client</span>: <span class="ident">B</span>::<span class="ident">offline</span>(),
- <span class="ident">database</span>: <span class="ident">RefCell</span>::<span class="ident">new</span>(<span class="ident">database</span>),
- })
- }
-
- <span class="doccomment">/// Return a newly generated address using the external descriptor</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_new_address</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Address</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">index</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">fetch_and_increment_index</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>)<span class="question-mark">?</span>;
-
- <span class="self">self</span>.<span class="ident">descriptor</span>
- .<span class="ident">derive</span>(<span class="kw-2">&</span>[<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">index</span>).<span class="ident">unwrap</span>()])
- .<span class="ident">address</span>(<span class="self">self</span>.<span class="ident">network</span>)
- .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">ScriptDoesntHaveAddressForm</span>)
- }
-
- <span class="doccomment">/// Return whether or not a `script` is part of this wallet (either internal or external)</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_mine</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script</span>: <span class="kw-2">&</span><span class="ident">Script</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">bool</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">is_mine</span>(<span class="ident">script</span>)
- }
-
- <span class="doccomment">/// Return the list of unspent outputs of this wallet</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// Note that this methods only operate on the internal database, which first needs to be</span>
- <span class="doccomment">/// [`Wallet::sync`] manually.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">list_unspent</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">iter_utxos</span>()
- }
-
- <span class="doccomment">/// Return the list of transactions made and received by the wallet</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// Optionally fill the [`TransactionDetails::transaction`] field with the raw transaction if</span>
- <span class="doccomment">/// `include_raw` is `true`.</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// Note that this methods only operate on the internal database, which first needs to be</span>
- <span class="doccomment">/// [`Wallet::sync`] manually.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">list_transactions</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">include_raw</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">TransactionDetails</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">iter_txs</span>(<span class="ident">include_raw</span>)
- }
-
- <span class="doccomment">/// Return the balance, meaning the sum of this wallet's unspent outputs' values</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// Note that this methods only operate on the internal database, which first needs to be</span>
- <span class="doccomment">/// [`Wallet::sync`] manually.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_balance</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u64</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="self">self</span>
- .<span class="ident">list_unspent</span>()<span class="question-mark">?</span>
- .<span class="ident">iter</span>()
- .<span class="ident">fold</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">sum</span>, <span class="ident">i</span><span class="op">|</span> <span class="ident">sum</span> <span class="op">+</span> <span class="ident">i</span>.<span class="ident">txout</span>.<span class="ident">value</span>))
- }
-
- <span class="doccomment">/// Add an external signer</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// See [the `signer` module](signer) for an example.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">add_signer</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
- <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
- <span class="ident">id</span>: <span class="ident">SignerId</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span>,
- <span class="ident">ordering</span>: <span class="ident">SignerOrdering</span>,
- <span class="ident">signer</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Signer</span><span class="op">></span><span class="op">></span>,
- ) {
- <span class="kw">let</span> <span class="ident">signers</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">script_type</span> {
- <span class="ident">ScriptType</span>::<span class="ident">External</span> <span class="op">=</span><span class="op">></span> <span class="ident">Arc</span>::<span class="ident">make_mut</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">signers</span>),
- <span class="ident">ScriptType</span>::<span class="ident">Internal</span> <span class="op">=</span><span class="op">></span> <span class="ident">Arc</span>::<span class="ident">make_mut</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">change_signers</span>),
- };
-
- <span class="ident">signers</span>.<span class="ident">add_external</span>(<span class="ident">id</span>, <span class="ident">ordering</span>, <span class="ident">signer</span>);
- }
-
- <span class="doccomment">/// Add an address validator</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// See [the `address_validator` module](address_validator) for an example.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">add_address_validator</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">validator</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">AddressValidator</span><span class="op">></span><span class="op">></span>) {
- <span class="self">self</span>.<span class="ident">address_validators</span>.<span class="ident">push</span>(<span class="ident">validator</span>);
- }
-
- <span class="doccomment">/// Create a new transaction following the options specified in the `builder`</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// ## Example</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// ```no_run</span>
- <span class="doccomment">/// # use std::str::FromStr;</span>
- <span class="doccomment">/// # use bitcoin::*;</span>
- <span class="doccomment">/// # use magical::*;</span>
- <span class="doccomment">/// # use magical::database::*;</span>
- <span class="doccomment">/// # let descriptor = "wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)";</span>
- <span class="doccomment">/// # let wallet: OfflineWallet<_> = Wallet::new_offline(descriptor, None, Network::Testnet, MemoryDatabase::default())?;</span>
- <span class="doccomment">/// # let to_address = Address::from_str("2N4eQYCbKUHCCTUjBJeHcJp9ok6J2GZsTDt").unwrap();</span>
- <span class="doccomment">/// let (psbt, details) = wallet.create_tx(</span>
- <span class="doccomment">/// TxBuilder::with_recipients(vec![(to_address.script_pubkey(), 50_000)])</span>
- <span class="doccomment">/// )?;</span>
- <span class="doccomment">/// // sign and broadcast ...</span>
- <span class="doccomment">/// # Ok::<(), magical::Error>(())</span>
- <span class="doccomment">/// ```</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">create_tx</span><span class="op"><</span><span class="ident">Cs</span>: <span class="ident">coin_selection</span>::<span class="ident">CoinSelectionAlgorithm</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">builder</span>: <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">Cs</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">PSBT</span>, <span class="ident">TransactionDetails</span>), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">recipients</span>.<span class="ident">is_empty</span>() {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">NoAddressees</span>);
- }
-
- <span class="comment">// TODO: fetch both internal and external policies</span>
- <span class="kw">let</span> <span class="ident">policy</span> <span class="op">=</span> <span class="self">self</span>
- .<span class="ident">descriptor</span>
- .<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">signers</span>))<span class="question-mark">?</span>
- .<span class="ident">unwrap</span>();
- <span class="kw">if</span> <span class="ident">policy</span>.<span class="ident">requires_path</span>() <span class="kw-2">&</span><span class="op">&</span> <span class="ident">builder</span>.<span class="ident">policy_path</span>.<span class="ident">is_none</span>() {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">SpendingPolicyRequired</span>);
- }
- <span class="kw">let</span> <span class="ident">requirements</span> <span class="op">=</span>
- <span class="ident">policy</span>.<span class="ident">get_condition</span>(<span class="ident">builder</span>.<span class="ident">policy_path</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap_or</span>(<span class="kw-2">&</span><span class="ident">BTreeMap</span>::<span class="ident">new</span>()))<span class="question-mark">?</span>;
- <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"requirements: {:?}"</span>, <span class="ident">requirements</span>);
-
- <span class="kw">let</span> <span class="ident">version</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">builder</span>.<span class="ident">version</span> {
- <span class="prelude-val">Some</span>(<span class="ident">tx_builder</span>::<span class="ident">Version</span>(<span class="number">0</span>)) <span class="op">=</span><span class="op">></span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">Generic</span>(<span class="string">"Invalid version `0`"</span>.<span class="ident">into</span>()))
- }
- <span class="prelude-val">Some</span>(<span class="ident">tx_builder</span>::<span class="ident">Version</span>(<span class="number">1</span>)) <span class="kw">if</span> <span class="ident">requirements</span>.<span class="ident">csv</span>.<span class="ident">is_some</span>() <span class="op">=</span><span class="op">></span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">Generic</span>(
- <span class="string">"TxBuilder requested version `1`, but at least `2` is needed to use OP_CSV"</span>
- .<span class="ident">into</span>(),
- ))
- }
- <span class="prelude-val">Some</span>(<span class="ident">tx_builder</span>::<span class="ident">Version</span>(<span class="ident">x</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">x</span>,
- <span class="prelude-val">None</span> <span class="kw">if</span> <span class="ident">requirements</span>.<span class="ident">csv</span>.<span class="ident">is_some</span>() <span class="op">=</span><span class="op">></span> <span class="number">2</span>,
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="number">1</span>,
- };
-
- <span class="kw">let</span> <span class="ident">lock_time</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">builder</span>.<span class="ident">locktime</span> {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="ident">requirements</span>.<span class="ident">timelock</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>),
- <span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="kw">if</span> <span class="ident">requirements</span>.<span class="ident">timelock</span>.<span class="ident">is_none</span>() <span class="op">=</span><span class="op">></span> <span class="ident">x</span>,
- <span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="kw">if</span> <span class="ident">requirements</span>.<span class="ident">timelock</span>.<span class="ident">unwrap</span>() <span class="op"><</span><span class="op">=</span> <span class="ident">x</span> <span class="op">=</span><span class="op">></span> <span class="ident">x</span>,
- <span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">Generic</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"TxBuilder requested timelock of `{}`, but at least `{}` is required to spend from this script"</span>, <span class="ident">x</span>, <span class="ident">requirements</span>.<span class="ident">timelock</span>.<span class="ident">unwrap</span>())))
- };
-
- <span class="kw">let</span> <span class="ident">n_sequence</span> <span class="op">=</span> <span class="kw">match</span> (<span class="ident">builder</span>.<span class="ident">rbf</span>, <span class="ident">requirements</span>.<span class="ident">csv</span>) {
- (<span class="prelude-val">None</span>, <span class="prelude-val">Some</span>(<span class="ident">csv</span>)) <span class="op">=</span><span class="op">></span> <span class="ident">csv</span>,
- (<span class="prelude-val">Some</span>(<span class="ident">rbf</span>), <span class="prelude-val">Some</span>(<span class="ident">csv</span>)) <span class="kw">if</span> <span class="ident">rbf</span> <span class="op"><</span> <span class="ident">csv</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">Generic</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"Cannot enable RBF with nSequence `{}`, since at least `{}` is required to spend with OP_CSV"</span>, <span class="ident">rbf</span>, <span class="ident">csv</span>))),
- (<span class="prelude-val">None</span>, <span class="kw">_</span>) <span class="kw">if</span> <span class="ident">requirements</span>.<span class="ident">timelock</span>.<span class="ident">is_some</span>() <span class="op">=</span><span class="op">></span> <span class="number">0xFFFFFFFE</span>,
- (<span class="prelude-val">Some</span>(<span class="ident">rbf</span>), <span class="kw">_</span>) <span class="kw">if</span> <span class="ident">rbf</span> <span class="op">></span><span class="op">=</span> <span class="number">0xFFFFFFFE</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">Generic</span>(<span class="string">"Cannot enable RBF with a nSequence >= 0xFFFFFFFE"</span>.<span class="ident">into</span>())),
- (<span class="prelude-val">Some</span>(<span class="ident">rbf</span>), <span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="ident">rbf</span>,
- (<span class="prelude-val">None</span>, <span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="number">0xFFFFFFFF</span>,
- };
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">Transaction</span> {
- <span class="ident">version</span>,
- <span class="ident">lock_time</span>,
- <span class="ident">input</span>: <span class="macro">vec</span><span class="macro">!</span>[],
- <span class="ident">output</span>: <span class="macro">vec</span><span class="macro">!</span>[],
- };
-
- <span class="kw">let</span> <span class="ident">fee_rate</span> <span class="op">=</span> <span class="ident">builder</span>.<span class="ident">fee_rate</span>.<span class="ident">unwrap_or_default</span>();
- <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">send_all</span> <span class="kw-2">&</span><span class="op">&</span> <span class="ident">builder</span>.<span class="ident">recipients</span>.<span class="ident">len</span>() <span class="op">!</span><span class="op">=</span> <span class="number">1</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">SendAllMultipleOutputs</span>);
- }
-
- <span class="comment">// we keep it as a float while we accumulate it, and only round it at the end</span>
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">fee_amount</span>: <span class="ident">f32</span> <span class="op">=</span> <span class="number">0.0</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">outgoing</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">received</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">0</span>;
-
- <span class="kw">let</span> <span class="ident">calc_fee_bytes</span> <span class="op">=</span> <span class="op">|</span><span class="ident">wu</span><span class="op">|</span> (<span class="ident">wu</span> <span class="kw">as</span> <span class="ident">f32</span>) <span class="op">*</span> <span class="ident">fee_rate</span>.<span class="ident">as_sat_vb</span>() <span class="op">/</span> <span class="number">4.0</span>;
- <span class="ident">fee_amount</span> <span class="op">+</span><span class="op">=</span> <span class="ident">calc_fee_bytes</span>(<span class="ident">tx</span>.<span class="ident">get_weight</span>());
-
- <span class="kw">for</span> (<span class="ident">index</span>, (<span class="ident">script_pubkey</span>, <span class="ident">satoshi</span>)) <span class="kw">in</span> <span class="ident">builder</span>.<span class="ident">recipients</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
- <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">builder</span>.<span class="ident">send_all</span> {
- <span class="bool-val">true</span> <span class="op">=</span><span class="op">></span> <span class="number">0</span>,
- <span class="bool-val">false</span> <span class="kw">if</span> <span class="ident">satoshi</span>.<span class="ident">is_dust</span>() <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">OutputBelowDustLimit</span>(<span class="ident">index</span>)),
- <span class="bool-val">false</span> <span class="op">=</span><span class="op">></span> <span class="kw-2">*</span><span class="ident">satoshi</span>,
- };
-
- <span class="kw">if</span> <span class="self">self</span>.<span class="ident">is_mine</span>(<span class="ident">script_pubkey</span>)<span class="question-mark">?</span> {
- <span class="ident">received</span> <span class="op">+</span><span class="op">=</span> <span class="ident">value</span>;
- }
-
- <span class="kw">let</span> <span class="ident">new_out</span> <span class="op">=</span> <span class="ident">TxOut</span> {
- <span class="ident">script_pubkey</span>: <span class="ident">script_pubkey</span>.<span class="ident">clone</span>(),
- <span class="ident">value</span>,
- };
- <span class="ident">fee_amount</span> <span class="op">+</span><span class="op">=</span> <span class="ident">calc_fee_bytes</span>(<span class="ident">serialize</span>(<span class="kw-2">&</span><span class="ident">new_out</span>).<span class="ident">len</span>() <span class="op">*</span> <span class="number">4</span>);
-
- <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">push</span>(<span class="ident">new_out</span>);
-
- <span class="ident">outgoing</span> <span class="op">+</span><span class="op">=</span> <span class="ident">value</span>;
- }
-
- <span class="comment">// TODO: use the right weight instead of the maximum, and only fall-back to it if the</span>
- <span class="comment">// script is unknown in the database</span>
- <span class="kw">let</span> <span class="ident">input_witness_weight</span> <span class="op">=</span> <span class="ident">std</span>::<span class="ident">cmp</span>::<span class="ident">max</span>(
- <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>)
- .<span class="number">0</span>
- .<span class="ident">max_satisfaction_weight</span>(),
- <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>)
- .<span class="number">0</span>
- .<span class="ident">max_satisfaction_weight</span>(),
- );
-
- <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">change_policy</span> <span class="op">!</span><span class="op">=</span> <span class="ident">tx_builder</span>::<span class="ident">ChangeSpendPolicy</span>::<span class="ident">ChangeAllowed</span>
- <span class="kw-2">&</span><span class="op">&</span> <span class="self">self</span>.<span class="ident">change_descriptor</span>.<span class="ident">is_none</span>()
- {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">Generic</span>(
- <span class="string">"The `change_policy` can be set only if the wallet has a change_descriptor"</span>.<span class="ident">into</span>(),
- ));
- }
-
- <span class="kw">let</span> (<span class="ident">available_utxos</span>, <span class="ident">use_all_utxos</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_available_utxos</span>(
- <span class="ident">builder</span>.<span class="ident">change_policy</span>,
- <span class="kw-2">&</span><span class="ident">builder</span>.<span class="ident">utxos</span>,
- <span class="kw-2">&</span><span class="ident">builder</span>.<span class="ident">unspendable</span>,
- <span class="ident">builder</span>.<span class="ident">send_all</span>,
- )<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">coin_selection</span>::<span class="ident">CoinSelectionResult</span> {
- <span class="ident">txin</span>,
- <span class="ident">selected_amount</span>,
- <span class="kw-2">mut</span> <span class="ident">fee_amount</span>,
- } <span class="op">=</span> <span class="ident">builder</span>.<span class="ident">coin_selection</span>.<span class="ident">coin_select</span>(
- <span class="ident">available_utxos</span>,
- <span class="ident">use_all_utxos</span>,
- <span class="ident">fee_rate</span>,
- <span class="ident">outgoing</span>,
- <span class="ident">input_witness_weight</span>,
- <span class="ident">fee_amount</span>,
- )<span class="question-mark">?</span>;
- <span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">txin</span>, <span class="ident">prev_script_pubkeys</span>): (<span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>) <span class="op">=</span> <span class="ident">txin</span>.<span class="ident">into_iter</span>().<span class="ident">unzip</span>();
- <span class="comment">// map that allows us to lookup the prev_script_pubkey for a given previous_output</span>
- <span class="kw">let</span> <span class="ident">prev_script_pubkeys</span> <span class="op">=</span> <span class="ident">txin</span>
- .<span class="ident">iter</span>()
- .<span class="ident">zip</span>(<span class="ident">prev_script_pubkeys</span>.<span class="ident">into_iter</span>())
- .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">txin</span>, <span class="ident">script</span>)<span class="op">|</span> (<span class="ident">txin</span>.<span class="ident">previous_output</span>, <span class="ident">script</span>))
- .<span class="ident">collect</span>::<span class="op"><</span><span class="ident">HashMap</span><span class="op"><</span><span class="kw">_</span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>();
-
- <span class="ident">txin</span>.<span class="ident">iter_mut</span>().<span class="ident">for_each</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> <span class="ident">i</span>.<span class="ident">sequence</span> <span class="op">=</span> <span class="ident">n_sequence</span>);
- <span class="ident">tx</span>.<span class="ident">input</span> <span class="op">=</span> <span class="ident">txin</span>;
-
- <span class="comment">// prepare the change output</span>
- <span class="kw">let</span> <span class="ident">change_output</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">builder</span>.<span class="ident">send_all</span> {
- <span class="bool-val">true</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
- <span class="bool-val">false</span> <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">change_script</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_change_address</span>()<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">change_output</span> <span class="op">=</span> <span class="ident">TxOut</span> {
- <span class="ident">script_pubkey</span>: <span class="ident">change_script</span>,
- <span class="ident">value</span>: <span class="number">0</span>,
- };
-
- <span class="comment">// take the change into account for fees</span>
- <span class="ident">fee_amount</span> <span class="op">+</span><span class="op">=</span> <span class="ident">calc_fee_bytes</span>(<span class="ident">serialize</span>(<span class="kw-2">&</span><span class="ident">change_output</span>).<span class="ident">len</span>() <span class="op">*</span> <span class="number">4</span>);
- <span class="prelude-val">Some</span>(<span class="ident">change_output</span>)
- }
- };
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">fee_amount</span> <span class="op">=</span> <span class="ident">fee_amount</span>.<span class="ident">ceil</span>() <span class="kw">as</span> <span class="ident">u64</span>;
- <span class="kw">let</span> <span class="ident">change_val</span> <span class="op">=</span> <span class="ident">selected_amount</span> <span class="op">-</span> <span class="ident">outgoing</span> <span class="op">-</span> <span class="ident">fee_amount</span>;
- <span class="kw">if</span> <span class="op">!</span><span class="ident">builder</span>.<span class="ident">send_all</span> <span class="kw-2">&</span><span class="op">&</span> <span class="op">!</span><span class="ident">change_val</span>.<span class="ident">is_dust</span>() {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">change_output</span> <span class="op">=</span> <span class="ident">change_output</span>.<span class="ident">unwrap</span>();
- <span class="ident">change_output</span>.<span class="ident">value</span> <span class="op">=</span> <span class="ident">change_val</span>;
- <span class="ident">received</span> <span class="op">+</span><span class="op">=</span> <span class="ident">change_val</span>;
-
- <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">push</span>(<span class="ident">change_output</span>);
- } <span class="kw">else</span> <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">send_all</span> <span class="kw-2">&</span><span class="op">&</span> <span class="op">!</span><span class="ident">change_val</span>.<span class="ident">is_dust</span>() {
- <span class="comment">// there's only one output, send everything to it</span>
- <span class="ident">tx</span>.<span class="ident">output</span>[<span class="number">0</span>].<span class="ident">value</span> <span class="op">=</span> <span class="ident">change_val</span>;
-
- <span class="comment">// send_all to our address</span>
- <span class="kw">if</span> <span class="self">self</span>.<span class="ident">is_mine</span>(<span class="kw-2">&</span><span class="ident">tx</span>.<span class="ident">output</span>[<span class="number">0</span>].<span class="ident">script_pubkey</span>)<span class="question-mark">?</span> {
- <span class="ident">received</span> <span class="op">=</span> <span class="ident">change_val</span>;
- }
- } <span class="kw">else</span> <span class="kw">if</span> <span class="op">!</span><span class="ident">builder</span>.<span class="ident">send_all</span> <span class="kw-2">&</span><span class="op">&</span> <span class="ident">change_val</span>.<span class="ident">is_dust</span>() {
- <span class="comment">// skip the change output because it's dust, this adds up to the fees</span>
- <span class="ident">fee_amount</span> <span class="op">+</span><span class="op">=</span> <span class="ident">change_val</span>;
- } <span class="kw">else</span> <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">send_all</span> {
- <span class="comment">// send_all but the only output would be below dust limit</span>
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">InsufficientFunds</span>); <span class="comment">// TODO: or OutputBelowDustLimit?</span>
- }
-
- <span class="comment">// sort input/outputs according to the chosen algorithm</span>
- <span class="ident">builder</span>.<span class="ident">ordering</span>.<span class="ident">sort_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>);
-
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
- <span class="kw">let</span> <span class="ident">psbt</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">complete_transaction</span>(<span class="ident">tx</span>, <span class="ident">prev_script_pubkeys</span>, <span class="ident">builder</span>)<span class="question-mark">?</span>;
-
- <span class="kw">let</span> <span class="ident">transaction_details</span> <span class="op">=</span> <span class="ident">TransactionDetails</span> {
- <span class="ident">transaction</span>: <span class="prelude-val">None</span>,
- <span class="ident">txid</span>,
- <span class="ident">timestamp</span>: <span class="ident">time</span>::<span class="ident">get_timestamp</span>(),
- <span class="ident">received</span>,
- <span class="ident">sent</span>: <span class="ident">selected_amount</span>,
- <span class="ident">fees</span>: <span class="ident">fee_amount</span>,
- <span class="ident">height</span>: <span class="prelude-val">None</span>,
- };
-
- <span class="prelude-val">Ok</span>((<span class="ident">psbt</span>, <span class="ident">transaction_details</span>))
- }
-
- <span class="doccomment">/// Bump the fee of a transaction following the options specified in the `builder`</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// Return an error if the transaction is already confirmed or doesn't explicitly signal RBF.</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// **NOTE**: if the original transaction was made with [`TxBuilder::send_all`], the same</span>
- <span class="doccomment">/// option must be enabled when bumping its fees to correctly reduce the only output's value to</span>
- <span class="doccomment">/// increase the fees.</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// ## Example</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// ```no_run</span>
- <span class="doccomment">/// # use std::str::FromStr;</span>
- <span class="doccomment">/// # use bitcoin::*;</span>
- <span class="doccomment">/// # use magical::*;</span>
- <span class="doccomment">/// # use magical::database::*;</span>
- <span class="doccomment">/// # let descriptor = "wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)";</span>
- <span class="doccomment">/// # let wallet: OfflineWallet<_> = Wallet::new_offline(descriptor, None, Network::Testnet, MemoryDatabase::default())?;</span>
- <span class="doccomment">/// let txid = Txid::from_str("faff0a466b70f5d5f92bd757a92c1371d4838bdd5bc53a06764e2488e51ce8f8").unwrap();</span>
- <span class="doccomment">/// let (psbt, details) = wallet.bump_fee(</span>
- <span class="doccomment">/// &txid,</span>
- <span class="doccomment">/// TxBuilder::new().fee_rate(FeeRate::from_sat_per_vb(5.0)),</span>
- <span class="doccomment">/// )?;</span>
- <span class="doccomment">/// // sign and broadcast ...</span>
- <span class="doccomment">/// # Ok::<(), magical::Error>(())</span>
- <span class="doccomment">/// ```</span>
- <span class="comment">// TODO: support for merging multiple transactions while bumping the fees</span>
- <span class="comment">// TODO: option to force addition of an extra output? seems bad for privacy to update the</span>
- <span class="comment">// change</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">bump_fee</span><span class="op"><</span><span class="ident">Cs</span>: <span class="ident">coin_selection</span>::<span class="ident">CoinSelectionAlgorithm</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>,
- <span class="ident">builder</span>: <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">Cs</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">PSBT</span>, <span class="ident">TransactionDetails</span>), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">details</span> <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="ident">txid</span>, <span class="bool-val">true</span>)<span class="question-mark">?</span> {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">TransactionNotFound</span>),
- <span class="prelude-val">Some</span>(<span class="ident">tx</span>) <span class="kw">if</span> <span class="ident">tx</span>.<span class="ident">transaction</span>.<span class="ident">is_none</span>() <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">TransactionNotFound</span>),
- <span class="prelude-val">Some</span>(<span class="ident">tx</span>) <span class="kw">if</span> <span class="ident">tx</span>.<span class="ident">height</span>.<span class="ident">is_some</span>() <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">TransactionConfirmed</span>),
- <span class="prelude-val">Some</span>(<span class="ident">tx</span>) <span class="op">=</span><span class="op">></span> <span class="ident">tx</span>,
- };
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">details</span>.<span class="ident">transaction</span>.<span class="ident">take</span>().<span class="ident">unwrap</span>();
- <span class="kw">if</span> <span class="op">!</span><span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">iter</span>().<span class="ident">any</span>(<span class="op">|</span><span class="ident">txin</span><span class="op">|</span> <span class="ident">txin</span>.<span class="ident">sequence</span> <span class="op"><</span><span class="op">=</span> <span class="number">0xFFFFFFFD</span>) {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">IrreplaceableTransaction</span>);
- }
-
- <span class="comment">// the new tx must "pay for its bandwidth"</span>
- <span class="kw">let</span> <span class="ident">vbytes</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">get_weight</span>() <span class="kw">as</span> <span class="ident">f32</span> <span class="op">/</span> <span class="number">4.0</span>;
- <span class="kw">let</span> <span class="ident">required_feerate</span> <span class="op">=</span> <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="ident">details</span>.<span class="ident">fees</span> <span class="kw">as</span> <span class="ident">f32</span> <span class="op">/</span> <span class="ident">vbytes</span> <span class="op">+</span> <span class="number">1.0</span>);
- <span class="kw">let</span> <span class="ident">new_feerate</span> <span class="op">=</span> <span class="ident">builder</span>.<span class="ident">fee_rate</span>.<span class="ident">unwrap_or_default</span>();
-
- <span class="kw">if</span> <span class="ident">new_feerate</span> <span class="op"><</span> <span class="ident">required_feerate</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">FeeRateTooLow</span> {
- <span class="ident">required</span>: <span class="ident">required_feerate</span>,
- });
- }
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">fee_difference</span> <span class="op">=</span>
- (<span class="ident">new_feerate</span>.<span class="ident">as_sat_vb</span>() <span class="op">*</span> <span class="ident">tx</span>.<span class="ident">get_weight</span>() <span class="kw">as</span> <span class="ident">f32</span> <span class="op">/</span> <span class="number">4.0</span>).<span class="ident">ceil</span>() <span class="kw">as</span> <span class="ident">u64</span> <span class="op">-</span> <span class="ident">details</span>.<span class="ident">fees</span>;
-
- <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">send_all</span> <span class="kw-2">&</span><span class="op">&</span> <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>() <span class="op">></span> <span class="number">1</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">SendAllMultipleOutputs</span>);
- }
-
- <span class="comment">// find the index of the output that we can update. either the change or the only one if</span>
- <span class="comment">// it's `send_all`</span>
- <span class="kw">let</span> <span class="ident">updatable_output</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">send_all</span> {
- <span class="number">0</span>
- } <span class="kw">else</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">change_output</span> <span class="op">=</span> <span class="prelude-val">None</span>;
- <span class="kw">for</span> (<span class="ident">index</span>, <span class="ident">txout</span>) <span class="kw">in</span> <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
- <span class="comment">// look for an output that we know and that has the right ScriptType. We use</span>
- <span class="comment">// `get_deget_descriptor_for` to find what's the ScriptType for `Internal`</span>
- <span class="comment">// addresses really is, because if there's no change_descriptor it's actually equal</span>
- <span class="comment">// to "External"</span>
- <span class="kw">let</span> (<span class="kw">_</span>, <span class="ident">change_type</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>);
- <span class="kw">match</span> <span class="self">self</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow</span>()
- .<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">txout</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span>
- {
- <span class="prelude-val">Some</span>((<span class="ident">script_type</span>, <span class="kw">_</span>)) <span class="kw">if</span> <span class="ident">script_type</span> <span class="op">=</span><span class="op">=</span> <span class="ident">change_type</span> <span class="op">=</span><span class="op">></span> {
- <span class="ident">change_output</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">index</span>);
- <span class="kw">break</span>;
- }
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> {}
- }
- }
-
- <span class="comment">// we need a change output, add one here and take into account the extra fees for it</span>
- <span class="kw">if</span> <span class="ident">change_output</span>.<span class="ident">is_none</span>() {
- <span class="kw">let</span> <span class="ident">change_script</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_change_address</span>()<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">change_txout</span> <span class="op">=</span> <span class="ident">TxOut</span> {
- <span class="ident">script_pubkey</span>: <span class="ident">change_script</span>,
- <span class="ident">value</span>: <span class="number">0</span>,
- };
- <span class="ident">fee_difference</span> <span class="op">+</span><span class="op">=</span>
- (<span class="ident">serialize</span>(<span class="kw-2">&</span><span class="ident">change_txout</span>).<span class="ident">len</span>() <span class="kw">as</span> <span class="ident">f32</span> <span class="op">*</span> <span class="ident">new_feerate</span>.<span class="ident">as_sat_vb</span>()).<span class="ident">ceil</span>() <span class="kw">as</span> <span class="ident">u64</span>;
- <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">push</span>(<span class="ident">change_txout</span>);
-
- <span class="ident">change_output</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>() <span class="op">-</span> <span class="number">1</span>);
- }
-
- <span class="ident">change_output</span>.<span class="ident">unwrap</span>()
- };
-
- <span class="comment">// if `builder.utxos` is Some(_) we have to add inputs and we skip down to the last branch</span>
- <span class="kw">match</span> <span class="ident">tx</span>.<span class="ident">output</span>[<span class="ident">updatable_output</span>]
- .<span class="ident">value</span>
- .<span class="ident">checked_sub</span>(<span class="ident">fee_difference</span>)
- {
- <span class="prelude-val">Some</span>(<span class="ident">new_value</span>) <span class="kw">if</span> <span class="op">!</span><span class="ident">new_value</span>.<span class="ident">is_dust</span>() <span class="kw-2">&</span><span class="op">&</span> <span class="ident">builder</span>.<span class="ident">utxos</span>.<span class="ident">is_none</span>() <span class="op">=</span><span class="op">></span> {
- <span class="comment">// try to reduce the "updatable output" amount</span>
- <span class="ident">tx</span>.<span class="ident">output</span>[<span class="ident">updatable_output</span>].<span class="ident">value</span> <span class="op">=</span> <span class="ident">new_value</span>;
- <span class="kw">if</span> <span class="self">self</span>.<span class="ident">is_mine</span>(<span class="kw-2">&</span><span class="ident">tx</span>.<span class="ident">output</span>[<span class="ident">updatable_output</span>].<span class="ident">script_pubkey</span>)<span class="question-mark">?</span> {
- <span class="ident">details</span>.<span class="ident">received</span> <span class="op">-</span><span class="op">=</span> <span class="ident">fee_difference</span>;
- }
-
- <span class="ident">details</span>.<span class="ident">fees</span> <span class="op">+</span><span class="op">=</span> <span class="ident">fee_difference</span>;
- }
- <span class="kw">_</span> <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">send_all</span> <span class="kw-2">&</span><span class="op">&</span> <span class="ident">builder</span>.<span class="ident">utxos</span>.<span class="ident">is_none</span>() <span class="op">=</span><span class="op">></span> {
- <span class="comment">// if the tx is "send_all" it doesn't make sense to either remove the only output</span>
- <span class="comment">// or add more inputs</span>
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">InsufficientFunds</span>);
- }
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> {
- <span class="comment">// initially always remove the change output</span>
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">removed_change_output</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">remove</span>(<span class="ident">updatable_output</span>);
- <span class="kw">if</span> <span class="self">self</span>.<span class="ident">is_mine</span>(<span class="kw-2">&</span><span class="ident">removed_change_output</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span> {
- <span class="ident">details</span>.<span class="ident">received</span> <span class="op">-</span><span class="op">=</span> <span class="ident">removed_change_output</span>.<span class="ident">value</span>;
- }
-
- <span class="comment">// we want to add more inputs if:</span>
- <span class="comment">// - builder.utxos tells us to do so</span>
- <span class="comment">// - the removed change value is lower than the fee_difference we want to add</span>
- <span class="kw">let</span> <span class="ident">needs_more_inputs</span> <span class="op">=</span>
- <span class="ident">builder</span>.<span class="ident">utxos</span>.<span class="ident">is_some</span>() <span class="op">|</span><span class="op">|</span> <span class="ident">removed_change_output</span>.<span class="ident">value</span> <span class="op"><</span><span class="op">=</span> <span class="ident">fee_difference</span>;
- <span class="kw">let</span> <span class="ident">added_amount</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">needs_more_inputs</span> {
- <span class="comment">// TODO: use the right weight instead of the maximum, and only fall-back to it if the</span>
- <span class="comment">// script is unknown in the database</span>
- <span class="kw">let</span> <span class="ident">input_witness_weight</span> <span class="op">=</span> <span class="ident">std</span>::<span class="ident">cmp</span>::<span class="ident">max</span>(
- <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>)
- .<span class="number">0</span>
- .<span class="ident">max_satisfaction_weight</span>(),
- <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>)
- .<span class="number">0</span>
- .<span class="ident">max_satisfaction_weight</span>(),
- );
-
- <span class="kw">let</span> (<span class="ident">available_utxos</span>, <span class="ident">use_all_utxos</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_available_utxos</span>(
- <span class="ident">builder</span>.<span class="ident">change_policy</span>,
- <span class="kw-2">&</span><span class="ident">builder</span>.<span class="ident">utxos</span>,
- <span class="kw-2">&</span><span class="ident">builder</span>.<span class="ident">unspendable</span>,
- <span class="bool-val">false</span>,
- )<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">available_utxos</span> <span class="op">=</span> <span class="ident">rbf</span>::<span class="ident">filter_available</span>(
- <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">deref</span>(),
- <span class="ident">available_utxos</span>.<span class="ident">into_iter</span>(),
- )<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">coin_selection</span>::<span class="ident">CoinSelectionResult</span> {
- <span class="ident">txin</span>,
- <span class="ident">selected_amount</span>,
- <span class="ident">fee_amount</span>,
- } <span class="op">=</span> <span class="ident">builder</span>.<span class="ident">coin_selection</span>.<span class="ident">coin_select</span>(
- <span class="ident">available_utxos</span>,
- <span class="ident">use_all_utxos</span>,
- <span class="ident">new_feerate</span>,
- <span class="ident">fee_difference</span>
- .<span class="ident">checked_sub</span>(<span class="ident">removed_change_output</span>.<span class="ident">value</span>)
- .<span class="ident">unwrap_or</span>(<span class="number">0</span>),
- <span class="ident">input_witness_weight</span>,
- <span class="number">0.0</span>,
- )<span class="question-mark">?</span>;
- <span class="ident">fee_difference</span> <span class="op">+</span><span class="op">=</span> <span class="ident">fee_amount</span>.<span class="ident">ceil</span>() <span class="kw">as</span> <span class="ident">u64</span>;
-
- <span class="comment">// add the new inputs</span>
- <span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">txin</span>, <span class="kw">_</span>): (<span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>) <span class="op">=</span> <span class="ident">txin</span>.<span class="ident">into_iter</span>().<span class="ident">unzip</span>();
-
- <span class="comment">// TODO: use tx_builder.sequence ??</span>
- <span class="comment">// copy the n_sequence from the inputs that were already in the transaction</span>
- <span class="ident">txin</span>.<span class="ident">iter_mut</span>()
- .<span class="ident">for_each</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> <span class="ident">i</span>.<span class="ident">sequence</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">sequence</span>);
- <span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">txin</span>);
-
- <span class="ident">details</span>.<span class="ident">sent</span> <span class="op">+</span><span class="op">=</span> <span class="ident">selected_amount</span>;
- <span class="ident">selected_amount</span>
- } <span class="kw">else</span> {
- <span class="comment">// otherwise just remove the output and add 0 new coins</span>
- <span class="number">0</span>
- };
-
- <span class="kw">match</span> (<span class="ident">removed_change_output</span>.<span class="ident">value</span> <span class="op">+</span> <span class="ident">added_amount</span>).<span class="ident">checked_sub</span>(<span class="ident">fee_difference</span>) {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">InsufficientFunds</span>),
- <span class="prelude-val">Some</span>(<span class="ident">new_value</span>) <span class="kw">if</span> <span class="ident">new_value</span>.<span class="ident">is_dust</span>() <span class="op">=</span><span class="op">></span> {
- <span class="comment">// the change would be dust, add that to fees</span>
- <span class="ident">details</span>.<span class="ident">fees</span> <span class="op">+</span><span class="op">=</span> <span class="ident">fee_difference</span> <span class="op">+</span> <span class="ident">new_value</span>;
- }
- <span class="prelude-val">Some</span>(<span class="ident">new_value</span>) <span class="op">=</span><span class="op">></span> {
- <span class="comment">// add the change back</span>
- <span class="ident">removed_change_output</span>.<span class="ident">value</span> <span class="op">=</span> <span class="ident">new_value</span>;
- <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">push</span>(<span class="ident">removed_change_output</span>);
-
- <span class="ident">details</span>.<span class="ident">received</span> <span class="op">+</span><span class="op">=</span> <span class="ident">new_value</span>;
- <span class="ident">details</span>.<span class="ident">fees</span> <span class="op">+</span><span class="op">=</span> <span class="ident">fee_difference</span>;
- }
- }
- }
- };
-
- <span class="comment">// clear witnesses</span>
- <span class="kw">for</span> <span class="ident">input</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
- <span class="ident">input</span>.<span class="ident">script_sig</span> <span class="op">=</span> <span class="ident">Script</span>::<span class="ident">default</span>();
- <span class="ident">input</span>.<span class="ident">witness</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
- }
-
- <span class="comment">// sort input/outputs according to the chosen algorithm</span>
- <span class="ident">builder</span>.<span class="ident">ordering</span>.<span class="ident">sort_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>);
-
- <span class="comment">// TODO: check that we are not replacing more than 100 txs from mempool</span>
-
- <span class="ident">details</span>.<span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
- <span class="ident">details</span>.<span class="ident">timestamp</span> <span class="op">=</span> <span class="ident">time</span>::<span class="ident">get_timestamp</span>();
-
- <span class="kw">let</span> <span class="ident">prev_script_pubkeys</span> <span class="op">=</span> <span class="ident">tx</span>
- .<span class="ident">input</span>
- .<span class="ident">iter</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">txin</span><span class="op">|</span> {
- <span class="prelude-val">Ok</span>((
- <span class="ident">txin</span>.<span class="ident">previous_output</span>.<span class="ident">clone</span>(),
- <span class="self">self</span>.<span class="ident">database</span>
- .<span class="ident">borrow</span>()
- .<span class="ident">get_previous_output</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">previous_output</span>)<span class="question-mark">?</span>,
- ))
- })
- .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span><span class="op">></span>()<span class="question-mark">?</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">filter_map</span>(<span class="op">|</span>(<span class="ident">outpoint</span>, <span class="ident">txout</span>)<span class="op">|</span> <span class="kw">match</span> <span class="ident">txout</span> {
- <span class="prelude-val">Some</span>(<span class="ident">txout</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>((<span class="ident">outpoint</span>, <span class="ident">txout</span>.<span class="ident">script_pubkey</span>)),
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
- })
- .<span class="ident">collect</span>();
- <span class="kw">let</span> <span class="ident">psbt</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">complete_transaction</span>(<span class="ident">tx</span>, <span class="ident">prev_script_pubkeys</span>, <span class="ident">builder</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>((<span class="ident">psbt</span>, <span class="ident">details</span>))
- }
-
- <span class="doccomment">/// Sign a transaction with all the wallet's signers, in the order specified by every signer's</span>
- <span class="doccomment">/// [`SignerOrdering`]</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// ## Example</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// ```no_run</span>
- <span class="doccomment">/// # use std::str::FromStr;</span>
- <span class="doccomment">/// # use bitcoin::*;</span>
- <span class="doccomment">/// # use magical::*;</span>
- <span class="doccomment">/// # use magical::database::*;</span>
- <span class="doccomment">/// # let descriptor = "wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)";</span>
- <span class="doccomment">/// # let wallet: OfflineWallet<_> = Wallet::new_offline(descriptor, None, Network::Testnet, MemoryDatabase::default())?;</span>
- <span class="doccomment">/// # let (psbt, _) = wallet.create_tx(TxBuilder::new())?;</span>
- <span class="doccomment">/// let (signed_psbt, finalized) = wallet.sign(psbt, None)?;</span>
- <span class="doccomment">/// # Ok::<(), magical::Error>(())</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">sign</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="kw-2">mut</span> <span class="ident">psbt</span>: <span class="ident">PSBT</span>, <span class="ident">assume_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">PSBT</span>, <span class="ident">bool</span>), <span class="ident">Error</span><span class="op">></span> {
- <span class="comment">// this helps us doing our job later</span>
- <span class="self">self</span>.<span class="ident">add_input_hd_keypaths</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">psbt</span>)<span class="question-mark">?</span>;
-
- <span class="kw">for</span> <span class="ident">signer</span> <span class="kw">in</span> <span class="self">self</span>
- .<span class="ident">signers</span>
- .<span class="ident">signers</span>()
- .<span class="ident">iter</span>()
- .<span class="ident">chain</span>(<span class="self">self</span>.<span class="ident">change_signers</span>.<span class="ident">signers</span>().<span class="ident">iter</span>())
- {
- <span class="kw">if</span> <span class="ident">signer</span>.<span class="ident">sign_whole_tx</span>() {
- <span class="ident">signer</span>.<span class="ident">sign</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">psbt</span>, <span class="prelude-val">None</span>)<span class="question-mark">?</span>;
- } <span class="kw">else</span> {
- <span class="kw">for</span> <span class="ident">index</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">len</span>() {
- <span class="ident">signer</span>.<span class="ident">sign</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">psbt</span>, <span class="prelude-val">Some</span>(<span class="ident">index</span>))<span class="question-mark">?</span>;
- }
- }
- }
-
- <span class="comment">// attempt to finalize</span>
- <span class="self">self</span>.<span class="ident">finalize_psbt</span>(<span class="ident">psbt</span>, <span class="ident">assume_height</span>)
- }
-
- <span class="doccomment">/// Return the spending policies for the wallet's descriptor</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">policies</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Policy</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">match</span> (<span class="ident">script_type</span>, <span class="self">self</span>.<span class="ident">change_descriptor</span>.<span class="ident">as_ref</span>()) {
- (<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="kw">_</span>) <span class="op">=</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">descriptor</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">signers</span>))<span class="question-mark">?</span>)
- }
- (<span class="ident">ScriptType</span>::<span class="ident">Internal</span>, <span class="prelude-val">None</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
- (<span class="ident">ScriptType</span>::<span class="ident">Internal</span>, <span class="prelude-val">Some</span>(<span class="ident">desc</span>)) <span class="op">=</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="ident">desc</span>.<span class="ident">extract_policy</span>(<span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">change_signers</span>))<span class="question-mark">?</span>)
- }
- }
- }
-
- <span class="doccomment">/// Return the "public" version of the wallet's descriptor, meaning a new descriptor that has</span>
- <span class="doccomment">/// the same structure but with every secret key removed</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// This can be used to build a watch-only version of a wallet</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">public_descriptor</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">ExtendedDescriptor</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">match</span> (<span class="ident">script_type</span>, <span class="self">self</span>.<span class="ident">change_descriptor</span>.<span class="ident">as_ref</span>()) {
- (<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">descriptor</span>.<span class="ident">clone</span>())),
- (<span class="ident">ScriptType</span>::<span class="ident">Internal</span>, <span class="prelude-val">None</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>),
- (<span class="ident">ScriptType</span>::<span class="ident">Internal</span>, <span class="prelude-val">Some</span>(<span class="ident">desc</span>)) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">desc</span>.<span class="ident">clone</span>())),
- }
- }
-
- <span class="doccomment">/// Try to finalize a PSBT</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">finalize_psbt</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="kw-2">mut</span> <span class="ident">psbt</span>: <span class="ident">PSBT</span>,
- <span class="ident">assume_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">PSBT</span>, <span class="ident">bool</span>), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">clone</span>();
-
- <span class="kw">for</span> (<span class="ident">n</span>, (<span class="ident">input</span>, <span class="ident">psbt_input</span>)) <span class="kw">in</span> <span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">iter_mut</span>().<span class="ident">zip</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">iter</span>()).<span class="ident">enumerate</span>() {
- <span class="comment">// if the height is None in the database it means it's still unconfirmed, so consider</span>
- <span class="comment">// that as a very high value</span>
- <span class="kw">let</span> <span class="ident">create_height</span> <span class="op">=</span> <span class="self">self</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow</span>()
- .<span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">previous_output</span>.<span class="ident">txid</span>, <span class="bool-val">false</span>)<span class="question-mark">?</span>
- .<span class="ident">and_then</span>(<span class="op">|</span><span class="ident">tx</span><span class="op">|</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>.<span class="ident">height</span>.<span class="ident">unwrap_or</span>(<span class="ident">std</span>::<span class="ident">u32</span>::<span class="ident">MAX</span>)));
- <span class="kw">let</span> <span class="ident">current_height</span> <span class="op">=</span> <span class="ident">assume_height</span>.<span class="ident">or</span>(<span class="self">self</span>.<span class="ident">current_height</span>);
-
- <span class="macro">debug</span><span class="macro">!</span>(
- <span class="string">"Input #{} - {}, using `create_height` = {:?}, `current_height` = {:?}"</span>,
- <span class="ident">n</span>, <span class="ident">input</span>.<span class="ident">previous_output</span>, <span class="ident">create_height</span>, <span class="ident">current_height</span>
- );
-
- <span class="comment">// - Try to derive the descriptor by looking at the txout. If it's in our database, we</span>
- <span class="comment">// know exactly which `script_type` to use, and which derivation index it is</span>
- <span class="comment">// - If that fails, try to derive it by looking at the psbt input: the complete logic</span>
- <span class="comment">// is in `src/descriptor/mod.rs`, but it will basically look at `hd_keypaths`,</span>
- <span class="comment">// `redeem_script` and `witness_script` to determine the right derivation</span>
- <span class="comment">// - If that also fails, it will try it on the internal descriptor, if present</span>
- <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">desc</span>) <span class="op">=</span> <span class="ident">psbt</span>
- .<span class="ident">get_utxo_for</span>(<span class="ident">n</span>)
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_txout</span>(<span class="kw-2">&</span><span class="ident">txout</span>))
- .<span class="ident">transpose</span>()<span class="question-mark">?</span>
- .<span class="ident">flatten</span>()
- {
- <span class="ident">desc</span>
- } <span class="kw">else</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">desc</span>) <span class="op">=</span> <span class="self">self</span>
- .<span class="ident">descriptor</span>
- .<span class="ident">derive_from_psbt_input</span>(<span class="ident">psbt_input</span>, <span class="ident">psbt</span>.<span class="ident">get_utxo_for</span>(<span class="ident">n</span>))
- {
- <span class="ident">desc</span>
- } <span class="kw">else</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">desc</span>) <span class="op">=</span> <span class="self">self</span>
- .<span class="ident">change_descriptor</span>
- .<span class="ident">as_ref</span>()
- .<span class="ident">and_then</span>(<span class="op">|</span><span class="ident">desc</span><span class="op">|</span> <span class="ident">desc</span>.<span class="ident">derive_from_psbt_input</span>(<span class="ident">psbt_input</span>, <span class="ident">psbt</span>.<span class="ident">get_utxo_for</span>(<span class="ident">n</span>)))
- {
- <span class="ident">desc</span>
- } <span class="kw">else</span> {
- <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"Couldn't find the right derived descriptor for input {}"</span>, <span class="ident">n</span>);
- <span class="kw">return</span> <span class="prelude-val">Ok</span>((<span class="ident">psbt</span>, <span class="bool-val">false</span>));
- };
-
- <span class="kw">match</span> <span class="ident">desc</span>.<span class="ident">satisfy</span>(
- <span class="ident">input</span>,
- (
- <span class="ident">psbt_input</span>.<span class="ident">clone</span>(),
- <span class="ident">After</span>::<span class="ident">new</span>(<span class="ident">current_height</span>, <span class="bool-val">false</span>),
- <span class="ident">Older</span>::<span class="ident">new</span>(<span class="ident">current_height</span>, <span class="ident">create_height</span>, <span class="bool-val">false</span>),
- ),
- ) {
- <span class="prelude-val">Ok</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="kw">continue</span>,
- <span class="prelude-val">Err</span>(<span class="ident">e</span>) <span class="op">=</span><span class="op">></span> {
- <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"satisfy error {:?} for input {}"</span>, <span class="ident">e</span>, <span class="ident">n</span>);
- <span class="kw">return</span> <span class="prelude-val">Ok</span>((<span class="ident">psbt</span>, <span class="bool-val">false</span>));
- }
- }
- }
-
- <span class="comment">// consume tx to extract its input's script_sig and witnesses and move them into the psbt</span>
- <span class="kw">for</span> (<span class="ident">input</span>, <span class="ident">psbt_input</span>) <span class="kw">in</span> <span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">into_iter</span>().<span class="ident">zip</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">iter_mut</span>()) {
- <span class="ident">psbt_input</span>.<span class="ident">final_script_sig</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">input</span>.<span class="ident">script_sig</span>);
- <span class="ident">psbt_input</span>.<span class="ident">final_script_witness</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">input</span>.<span class="ident">witness</span>);
- }
-
- <span class="prelude-val">Ok</span>((<span class="ident">psbt</span>, <span class="bool-val">true</span>))
- }
-
- <span class="comment">// Internals</span>
-
- <span class="kw">fn</span> <span class="ident">get_descriptor_for_script_type</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
- ) <span class="op">-</span><span class="op">></span> (<span class="kw-2">&</span><span class="ident">ExtendedDescriptor</span>, <span class="ident">ScriptType</span>) {
- <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">script_type</span> {
- <span class="ident">ScriptType</span>::<span class="ident">Internal</span> <span class="kw">if</span> <span class="self">self</span>.<span class="ident">change_descriptor</span>.<span class="ident">is_some</span>() <span class="op">=</span><span class="op">></span> (
- <span class="self">self</span>.<span class="ident">change_descriptor</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap</span>(),
- <span class="ident">ScriptType</span>::<span class="ident">Internal</span>,
- ),
- <span class="kw">_</span> <span class="op">=</span><span class="op">></span> (<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">descriptor</span>, <span class="ident">ScriptType</span>::<span class="ident">External</span>),
- };
-
- <span class="ident">desc</span>
- }
-
- <span class="kw">fn</span> <span class="ident">get_descriptor_for_txout</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">txout</span>: <span class="kw-2">&</span><span class="ident">TxOut</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">ExtendedDescriptor</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="self">self</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow</span>()
- .<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">txout</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span>
- .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">script_type</span>, <span class="ident">child</span>)<span class="op">|</span> (<span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">script_type</span>).<span class="number">0</span>, <span class="ident">child</span>))
- .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">desc</span>, <span class="ident">child</span>)<span class="op">|</span> <span class="ident">desc</span>.<span class="ident">derive</span>(<span class="kw-2">&</span>[<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">child</span>).<span class="ident">unwrap</span>()])))
- }
-
- <span class="kw">fn</span> <span class="ident">get_change_address</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Script</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> (<span class="ident">desc</span>, <span class="ident">script_type</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>);
- <span class="kw">let</span> <span class="ident">index</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">fetch_and_increment_index</span>(<span class="ident">script_type</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">desc</span>
- .<span class="ident">derive</span>(<span class="kw-2">&</span>[<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">index</span>).<span class="ident">unwrap</span>()])
- .<span class="ident">script_pubkey</span>())
- }
-
- <span class="kw">fn</span> <span class="ident">fetch_and_increment_index</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">script_type</span>: <span class="ident">ScriptType</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> (<span class="ident">descriptor</span>, <span class="ident">script_type</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">script_type</span>);
- <span class="kw">let</span> <span class="ident">index</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">descriptor</span>.<span class="ident">is_fixed</span>() {
- <span class="bool-val">true</span> <span class="op">=</span><span class="op">></span> <span class="number">0</span>,
- <span class="bool-val">false</span> <span class="op">=</span><span class="op">></span> <span class="self">self</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">increment_last_index</span>(<span class="ident">script_type</span>)<span class="question-mark">?</span>,
- };
-
- <span class="kw">if</span> <span class="self">self</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow</span>()
- .<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">script_type</span>, <span class="ident">index</span>)<span class="question-mark">?</span>
- .<span class="ident">is_none</span>()
- {
- <span class="self">self</span>.<span class="ident">cache_addresses</span>(<span class="ident">script_type</span>, <span class="ident">index</span>, <span class="ident">CACHE_ADDR_BATCH_SIZE</span>)<span class="question-mark">?</span>;
- }
-
- <span class="kw">let</span> <span class="ident">hd_keypaths</span> <span class="op">=</span> <span class="ident">descriptor</span>.<span class="ident">get_hd_keypaths</span>(<span class="ident">index</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="ident">descriptor</span>
- .<span class="ident">derive</span>(<span class="kw-2">&</span>[<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">index</span>).<span class="ident">unwrap</span>()])
- .<span class="ident">script_pubkey</span>();
- <span class="kw">for</span> <span class="ident">validator</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">address_validators</span> {
- <span class="ident">validator</span>.<span class="ident">validate</span>(<span class="ident">script_type</span>, <span class="kw-2">&</span><span class="ident">hd_keypaths</span>, <span class="kw-2">&</span><span class="ident">script</span>)<span class="question-mark">?</span>;
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">index</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">cache_addresses</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">script_type</span>: <span class="ident">ScriptType</span>,
- <span class="ident">from</span>: <span class="ident">u32</span>,
- <span class="kw-2">mut</span> <span class="ident">count</span>: <span class="ident">u32</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> (<span class="ident">descriptor</span>, <span class="ident">script_type</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">script_type</span>);
- <span class="kw">if</span> <span class="ident">descriptor</span>.<span class="ident">is_fixed</span>() {
- <span class="kw">if</span> <span class="ident">from</span> <span class="op">></span> <span class="number">0</span> {
- <span class="kw">return</span> <span class="prelude-val">Ok</span>(());
- }
-
- <span class="ident">count</span> <span class="op">=</span> <span class="number">1</span>;
- }
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">address_batch</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">begin_batch</span>();
-
- <span class="kw">let</span> <span class="ident">start_time</span> <span class="op">=</span> <span class="ident">time</span>::<span class="ident">Instant</span>::<span class="ident">new</span>();
- <span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="ident">from</span>..(<span class="ident">from</span> <span class="op">+</span> <span class="ident">count</span>) {
- <span class="ident">address_batch</span>.<span class="ident">set_script_pubkey</span>(
- <span class="kw-2">&</span><span class="ident">descriptor</span>
- .<span class="ident">derive</span>(<span class="kw-2">&</span>[<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">i</span>).<span class="ident">unwrap</span>()])
- .<span class="ident">script_pubkey</span>(),
- <span class="ident">script_type</span>,
- <span class="ident">i</span>,
- )<span class="question-mark">?</span>;
- }
-
- <span class="macro">info</span><span class="macro">!</span>(
- <span class="string">"Derivation of {} addresses from {} took {} ms"</span>,
- <span class="ident">count</span>,
- <span class="ident">from</span>,
- <span class="ident">start_time</span>.<span class="ident">elapsed</span>().<span class="ident">as_millis</span>()
- );
-
- <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">commit_batch</span>(<span class="ident">address_batch</span>)<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">fn</span> <span class="ident">get_available_utxos</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">change_policy</span>: <span class="ident">tx_builder</span>::<span class="ident">ChangeSpendPolicy</span>,
- <span class="ident">utxo</span>: <span class="kw-2">&</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">OutPoint</span><span class="op">></span><span class="op">></span>,
- <span class="ident">unspendable</span>: <span class="kw-2">&</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">OutPoint</span><span class="op">></span><span class="op">></span>,
- <span class="ident">send_all</span>: <span class="ident">bool</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">bool</span>), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">unspendable_set</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">unspendable</span> {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="ident">HashSet</span>::<span class="ident">new</span>(),
- <span class="prelude-val">Some</span>(<span class="ident">vec</span>) <span class="op">=</span><span class="op">></span> <span class="ident">vec</span>.<span class="ident">into_iter</span>().<span class="ident">collect</span>(),
- };
-
- <span class="kw">match</span> <span class="ident">utxo</span> {
- <span class="comment">// with manual coin selection we always want to spend all the selected utxos, no matter</span>
- <span class="comment">// what (even if they are marked as unspendable)</span>
- <span class="prelude-val">Some</span>(<span class="ident">raw_utxos</span>) <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">full_utxos</span> <span class="op">=</span> <span class="ident">raw_utxos</span>
- .<span class="ident">iter</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">get_utxo</span>(<span class="kw-2">&</span><span class="ident">u</span>))
- .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="kw">_</span><span class="op">></span><span class="op">></span>()<span class="question-mark">?</span>;
- <span class="kw">if</span> <span class="op">!</span><span class="ident">full_utxos</span>.<span class="ident">iter</span>().<span class="ident">all</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="ident">u</span>.<span class="ident">is_some</span>()) {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">UnknownUTXO</span>);
- }
-
- <span class="prelude-val">Ok</span>((<span class="ident">full_utxos</span>.<span class="ident">into_iter</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span>.<span class="ident">unwrap</span>()).<span class="ident">collect</span>(), <span class="bool-val">true</span>))
- }
- <span class="comment">// otherwise limit ourselves to the spendable utxos for the selected policy, and the `send_all` setting</span>
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">utxos</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">list_unspent</span>()<span class="question-mark">?</span>.<span class="ident">into_iter</span>();
- <span class="kw">let</span> <span class="ident">utxos</span> <span class="op">=</span> <span class="ident">change_policy</span>.<span class="ident">filter_utxos</span>(<span class="ident">utxos</span>).<span class="ident">into_iter</span>();
-
- <span class="prelude-val">Ok</span>((
- <span class="ident">utxos</span>
- .<span class="ident">filter</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="op">!</span><span class="ident">unspendable_set</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">u</span>.<span class="ident">outpoint</span>))
- .<span class="ident">collect</span>(),
- <span class="ident">send_all</span>,
- ))
- }
- }
- }
-
- <span class="kw">fn</span> <span class="ident">complete_transaction</span><span class="op"><</span><span class="ident">Cs</span>: <span class="ident">coin_selection</span>::<span class="ident">CoinSelectionAlgorithm</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">tx</span>: <span class="ident">Transaction</span>,
- <span class="ident">prev_script_pubkeys</span>: <span class="ident">HashMap</span><span class="op"><</span><span class="ident">OutPoint</span>, <span class="ident">Script</span><span class="op">></span>,
- <span class="ident">builder</span>: <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">Cs</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">PSBT</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">psbt</span> <span class="op">=</span> <span class="ident">PSBT</span>::<span class="ident">from_unsigned_tx</span>(<span class="ident">tx</span>)<span class="question-mark">?</span>;
-
- <span class="comment">// add metadata for the inputs</span>
- <span class="kw">for</span> (<span class="ident">psbt_input</span>, <span class="ident">input</span>) <span class="kw">in</span> <span class="ident">psbt</span>
- .<span class="ident">inputs</span>
- .<span class="ident">iter_mut</span>()
- .<span class="ident">zip</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">input</span>.<span class="ident">iter</span>())
- {
- <span class="kw">let</span> <span class="ident">prev_script</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">prev_script_pubkeys</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">previous_output</span>) {
- <span class="prelude-val">Some</span>(<span class="ident">prev_script</span>) <span class="op">=</span><span class="op">></span> <span class="ident">prev_script</span>,
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">continue</span>,
- };
-
- <span class="comment">// Add sighash, default is obviously "ALL"</span>
- <span class="ident">psbt_input</span>.<span class="ident">sighash_type</span> <span class="op">=</span> <span class="ident">builder</span>.<span class="ident">sighash</span>.<span class="ident">or</span>(<span class="prelude-val">Some</span>(<span class="ident">SigHashType</span>::<span class="ident">All</span>));
-
- <span class="comment">// Try to find the prev_script in our db to figure out if this is internal or external,</span>
- <span class="comment">// and the derivation index</span>
- <span class="kw">let</span> (<span class="ident">script_type</span>, <span class="ident">child</span>) <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow</span>()
- .<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">prev_script</span>)<span class="question-mark">?</span>
- {
- <span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="op">=</span><span class="op">></span> <span class="ident">x</span>,
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">continue</span>,
- };
-
- <span class="kw">let</span> (<span class="ident">desc</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">script_type</span>);
- <span class="ident">psbt_input</span>.<span class="ident">hd_keypaths</span> <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">get_hd_keypaths</span>(<span class="ident">child</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">derived_descriptor</span> <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">derive</span>(<span class="kw-2">&</span>[<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">child</span>).<span class="ident">unwrap</span>()]);
-
- <span class="ident">psbt_input</span>.<span class="ident">redeem_script</span> <span class="op">=</span> <span class="ident">derived_descriptor</span>.<span class="ident">psbt_redeem_script</span>();
- <span class="ident">psbt_input</span>.<span class="ident">witness_script</span> <span class="op">=</span> <span class="ident">derived_descriptor</span>.<span class="ident">psbt_witness_script</span>();
-
- <span class="kw">let</span> <span class="ident">prev_output</span> <span class="op">=</span> <span class="ident">input</span>.<span class="ident">previous_output</span>;
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">prev_tx</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">get_raw_tx</span>(<span class="kw-2">&</span><span class="ident">prev_output</span>.<span class="ident">txid</span>)<span class="question-mark">?</span> {
- <span class="kw">if</span> <span class="ident">derived_descriptor</span>.<span class="ident">is_witness</span>() {
- <span class="ident">psbt_input</span>.<span class="ident">witness_utxo</span> <span class="op">=</span>
- <span class="prelude-val">Some</span>(<span class="ident">prev_tx</span>.<span class="ident">output</span>[<span class="ident">prev_output</span>.<span class="ident">vout</span> <span class="kw">as</span> <span class="ident">usize</span>].<span class="ident">clone</span>());
- }
- <span class="kw">if</span> <span class="op">!</span><span class="ident">derived_descriptor</span>.<span class="ident">is_witness</span>() <span class="op">|</span><span class="op">|</span> <span class="ident">builder</span>.<span class="ident">force_non_witness_utxo</span> {
- <span class="ident">psbt_input</span>.<span class="ident">non_witness_utxo</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">prev_tx</span>);
- }
- }
- }
-
- <span class="comment">// probably redundant but it doesn't hurt...</span>
- <span class="self">self</span>.<span class="ident">add_input_hd_keypaths</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">psbt</span>)<span class="question-mark">?</span>;
-
- <span class="comment">// add metadata for the outputs</span>
- <span class="kw">for</span> (<span class="ident">psbt_output</span>, <span class="ident">tx_output</span>) <span class="kw">in</span> <span class="ident">psbt</span>
- .<span class="ident">outputs</span>
- .<span class="ident">iter_mut</span>()
- .<span class="ident">zip</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>.<span class="ident">iter</span>())
- {
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">script_type</span>, <span class="ident">child</span>)) <span class="op">=</span> <span class="self">self</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow</span>()
- .<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">tx_output</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span>
- {
- <span class="kw">let</span> (<span class="ident">desc</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">script_type</span>);
- <span class="ident">psbt_output</span>.<span class="ident">hd_keypaths</span> <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">get_hd_keypaths</span>(<span class="ident">child</span>)<span class="question-mark">?</span>;
- }
- }
-
- <span class="prelude-val">Ok</span>(<span class="ident">psbt</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">add_input_hd_keypaths</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">psbt</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">PSBT</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">input_utxos</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">len</span>());
- <span class="kw">for</span> <span class="ident">n</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">len</span>() {
- <span class="ident">input_utxos</span>.<span class="ident">push</span>(<span class="ident">psbt</span>.<span class="ident">get_utxo_for</span>(<span class="ident">n</span>).<span class="ident">clone</span>());
- }
-
- <span class="comment">// try to add hd_keypaths if we've already seen the output</span>
- <span class="kw">for</span> (<span class="ident">psbt_input</span>, <span class="ident">out</span>) <span class="kw">in</span> <span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">iter_mut</span>().<span class="ident">zip</span>(<span class="ident">input_utxos</span>.<span class="ident">iter</span>()) {
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">out</span>) <span class="op">=</span> <span class="ident">out</span> {
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">script_type</span>, <span class="ident">child</span>)) <span class="op">=</span> <span class="self">self</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow</span>()
- .<span class="ident">get_path_from_script_pubkey</span>(<span class="kw-2">&</span><span class="ident">out</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span>
- {
- <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"Found descriptor {:?}/{}"</span>, <span class="ident">script_type</span>, <span class="ident">child</span>);
-
- <span class="comment">// merge hd_keypaths</span>
- <span class="kw">let</span> (<span class="ident">desc</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_script_type</span>(<span class="ident">script_type</span>);
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">hd_keypaths</span> <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">get_hd_keypaths</span>(<span class="ident">child</span>)<span class="question-mark">?</span>;
- <span class="ident">psbt_input</span>.<span class="ident">hd_keypaths</span>.<span class="ident">append</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">hd_keypaths</span>);
- }
- }
- }
-
- <span class="prelude-val">Ok</span>(())
- }
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">B</span>, <span class="ident">D</span><span class="op">></span> <span class="ident">Wallet</span><span class="op"><</span><span class="ident">B</span>, <span class="ident">D</span><span class="op">></span>
-<span class="kw">where</span>
- <span class="ident">B</span>: <span class="ident">OnlineBlockchain</span>,
- <span class="ident">D</span>: <span class="ident">BatchDatabase</span>,
-{
- <span class="doccomment">/// Create a new "online" wallet</span>
- <span class="attribute">#[<span class="ident">maybe_async</span>]</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(
- <span class="ident">descriptor</span>: <span class="kw-2">&</span><span class="ident">str</span>,
- <span class="ident">change_descriptor</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">str</span><span class="op">></span>,
- <span class="ident">network</span>: <span class="ident">Network</span>,
- <span class="ident">database</span>: <span class="ident">D</span>,
- <span class="ident">client</span>: <span class="ident">B</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">wallet</span> <span class="op">=</span> <span class="self">Self</span>::<span class="ident">new_offline</span>(<span class="ident">descriptor</span>, <span class="ident">change_descriptor</span>, <span class="ident">network</span>, <span class="ident">database</span>)<span class="question-mark">?</span>;
-
- <span class="ident">wallet</span>.<span class="ident">current_height</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="macro">maybe_await</span><span class="macro">!</span>(<span class="ident">client</span>.<span class="ident">get_height</span>())<span class="question-mark">?</span> <span class="kw">as</span> <span class="ident">u32</span>);
- <span class="ident">wallet</span>.<span class="ident">client</span> <span class="op">=</span> <span class="ident">client</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">wallet</span>)
- }
-
- <span class="doccomment">/// Sync the internal database with the blockchain</span>
- <span class="attribute">#[<span class="ident">maybe_async</span>]</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">sync</span><span class="op"><</span><span class="ident">P</span>: <span class="lifetime">'static</span> <span class="op">+</span> <span class="ident">Progress</span><span class="op">></span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">progress_update</span>: <span class="ident">P</span>,
- <span class="ident">max_address_param</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
- <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"Begin sync..."</span>);
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">run_setup</span> <span class="op">=</span> <span class="bool-val">false</span>;
-
- <span class="kw">let</span> <span class="ident">max_address</span> <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span>.<span class="ident">descriptor</span>.<span class="ident">is_fixed</span>() {
- <span class="bool-val">true</span> <span class="op">=</span><span class="op">></span> <span class="number">0</span>,
- <span class="bool-val">false</span> <span class="op">=</span><span class="op">></span> <span class="ident">max_address_param</span>.<span class="ident">unwrap_or</span>(<span class="ident">CACHE_ADDR_BATCH_SIZE</span>),
- };
- <span class="kw">if</span> <span class="self">self</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow</span>()
- .<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="ident">max_address</span>)<span class="question-mark">?</span>
- .<span class="ident">is_none</span>()
- {
- <span class="ident">run_setup</span> <span class="op">=</span> <span class="bool-val">true</span>;
- <span class="self">self</span>.<span class="ident">cache_addresses</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="number">0</span>, <span class="ident">max_address</span>)<span class="question-mark">?</span>;
- }
-
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">change_descriptor</span>) <span class="op">=</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">change_descriptor</span> {
- <span class="kw">let</span> <span class="ident">max_address</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">change_descriptor</span>.<span class="ident">is_fixed</span>() {
- <span class="bool-val">true</span> <span class="op">=</span><span class="op">></span> <span class="number">0</span>,
- <span class="bool-val">false</span> <span class="op">=</span><span class="op">></span> <span class="ident">max_address_param</span>.<span class="ident">unwrap_or</span>(<span class="ident">CACHE_ADDR_BATCH_SIZE</span>),
- };
-
- <span class="kw">if</span> <span class="self">self</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow</span>()
- .<span class="ident">get_script_pubkey_from_path</span>(
- <span class="ident">ScriptType</span>::<span class="ident">Internal</span>,
- <span class="ident">max_address</span>.<span class="ident">checked_sub</span>(<span class="number">1</span>).<span class="ident">unwrap_or</span>(<span class="number">0</span>),
- )<span class="question-mark">?</span>
- .<span class="ident">is_none</span>()
- {
- <span class="ident">run_setup</span> <span class="op">=</span> <span class="bool-val">true</span>;
- <span class="self">self</span>.<span class="ident">cache_addresses</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>, <span class="number">0</span>, <span class="ident">max_address</span>)<span class="question-mark">?</span>;
- }
- }
-
- <span class="comment">// TODO: what if i generate an address first and cache some addresses?</span>
- <span class="comment">// TODO: we should sync if generating an address triggers a new batch to be stored</span>
- <span class="kw">if</span> <span class="ident">run_setup</span> {
- <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">client</span>.<span class="ident">setup</span>(
- <span class="prelude-val">None</span>,
- <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">deref_mut</span>(),
- <span class="ident">progress_update</span>,
- ))
- } <span class="kw">else</span> {
- <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">client</span>.<span class="ident">sync</span>(
- <span class="prelude-val">None</span>,
- <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">deref_mut</span>(),
- <span class="ident">progress_update</span>,
- ))
- }
- }
-
- <span class="doccomment">/// Return a reference to the internal blockchain client</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">client</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="kw-2">&</span><span class="ident">B</span> {
- <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">client</span>
- }
-
- <span class="doccomment">/// Broadcast a transaction to the network</span>
- <span class="attribute">#[<span class="ident">maybe_async</span>]</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">broadcast</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="ident">Transaction</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Txid</span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">client</span>.<span class="ident">broadcast</span>(<span class="kw-2">&</span><span class="ident">tx</span>))<span class="question-mark">?</span>;
-
- <span class="prelude-val">Ok</span>(<span class="ident">tx</span>.<span class="ident">txid</span>())
- }
-}
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="kw">mod</span> <span class="ident">test</span> {
- <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
-
- <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">Network</span>;
-
- <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">memory</span>::<span class="ident">MemoryDatabase</span>;
- <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">Database</span>;
- <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">ScriptType</span>;
-
- <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_cache_addresses_fixed</span>() {
- <span class="kw">let</span> <span class="ident">db</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">new</span>();
- <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(
- <span class="string">"wpkh(L5EZftvrYaSudiozVRzTqLcHLNDoVn7H5HSfM9BAN6tMJX8oTWz6)"</span>,
- <span class="prelude-val">None</span>,
- <span class="ident">Network</span>::<span class="ident">Testnet</span>,
- <span class="ident">db</span>,
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>().<span class="ident">to_string</span>(),
- <span class="string">"tb1qj08ys4ct2hzzc2hcz6h2hgrvlmsjynaw43s835"</span>
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>().<span class="ident">to_string</span>(),
- <span class="string">"tb1qj08ys4ct2hzzc2hcz6h2hgrvlmsjynaw43s835"</span>
- );
-
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="number">0</span>)
- .<span class="ident">unwrap</span>()
- .<span class="ident">is_some</span>());
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">ScriptType</span>::<span class="ident">Internal</span>, <span class="number">0</span>)
- .<span class="ident">unwrap</span>()
- .<span class="ident">is_none</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_cache_addresses</span>() {
- <span class="kw">let</span> <span class="ident">db</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">new</span>();
- <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(<span class="string">"wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)"</span>, <span class="prelude-val">None</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>, <span class="ident">db</span>).<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>().<span class="ident">to_string</span>(),
- <span class="string">"tb1q6yn66vajcctph75pvylgkksgpp6nq04ppwct9a"</span>
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>().<span class="ident">to_string</span>(),
- <span class="string">"tb1q4er7kxx6sssz3q7qp7zsqsdx4erceahhax77d7"</span>
- );
-
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="ident">CACHE_ADDR_BATCH_SIZE</span> <span class="op">-</span> <span class="number">1</span>)
- .<span class="ident">unwrap</span>()
- .<span class="ident">is_some</span>());
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="ident">CACHE_ADDR_BATCH_SIZE</span>)
- .<span class="ident">unwrap</span>()
- .<span class="ident">is_none</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_cache_addresses_refill</span>() {
- <span class="kw">let</span> <span class="ident">db</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">new</span>();
- <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(<span class="string">"wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)"</span>, <span class="prelude-val">None</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>, <span class="ident">db</span>).<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>().<span class="ident">to_string</span>(),
- <span class="string">"tb1q6yn66vajcctph75pvylgkksgpp6nq04ppwct9a"</span>
- );
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="ident">CACHE_ADDR_BATCH_SIZE</span> <span class="op">-</span> <span class="number">1</span>)
- .<span class="ident">unwrap</span>()
- .<span class="ident">is_some</span>());
-
- <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">CACHE_ADDR_BATCH_SIZE</span> {
- <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- }
-
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">get_script_pubkey_from_path</span>(<span class="ident">ScriptType</span>::<span class="ident">External</span>, <span class="ident">CACHE_ADDR_BATCH_SIZE</span> <span class="op">*</span> <span class="number">2</span> <span class="op">-</span> <span class="number">1</span>)
- .<span class="ident">unwrap</span>()
- .<span class="ident">is_some</span>());
- }
-
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">get_test_wpkh</span>() <span class="op">-</span><span class="op">></span> <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span> {
- <span class="string">"wpkh(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW)"</span>
- }
-
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">get_test_single_sig_csv</span>() <span class="op">-</span><span class="op">></span> <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span> {
- <span class="comment">// and(pk(Alice),older(6))</span>
- <span class="string">"wsh(and_v(v:pk(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW),older(6)))"</span>
- }
-
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">get_test_single_sig_cltv</span>() <span class="op">-</span><span class="op">></span> <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span> {
- <span class="comment">// and(pk(Alice),after(100000))</span>
- <span class="string">"wsh(and_v(v:pk(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW),after(100000)))"</span>
- }
-
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">get_funded_wallet</span>(
- <span class="ident">descriptor</span>: <span class="kw-2">&</span><span class="ident">str</span>,
- ) <span class="op">-</span><span class="op">></span> (
- <span class="ident">OfflineWallet</span><span class="op"><</span><span class="ident">MemoryDatabase</span><span class="op">></span>,
- (<span class="ident">String</span>, <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>),
- <span class="ident">bitcoin</span>::<span class="ident">Txid</span>,
- ) {
- <span class="kw">let</span> <span class="ident">descriptors</span> <span class="op">=</span> <span class="macro">testutils</span><span class="macro">!</span>(@<span class="ident">descriptors</span> (<span class="ident">descriptor</span>));
- <span class="kw">let</span> <span class="ident">wallet</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(
- <span class="kw-2">&</span><span class="ident">descriptors</span>.<span class="number">0</span>,
- <span class="prelude-val">None</span>,
- <span class="ident">Network</span>::<span class="ident">Regtest</span>,
- <span class="ident">MemoryDatabase</span>::<span class="ident">new</span>(),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">received_tx</span>(
- <span class="macro">testutils</span><span class="macro">!</span> {
- @<span class="ident">tx</span> ( (@<span class="ident">external</span> <span class="ident">descriptors</span>, <span class="number">0</span>) <span class="op">=</span><span class="op">></span> <span class="number">50_000</span> ) (@<span class="ident">confirmations</span> <span class="number">1</span>)
- },
- <span class="prelude-val">Some</span>(<span class="number">100</span>),
- );
-
- (<span class="ident">wallet</span>, <span class="ident">descriptors</span>, <span class="ident">txid</span>)
- }
-
- <span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">assert_fee_rate</span> {
- (<span class="macro-nonterminal">$</span><span class="macro-nonterminal">tx</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">fees</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">fee_rate</span>:<span class="ident">expr</span> $( ,@<span class="ident">dust_change</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">dust_change</span>:<span class="ident">expr</span> )<span class="op">*</span> )<span class="op">*</span> $( ,@<span class="ident">add_signature</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">add_signature</span>:<span class="ident">expr</span> )<span class="op">*</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> ({
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">tx</span>.<span class="ident">clone</span>();
- $(
- $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">add_signature</span> )<span class="op">*</span>
- <span class="kw">for</span> <span class="ident">txin</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
- <span class="ident">txin</span>.<span class="ident">witness</span>.<span class="ident">push</span>([<span class="number">0x00</span>; <span class="number">108</span>].<span class="ident">to_vec</span>()); <span class="comment">// fake signature</span>
- }
- )<span class="op">*</span>
-
- <span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_mut</span>)]</span>
- <span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_assignments</span>)]</span>
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">dust_change</span> <span class="op">=</span> <span class="bool-val">false</span>;
- $(
- $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">dust_change</span> )<span class="op">*</span>
- <span class="ident">dust_change</span> <span class="op">=</span> <span class="bool-val">true</span>;
- )<span class="op">*</span>
-
- <span class="kw">let</span> <span class="ident">tx_fee_rate</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">fees</span> <span class="kw">as</span> <span class="ident">f32</span> <span class="op">/</span> (<span class="ident">tx</span>.<span class="ident">get_weight</span>() <span class="kw">as</span> <span class="ident">f32</span> <span class="op">/</span> <span class="number">4.0</span>);
- <span class="kw">let</span> <span class="ident">fee_rate</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">fee_rate</span>.<span class="ident">as_sat_vb</span>();
-
- <span class="kw">if</span> <span class="op">!</span><span class="ident">dust_change</span> {
- <span class="macro">assert</span><span class="macro">!</span>((<span class="ident">tx_fee_rate</span> <span class="op">-</span> <span class="ident">fee_rate</span>).<span class="ident">abs</span>() <span class="op"><</span> <span class="number">0.5</span>, <span class="macro">format</span><span class="macro">!</span>(<span class="string">"Expected fee rate of {}, the tx has {}"</span>, <span class="ident">fee_rate</span>, <span class="ident">tx_fee_rate</span>));
- } <span class="kw">else</span> {
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">tx_fee_rate</span> <span class="op">></span><span class="op">=</span> <span class="ident">fee_rate</span>, <span class="macro">format</span><span class="macro">!</span>(<span class="string">"Expected fee rate of at least {}, the tx has {}"</span>, <span class="ident">fee_rate</span>, <span class="ident">tx_fee_rate</span>));
- }
- });
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"NoAddressees"</span>)]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_empty_recipients</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[]).<span class="ident">version</span>(<span class="number">0</span>))
- .<span class="ident">unwrap</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"Invalid version `0`"</span>)]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_version_0</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">version</span>(<span class="number">0</span>))
- .<span class="ident">unwrap</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(
- <span class="ident">expected</span> <span class="op">=</span> <span class="string">"TxBuilder requested version `1`, but at least `2` is needed to use OP_CSV"</span>
- )]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_version_1_csv</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_single_sig_csv</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">version</span>(<span class="number">1</span>))
- .<span class="ident">unwrap</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_custom_version</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">version</span>(<span class="number">42</span>))
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">version</span>, <span class="number">42</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_default_locktime</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
- <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
- <span class="number">25_000</span>,
- )]))
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">lock_time</span>, <span class="number">0</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_default_locktime_cltv</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_single_sig_cltv</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
- <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
- <span class="number">25_000</span>,
- )]))
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">lock_time</span>, <span class="number">100_000</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_custom_locktime</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">nlocktime</span>(<span class="number">630_000</span>),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">lock_time</span>, <span class="number">630_000</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_custom_locktime_compatible_with_cltv</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_single_sig_cltv</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">nlocktime</span>(<span class="number">630_000</span>),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">lock_time</span>, <span class="number">630_000</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(
- <span class="ident">expected</span> <span class="op">=</span> <span class="string">"TxBuilder requested timelock of `50000`, but at least `100000` is required to spend from this script"</span>
- )]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_custom_locktime_incompatible_with_cltv</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_single_sig_cltv</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">nlocktime</span>(<span class="number">50000</span>),
- )
- .<span class="ident">unwrap</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_no_rbf_csv</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_single_sig_csv</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
- <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
- <span class="number">25_000</span>,
- )]))
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">sequence</span>, <span class="number">6</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_with_default_rbf_csv</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_single_sig_csv</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">enable_rbf</span>(),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">sequence</span>, <span class="number">0xFFFFFFFD</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(
- <span class="ident">expected</span> <span class="op">=</span> <span class="string">"Cannot enable RBF with nSequence `3`, since at least `6` is required to spend with OP_CSV"</span>
- )]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_with_custom_rbf_csv</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_single_sig_csv</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)])
- .<span class="ident">enable_rbf_with_sequence</span>(<span class="number">3</span>),
- )
- .<span class="ident">unwrap</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_no_rbf_cltv</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_single_sig_cltv</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
- <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
- <span class="number">25_000</span>,
- )]))
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">sequence</span>, <span class="number">0xFFFFFFFE</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"Cannot enable RBF with a nSequence >= 0xFFFFFFFE"</span>)]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_invalid_rbf_sequence</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)])
- .<span class="ident">enable_rbf_with_sequence</span>(<span class="number">0xFFFFFFFE</span>),
- )
- .<span class="ident">unwrap</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_custom_rbf_sequence</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)])
- .<span class="ident">enable_rbf_with_sequence</span>(<span class="number">0xDEADBEEF</span>),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">sequence</span>, <span class="number">0xDEADBEEF</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_default_sequence</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
- <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
- <span class="number">25_000</span>,
- )]))
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">sequence</span>, <span class="number">0xFFFFFFFF</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(
- <span class="ident">expected</span> <span class="op">=</span> <span class="string">"The `change_policy` can be set only if the wallet has a change_descriptor"</span>
- )]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_change_policy_no_internal</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)])
- .<span class="ident">do_not_spend_change</span>(),
- )
- .<span class="ident">unwrap</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"SendAllMultipleOutputs"</span>)]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_send_all_multiple_outputs</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[
- (<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>),
- (<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">10_000</span>),
- ])
- .<span class="ident">send_all</span>(),
- )
- .<span class="ident">unwrap</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_send_all</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">1</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>[<span class="number">0</span>].<span class="ident">value</span>,
- <span class="number">50_000</span> <span class="op">-</span> <span class="ident">details</span>.<span class="ident">fees</span>
- );
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_default_fee_rate</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_fee_rate</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">extract_tx</span>(), <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">FeeRate</span>::<span class="ident">default</span>(), @<span class="ident">add_signature</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_custom_fee_rate</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)])
- .<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">5.0</span>))
- .<span class="ident">send_all</span>(),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_fee_rate</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">extract_tx</span>(), <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">5.0</span>), @<span class="ident">add_signature</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_add_change</span>() {
- <span class="kw">use</span> <span class="kw">super</span>::<span class="ident">tx_builder</span>::<span class="ident">TxOrdering</span>;
-
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)])
- .<span class="ident">ordering</span>(<span class="ident">TxOrdering</span>::<span class="ident">Untouched</span>),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>[<span class="number">0</span>].<span class="ident">value</span>, <span class="number">25_000</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>[<span class="number">1</span>].<span class="ident">value</span>,
- <span class="number">25_000</span> <span class="op">-</span> <span class="ident">details</span>.<span class="ident">fees</span>
- );
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_skip_change_dust</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
- <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
- <span class="number">49_800</span>,
- )]))
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">1</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>[<span class="number">0</span>].<span class="ident">value</span>, <span class="number">49_800</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"InsufficientFunds"</span>)]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_send_all_dust_amount</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="comment">// very high fee rate, so that the only output would be below dust</span>
- <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)])
- .<span class="ident">send_all</span>()
- .<span class="ident">fee_rate</span>(<span class="kw">crate</span>::<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">453.0</span>)),
- )
- .<span class="ident">unwrap</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_ordering_respected</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[
- (<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">30_000</span>),
- (<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">10_000</span>),
- ])
- .<span class="ident">ordering</span>(<span class="kw">super</span>::<span class="ident">tx_builder</span>::<span class="ident">TxOrdering</span>::<span class="ident">BIP69Lexicographic</span>),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">3</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>[<span class="number">0</span>].<span class="ident">value</span>,
- <span class="number">10_000</span> <span class="op">-</span> <span class="ident">details</span>.<span class="ident">fees</span>
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>[<span class="number">1</span>].<span class="ident">value</span>, <span class="number">10_000</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">output</span>[<span class="number">2</span>].<span class="ident">value</span>, <span class="number">30_000</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_default_sighash</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
- <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
- <span class="number">30_000</span>,
- )]))
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">sighash_type</span>, <span class="prelude-val">Some</span>(<span class="ident">bitcoin</span>::<span class="ident">SigHashType</span>::<span class="ident">All</span>));
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_custom_sighash</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">30_000</span>)])
- .<span class="ident">sighash</span>(<span class="ident">bitcoin</span>::<span class="ident">SigHashType</span>::<span class="ident">Single</span>),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">sighash_type</span>,
- <span class="prelude-val">Some</span>(<span class="ident">bitcoin</span>::<span class="ident">SigHashType</span>::<span class="ident">Single</span>)
- );
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_input_hd_keypaths</span>() {
- <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::{<span class="ident">DerivationPath</span>, <span class="ident">Fingerprint</span>};
- <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
-
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="string">"wpkh([d34db33f/44'/0'/0']xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL/0/*)"</span>);
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">hd_keypaths</span>.<span class="ident">len</span>(), <span class="number">1</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">hd_keypaths</span>.<span class="ident">values</span>().<span class="ident">nth</span>(<span class="number">0</span>).<span class="ident">unwrap</span>(),
- <span class="kw-2">&</span>(
- <span class="ident">Fingerprint</span>::<span class="ident">from_str</span>(<span class="string">"d34db33f"</span>).<span class="ident">unwrap</span>(),
- <span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/44'/0'/0'/0/0"</span>).<span class="ident">unwrap</span>()
- )
- );
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_output_hd_keypaths</span>() {
- <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::{<span class="ident">DerivationPath</span>, <span class="ident">Fingerprint</span>};
- <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
-
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="ident">descriptors</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="string">"wpkh([d34db33f/44'/0'/0']xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL/0/*)"</span>);
- <span class="comment">// cache some addresses</span>
- <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="macro">testutils</span><span class="macro">!</span>(@<span class="ident">external</span> <span class="ident">descriptors</span>, <span class="number">5</span>);
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">outputs</span>[<span class="number">0</span>].<span class="ident">hd_keypaths</span>.<span class="ident">len</span>(), <span class="number">1</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">psbt</span>.<span class="ident">outputs</span>[<span class="number">0</span>].<span class="ident">hd_keypaths</span>.<span class="ident">values</span>().<span class="ident">nth</span>(<span class="number">0</span>).<span class="ident">unwrap</span>(),
- <span class="kw-2">&</span>(
- <span class="ident">Fingerprint</span>::<span class="ident">from_str</span>(<span class="string">"d34db33f"</span>).<span class="ident">unwrap</span>(),
- <span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/44'/0'/0'/0/5"</span>).<span class="ident">unwrap</span>()
- )
- );
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_set_redeem_script_p2sh</span>() {
- <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">FromHex</span>;
-
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span>
- <span class="ident">get_funded_wallet</span>(<span class="string">"sh(pk(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW))"</span>);
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">redeem_script</span>,
- <span class="prelude-val">Some</span>(<span class="ident">Script</span>::<span class="ident">from</span>(
- <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(
- <span class="string">"21032b0558078bec38694a84933d659303e2575dae7e91685911454115bfd64487e3ac"</span>
- )
- .<span class="ident">unwrap</span>()
- ))
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">witness_script</span>, <span class="prelude-val">None</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_set_witness_script_p2wsh</span>() {
- <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">FromHex</span>;
-
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span>
- <span class="ident">get_funded_wallet</span>(<span class="string">"wsh(pk(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW))"</span>);
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">redeem_script</span>, <span class="prelude-val">None</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">witness_script</span>,
- <span class="prelude-val">Some</span>(<span class="ident">Script</span>::<span class="ident">from</span>(
- <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(
- <span class="string">"21032b0558078bec38694a84933d659303e2575dae7e91685911454115bfd64487e3ac"</span>
- )
- .<span class="ident">unwrap</span>()
- ))
- );
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_set_redeem_witness_script_p2wsh_p2sh</span>() {
- <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">FromHex</span>;
-
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span>
- <span class="ident">get_funded_wallet</span>(<span class="string">"sh(wsh(pk(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW)))"</span>);
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
- .<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="ident">Script</span>::<span class="ident">from</span>(
- <span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(
- <span class="string">"21032b0558078bec38694a84933d659303e2575dae7e91685911454115bfd64487e3ac"</span>,
- )
- .<span class="ident">unwrap</span>(),
- );
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">redeem_script</span>, <span class="prelude-val">Some</span>(<span class="ident">script</span>.<span class="ident">to_v0_p2wsh</span>()));
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">witness_script</span>, <span class="prelude-val">Some</span>(<span class="ident">script</span>));
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_non_witness_utxo</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span>
- <span class="ident">get_funded_wallet</span>(<span class="string">"sh(pk(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW))"</span>);
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">non_witness_utxo</span>.<span class="ident">is_some</span>());
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">witness_utxo</span>.<span class="ident">is_none</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_only_witness_utxo</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span>
- <span class="ident">get_funded_wallet</span>(<span class="string">"wsh(pk(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW))"</span>);
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">non_witness_utxo</span>.<span class="ident">is_none</span>());
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">witness_utxo</span>.<span class="ident">is_some</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_create_tx_both_non_witness_utxo_and_witness_utxo</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span>
- <span class="ident">get_funded_wallet</span>(<span class="string">"wsh(pk(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW))"</span>);
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)])
- .<span class="ident">force_non_witness_utxo</span>()
- .<span class="ident">send_all</span>(),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">non_witness_utxo</span>.<span class="ident">is_some</span>());
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">witness_utxo</span>.<span class="ident">is_some</span>());
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"IrreplaceableTransaction"</span>)]</span>
- <span class="kw">fn</span> <span class="ident">test_bump_fee_irreplaceable_tx</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
- <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
- <span class="number">25_000</span>,
- )]))
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
- <span class="comment">// skip saving the utxos, we know they can't be used anyways</span>
- <span class="ident">details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
- <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">details</span>).<span class="ident">unwrap</span>();
-
- <span class="ident">wallet</span>.<span class="ident">bump_fee</span>(<span class="kw-2">&</span><span class="ident">txid</span>, <span class="ident">TxBuilder</span>::<span class="ident">new</span>()).<span class="ident">unwrap</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"TransactionConfirmed"</span>)]</span>
- <span class="kw">fn</span> <span class="ident">test_bump_fee_confirmed_tx</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(
- <span class="ident">addr</span>.<span class="ident">script_pubkey</span>(),
- <span class="number">25_000</span>,
- )]))
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
- <span class="comment">// skip saving the utxos, we know they can't be used anyways</span>
- <span class="ident">details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
- <span class="ident">details</span>.<span class="ident">height</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="number">42</span>);
- <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">details</span>).<span class="ident">unwrap</span>();
-
- <span class="ident">wallet</span>.<span class="ident">bump_fee</span>(<span class="kw-2">&</span><span class="ident">txid</span>, <span class="ident">TxBuilder</span>::<span class="ident">new</span>()).<span class="ident">unwrap</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"FeeRateTooLow"</span>)]</span>
- <span class="kw">fn</span> <span class="ident">test_bump_fee_low_fee_rate</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">enable_rbf</span>(),
- )
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
- <span class="comment">// skip saving the utxos, we know they can't be used anyways</span>
- <span class="ident">details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
- <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">details</span>).<span class="ident">unwrap</span>();
-
- <span class="ident">wallet</span>
- .<span class="ident">bump_fee</span>(
- <span class="kw-2">&</span><span class="ident">txid</span>,
- <span class="ident">TxBuilder</span>::<span class="ident">new</span>().<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">1.0</span>)),
- )
- .<span class="ident">unwrap</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_bump_fee_reduce_change</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="string">"2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX"</span>).<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">original_details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">25_000</span>)]).<span class="ident">enable_rbf</span>(),
- )
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
- <span class="comment">// skip saving the new utxos, we know they can't be used anyways</span>
- <span class="kw">for</span> <span class="ident">txin</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
- <span class="ident">txin</span>.<span class="ident">witness</span>.<span class="ident">push</span>([<span class="number">0x00</span>; <span class="number">108</span>].<span class="ident">to_vec</span>()); <span class="comment">// fake signature</span>
- <span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">previous_output</span>)
- .<span class="ident">unwrap</span>();
- }
- <span class="ident">original_details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
- <span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">original_details</span>)
- .<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">bump_fee</span>(
- <span class="kw-2">&</span><span class="ident">txid</span>,
- <span class="ident">TxBuilder</span>::<span class="ident">new</span>().<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">2.5</span>)),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">sent</span>, <span class="ident">original_details</span>.<span class="ident">sent</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">details</span>.<span class="ident">received</span> <span class="op">+</span> <span class="ident">details</span>.<span class="ident">fees</span>,
- <span class="ident">original_details</span>.<span class="ident">received</span> <span class="op">+</span> <span class="ident">original_details</span>.<span class="ident">fees</span>
- );
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">fees</span> <span class="op">></span> <span class="ident">original_details</span>.<span class="ident">fees</span>);
-
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>;
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tx</span>.<span class="ident">output</span>
- .<span class="ident">iter</span>()
- .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">=</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
- .<span class="ident">unwrap</span>()
- .<span class="ident">value</span>,
- <span class="number">25_000</span>
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tx</span>.<span class="ident">output</span>
- .<span class="ident">iter</span>()
- .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">!</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
- .<span class="ident">unwrap</span>()
- .<span class="ident">value</span>,
- <span class="ident">details</span>.<span class="ident">received</span>
- );
-
- <span class="macro">assert_fee_rate</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">extract_tx</span>(), <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">2.5</span>), @<span class="ident">add_signature</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_bump_fee_reduce_send_all</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="string">"2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX"</span>).<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">original_details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)])
- .<span class="ident">send_all</span>()
- .<span class="ident">enable_rbf</span>(),
- )
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
- <span class="kw">for</span> <span class="ident">txin</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
- <span class="ident">txin</span>.<span class="ident">witness</span>.<span class="ident">push</span>([<span class="number">0x00</span>; <span class="number">108</span>].<span class="ident">to_vec</span>()); <span class="comment">// fake signature</span>
- <span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">previous_output</span>)
- .<span class="ident">unwrap</span>();
- }
- <span class="ident">original_details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
- <span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">original_details</span>)
- .<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">bump_fee</span>(
- <span class="kw-2">&</span><span class="ident">txid</span>,
- <span class="ident">TxBuilder</span>::<span class="ident">new</span>()
- .<span class="ident">send_all</span>()
- .<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">2.5</span>)),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">sent</span>, <span class="ident">original_details</span>.<span class="ident">sent</span>);
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">fees</span> <span class="op">></span> <span class="ident">original_details</span>.<span class="ident">fees</span>);
-
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>;
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">1</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>[<span class="number">0</span>].<span class="ident">value</span> <span class="op">+</span> <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">details</span>.<span class="ident">sent</span>);
-
- <span class="macro">assert_fee_rate</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">extract_tx</span>(), <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">2.5</span>), @<span class="ident">add_signature</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"InsufficientFunds"</span>)]</span>
- <span class="kw">fn</span> <span class="ident">test_bump_fee_remove_send_all_output</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="ident">descriptors</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="comment">// receive an extra tx, to make sure that in case of "send_all" we get an error and it</span>
- <span class="comment">// doesn't try to pick more inputs</span>
- <span class="kw">let</span> <span class="ident">incoming_txid</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">received_tx</span>(
- <span class="macro">testutils</span><span class="macro">!</span> (@<span class="ident">tx</span> ( (@<span class="ident">external</span> <span class="ident">descriptors</span>, <span class="number">0</span>) <span class="op">=</span><span class="op">></span> <span class="number">25_000</span> ) (@<span class="ident">confirmations</span> <span class="number">1</span>)),
- <span class="prelude-val">Some</span>(<span class="number">100</span>),
- );
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="string">"2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX"</span>).<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">original_details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)])
- .<span class="ident">utxos</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">OutPoint</span> {
- <span class="ident">txid</span>: <span class="ident">incoming_txid</span>,
- <span class="ident">vout</span>: <span class="number">0</span>,
- }])
- .<span class="ident">send_all</span>()
- .<span class="ident">enable_rbf</span>(),
- )
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
- <span class="kw">for</span> <span class="ident">txin</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
- <span class="ident">txin</span>.<span class="ident">witness</span>.<span class="ident">push</span>([<span class="number">0x00</span>; <span class="number">108</span>].<span class="ident">to_vec</span>()); <span class="comment">// fake signature</span>
- <span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">previous_output</span>)
- .<span class="ident">unwrap</span>();
- }
- <span class="ident">original_details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
- <span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">original_details</span>)
- .<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">original_details</span>.<span class="ident">sent</span>, <span class="number">25_000</span>);
-
- <span class="ident">wallet</span>
- .<span class="ident">bump_fee</span>(
- <span class="kw-2">&</span><span class="ident">txid</span>,
- <span class="ident">TxBuilder</span>::<span class="ident">new</span>()
- .<span class="ident">send_all</span>()
- .<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">225.0</span>)),
- )
- .<span class="ident">unwrap</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_bump_fee_add_input</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="ident">descriptors</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">received_tx</span>(
- <span class="macro">testutils</span><span class="macro">!</span> (@<span class="ident">tx</span> ( (@<span class="ident">external</span> <span class="ident">descriptors</span>, <span class="number">0</span>) <span class="op">=</span><span class="op">></span> <span class="number">25_000</span> ) (@<span class="ident">confirmations</span> <span class="number">1</span>)),
- <span class="prelude-val">Some</span>(<span class="number">100</span>),
- );
-
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="string">"2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX"</span>).<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">original_details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">45_000</span>)]).<span class="ident">enable_rbf</span>(),
- )
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
- <span class="comment">// skip saving the new utxos, we know they can't be used anyways</span>
- <span class="kw">for</span> <span class="ident">txin</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
- <span class="ident">txin</span>.<span class="ident">witness</span>.<span class="ident">push</span>([<span class="number">0x00</span>; <span class="number">108</span>].<span class="ident">to_vec</span>()); <span class="comment">// fake signature</span>
- <span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">previous_output</span>)
- .<span class="ident">unwrap</span>();
- }
- <span class="ident">original_details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
- <span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">original_details</span>)
- .<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">bump_fee</span>(
- <span class="kw-2">&</span><span class="ident">txid</span>,
- <span class="ident">TxBuilder</span>::<span class="ident">new</span>().<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">50.0</span>)),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">sent</span>, <span class="ident">original_details</span>.<span class="ident">sent</span> <span class="op">+</span> <span class="number">25_000</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">fees</span> <span class="op">+</span> <span class="ident">details</span>.<span class="ident">received</span>, <span class="number">30_000</span>);
-
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>;
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tx</span>.<span class="ident">output</span>
- .<span class="ident">iter</span>()
- .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">=</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
- .<span class="ident">unwrap</span>()
- .<span class="ident">value</span>,
- <span class="number">45_000</span>
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tx</span>.<span class="ident">output</span>
- .<span class="ident">iter</span>()
- .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">!</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
- .<span class="ident">unwrap</span>()
- .<span class="ident">value</span>,
- <span class="ident">details</span>.<span class="ident">received</span>
- );
-
- <span class="macro">assert_fee_rate</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">extract_tx</span>(), <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">50.0</span>), @<span class="ident">add_signature</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_bump_fee_no_change_add_input_and_change</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="ident">descriptors</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">incoming_txid</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">received_tx</span>(
- <span class="macro">testutils</span><span class="macro">!</span> (@<span class="ident">tx</span> ( (@<span class="ident">external</span> <span class="ident">descriptors</span>, <span class="number">0</span>) <span class="op">=</span><span class="op">></span> <span class="number">25_000</span> ) (@<span class="ident">confirmations</span> <span class="number">1</span>)),
- <span class="prelude-val">Some</span>(<span class="number">100</span>),
- );
-
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="string">"2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX"</span>).<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">original_details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)])
- .<span class="ident">send_all</span>()
- .<span class="ident">add_utxo</span>(<span class="ident">OutPoint</span> {
- <span class="ident">txid</span>: <span class="ident">incoming_txid</span>,
- <span class="ident">vout</span>: <span class="number">0</span>,
- })
- .<span class="ident">enable_rbf</span>(),
- )
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
- <span class="comment">// skip saving the new utxos, we know they can't be used anyways</span>
- <span class="kw">for</span> <span class="ident">txin</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
- <span class="ident">txin</span>.<span class="ident">witness</span>.<span class="ident">push</span>([<span class="number">0x00</span>; <span class="number">108</span>].<span class="ident">to_vec</span>()); <span class="comment">// fake signature</span>
- <span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">previous_output</span>)
- .<span class="ident">unwrap</span>();
- }
- <span class="ident">original_details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
- <span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">original_details</span>)
- .<span class="ident">unwrap</span>();
-
- <span class="comment">// NOTE: we don't set "send_all" here. so we have a transaction with only one input, but</span>
- <span class="comment">// here we are allowed to add more, and we will also have to add a change</span>
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">bump_fee</span>(
- <span class="kw-2">&</span><span class="ident">txid</span>,
- <span class="ident">TxBuilder</span>::<span class="ident">new</span>().<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">50.0</span>)),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> <span class="ident">original_send_all_amount</span> <span class="op">=</span> <span class="ident">original_details</span>.<span class="ident">sent</span> <span class="op">-</span> <span class="ident">original_details</span>.<span class="ident">fees</span>;
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">sent</span>, <span class="ident">original_details</span>.<span class="ident">sent</span> <span class="op">+</span> <span class="number">50_000</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">details</span>.<span class="ident">received</span>,
- <span class="number">75_000</span> <span class="op">-</span> <span class="ident">original_send_all_amount</span> <span class="op">-</span> <span class="ident">details</span>.<span class="ident">fees</span>
- );
-
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>;
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tx</span>.<span class="ident">output</span>
- .<span class="ident">iter</span>()
- .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">=</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
- .<span class="ident">unwrap</span>()
- .<span class="ident">value</span>,
- <span class="ident">original_send_all_amount</span>
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tx</span>.<span class="ident">output</span>
- .<span class="ident">iter</span>()
- .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">!</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
- .<span class="ident">unwrap</span>()
- .<span class="ident">value</span>,
- <span class="number">75_000</span> <span class="op">-</span> <span class="ident">original_send_all_amount</span> <span class="op">-</span> <span class="ident">details</span>.<span class="ident">fees</span>
- );
-
- <span class="macro">assert_fee_rate</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">extract_tx</span>(), <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">50.0</span>), @<span class="ident">add_signature</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_bump_fee_add_input_change_dust</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="ident">descriptors</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">received_tx</span>(
- <span class="macro">testutils</span><span class="macro">!</span> (@<span class="ident">tx</span> ( (@<span class="ident">external</span> <span class="ident">descriptors</span>, <span class="number">0</span>) <span class="op">=</span><span class="op">></span> <span class="number">25_000</span> ) (@<span class="ident">confirmations</span> <span class="number">1</span>)),
- <span class="prelude-val">Some</span>(<span class="number">100</span>),
- );
-
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="string">"2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX"</span>).<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">original_details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">45_000</span>)]).<span class="ident">enable_rbf</span>(),
- )
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">len</span>(), <span class="number">1</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
- <span class="comment">// skip saving the new utxos, we know they can't be used anyways</span>
- <span class="kw">for</span> <span class="ident">txin</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
- <span class="ident">txin</span>.<span class="ident">witness</span>.<span class="ident">push</span>([<span class="number">0x00</span>; <span class="number">108</span>].<span class="ident">to_vec</span>()); <span class="comment">// fake signature</span>
- <span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">previous_output</span>)
- .<span class="ident">unwrap</span>();
- }
- <span class="ident">original_details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
- <span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">original_details</span>)
- .<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">bump_fee</span>(
- <span class="kw-2">&</span><span class="ident">txid</span>,
- <span class="ident">TxBuilder</span>::<span class="ident">new</span>().<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">140.0</span>)),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">original_details</span>.<span class="ident">received</span>, <span class="number">5_000</span> <span class="op">-</span> <span class="ident">original_details</span>.<span class="ident">fees</span>);
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">sent</span>, <span class="ident">original_details</span>.<span class="ident">sent</span> <span class="op">+</span> <span class="number">25_000</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">fees</span>, <span class="number">30_000</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">received</span>, <span class="number">0</span>);
-
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>;
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">1</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tx</span>.<span class="ident">output</span>
- .<span class="ident">iter</span>()
- .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">=</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
- .<span class="ident">unwrap</span>()
- .<span class="ident">value</span>,
- <span class="number">45_000</span>
- );
-
- <span class="macro">assert_fee_rate</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">extract_tx</span>(), <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">140.0</span>), @<span class="ident">dust_change</span>, @<span class="ident">add_signature</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_bump_fee_force_add_input</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="ident">descriptors</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="ident">get_test_wpkh</span>());
- <span class="kw">let</span> <span class="ident">incoming_txid</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>().<span class="ident">received_tx</span>(
- <span class="macro">testutils</span><span class="macro">!</span> (@<span class="ident">tx</span> ( (@<span class="ident">external</span> <span class="ident">descriptors</span>, <span class="number">0</span>) <span class="op">=</span><span class="op">></span> <span class="number">25_000</span> ) (@<span class="ident">confirmations</span> <span class="number">1</span>)),
- <span class="prelude-val">Some</span>(<span class="number">100</span>),
- );
-
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">Address</span>::<span class="ident">from_str</span>(<span class="string">"2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX"</span>).<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw-2">mut</span> <span class="ident">original_details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(
- <span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">45_000</span>)]).<span class="ident">enable_rbf</span>(),
- )
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">extract_tx</span>();
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
- <span class="comment">// skip saving the new utxos, we know they can't be used anyways</span>
- <span class="kw">for</span> <span class="ident">txin</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>.<span class="ident">input</span> {
- <span class="ident">txin</span>.<span class="ident">witness</span>.<span class="ident">push</span>([<span class="number">0x00</span>; <span class="number">108</span>].<span class="ident">to_vec</span>()); <span class="comment">// fake signature</span>
- <span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">previous_output</span>)
- .<span class="ident">unwrap</span>();
- }
- <span class="ident">original_details</span>.<span class="ident">transaction</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">tx</span>);
- <span class="ident">wallet</span>
- .<span class="ident">database</span>
- .<span class="ident">borrow_mut</span>()
- .<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">original_details</span>)
- .<span class="ident">unwrap</span>();
-
- <span class="comment">// the new fee_rate is low enough that just reducing the change would be fine, but we force</span>
- <span class="comment">// the addition of an extra input with `add_utxo()`</span>
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">details</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">bump_fee</span>(
- <span class="kw-2">&</span><span class="ident">txid</span>,
- <span class="ident">TxBuilder</span>::<span class="ident">new</span>()
- .<span class="ident">add_utxo</span>(<span class="ident">OutPoint</span> {
- <span class="ident">txid</span>: <span class="ident">incoming_txid</span>,
- <span class="ident">vout</span>: <span class="number">0</span>,
- })
- .<span class="ident">fee_rate</span>(<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">5.0</span>)),
- )
- .<span class="ident">unwrap</span>();
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">sent</span>, <span class="ident">original_details</span>.<span class="ident">sent</span> <span class="op">+</span> <span class="number">25_000</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">fees</span> <span class="op">+</span> <span class="ident">details</span>.<span class="ident">received</span>, <span class="number">30_000</span>);
-
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>;
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tx</span>.<span class="ident">output</span>
- .<span class="ident">iter</span>()
- .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">=</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
- .<span class="ident">unwrap</span>()
- .<span class="ident">value</span>,
- <span class="number">45_000</span>
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tx</span>.<span class="ident">output</span>
- .<span class="ident">iter</span>()
- .<span class="ident">find</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> <span class="ident">txout</span>.<span class="ident">script_pubkey</span> <span class="op">!</span><span class="op">=</span> <span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
- .<span class="ident">unwrap</span>()
- .<span class="ident">value</span>,
- <span class="ident">details</span>.<span class="ident">received</span>
- );
-
- <span class="macro">assert_fee_rate</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">extract_tx</span>(), <span class="ident">details</span>.<span class="ident">fees</span>, <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">5.0</span>), @<span class="ident">add_signature</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_sign_single_xprv</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="string">"wpkh(tprv8ZgxMBicQKsPd3EupYiPRhaMooHKUHJxNsTfYuScep13go8QFfHdtkG9nRkFGb7busX4isf6X9dURGCoKgitaApQ6MupRhZMcELAxTBRJgS/*)"</span>);
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
- .<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> (<span class="ident">signed_psbt</span>, <span class="ident">finalized</span>) <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">sign</span>(<span class="ident">psbt</span>, <span class="prelude-val">None</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">finalized</span>, <span class="bool-val">true</span>);
-
- <span class="kw">let</span> <span class="ident">extracted</span> <span class="op">=</span> <span class="ident">signed_psbt</span>.<span class="ident">extract_tx</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">extracted</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">witness</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_sign_single_wif</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span>
- <span class="ident">get_funded_wallet</span>(<span class="string">"wpkh(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW)"</span>);
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
- .<span class="ident">unwrap</span>();
-
- <span class="kw">let</span> (<span class="ident">signed_psbt</span>, <span class="ident">finalized</span>) <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">sign</span>(<span class="ident">psbt</span>, <span class="prelude-val">None</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">finalized</span>, <span class="bool-val">true</span>);
-
- <span class="kw">let</span> <span class="ident">extracted</span> <span class="op">=</span> <span class="ident">signed_psbt</span>.<span class="ident">extract_tx</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">extracted</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">witness</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_sign_single_xprv_no_hd_keypaths</span>() {
- <span class="kw">let</span> (<span class="ident">wallet</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">get_funded_wallet</span>(<span class="string">"wpkh(tprv8ZgxMBicQKsPd3EupYiPRhaMooHKUHJxNsTfYuScep13go8QFfHdtkG9nRkFGb7busX4isf6X9dURGCoKgitaApQ6MupRhZMcELAxTBRJgS/*)"</span>);
- <span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>().<span class="ident">unwrap</span>();
- <span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">psbt</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet</span>
- .<span class="ident">create_tx</span>(<span class="ident">TxBuilder</span>::<span class="ident">with_recipients</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>(), <span class="number">0</span>)]).<span class="ident">send_all</span>())
- .<span class="ident">unwrap</span>();
-
- <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">hd_keypaths</span>.<span class="ident">clear</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="number">0</span>].<span class="ident">hd_keypaths</span>.<span class="ident">len</span>(), <span class="number">0</span>);
-
- <span class="kw">let</span> (<span class="ident">signed_psbt</span>, <span class="ident">finalized</span>) <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">sign</span>(<span class="ident">psbt</span>, <span class="prelude-val">None</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">finalized</span>, <span class="bool-val">true</span>);
-
- <span class="kw">let</span> <span class="ident">extracted</span> <span class="op">=</span> <span class="ident">signed_psbt</span>.<span class="ident">extract_tx</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">extracted</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">witness</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/wallet/rbf.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>rbf.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::<span class="ident">Database</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="kw-2">*</span>;
-
-<span class="doccomment">/// Filters unspent utxos</span>
-<span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">fn</span> <span class="ident">filter_available</span><span class="op"><</span><span class="ident">I</span>: <span class="ident">Iterator</span><span class="op"><</span><span class="ident">Item</span> <span class="op">=</span> <span class="ident">UTXO</span><span class="op">></span>, <span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span>(
- <span class="ident">database</span>: <span class="kw-2">&</span><span class="ident">D</span>,
- <span class="ident">iter</span>: <span class="ident">I</span>,
-) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
- <span class="prelude-val">Ok</span>(<span class="ident">iter</span>
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">utxo</span><span class="op">|</span> {
- <span class="prelude-val">Ok</span>(<span class="kw">match</span> <span class="ident">database</span>.<span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="ident">utxo</span>.<span class="ident">outpoint</span>.<span class="ident">txid</span>, <span class="bool-val">true</span>)<span class="question-mark">?</span> {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
- <span class="prelude-val">Some</span>(<span class="ident">tx</span>) <span class="kw">if</span> <span class="ident">tx</span>.<span class="ident">height</span>.<span class="ident">is_none</span>() <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
- <span class="prelude-val">Some</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">utxo</span>),
- })
- })
- .<span class="ident">collect</span>::<span class="op"><</span><span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span><span class="op">></span>()<span class="question-mark">?</span>
- .<span class="ident">into_iter</span>()
- .<span class="ident">filter_map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span>)
- .<span class="ident">collect</span>())
-}
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="kw">mod</span> <span class="ident">test</span> {
- <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
-
- <span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">OutPoint</span>, <span class="ident">Transaction</span>, <span class="ident">TxIn</span>, <span class="ident">TxOut</span>, <span class="ident">Txid</span>};
-
- <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
- <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">database</span>::{<span class="ident">BatchOperations</span>, <span class="ident">MemoryDatabase</span>};
-
- <span class="kw">fn</span> <span class="ident">add_transaction</span>(
- <span class="ident">database</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">MemoryDatabase</span>,
- <span class="ident">spend</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">OutPoint</span><span class="op">></span>,
- <span class="ident">outputs</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">u64</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="ident">Txid</span> {
- <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">Transaction</span> {
- <span class="ident">version</span>: <span class="number">1</span>,
- <span class="ident">lock_time</span>: <span class="number">0</span>,
- <span class="ident">input</span>: <span class="ident">spend</span>
- .<span class="ident">iter</span>()
- .<span class="ident">cloned</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">previous_output</span><span class="op">|</span> <span class="ident">TxIn</span> {
- <span class="ident">previous_output</span>,
- ..<span class="ident">Default</span>::<span class="ident">default</span>()
- })
- .<span class="ident">collect</span>(),
- <span class="ident">output</span>: <span class="ident">outputs</span>
- .<span class="ident">iter</span>()
- .<span class="ident">cloned</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">value</span><span class="op">|</span> <span class="ident">TxOut</span> {
- <span class="ident">value</span>,
- ..<span class="ident">Default</span>::<span class="ident">default</span>()
- })
- .<span class="ident">collect</span>(),
- };
- <span class="kw">let</span> <span class="ident">txid</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">txid</span>();
-
- <span class="kw">for</span> <span class="ident">input</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">spend</span> {
- <span class="ident">database</span>.<span class="ident">del_utxo</span>(<span class="ident">input</span>).<span class="ident">unwrap</span>();
- }
- <span class="kw">for</span> <span class="ident">vout</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">outputs</span>.<span class="ident">len</span>() {
- <span class="ident">database</span>
- .<span class="ident">set_utxo</span>(<span class="kw-2">&</span><span class="ident">UTXO</span> {
- <span class="ident">txout</span>: <span class="ident">tx</span>.<span class="ident">output</span>[<span class="ident">vout</span>].<span class="ident">clone</span>(),
- <span class="ident">outpoint</span>: <span class="ident">OutPoint</span> {
- <span class="ident">txid</span>,
- <span class="ident">vout</span>: <span class="ident">vout</span> <span class="kw">as</span> <span class="ident">u32</span>,
- },
- <span class="ident">is_internal</span>: <span class="bool-val">true</span>,
- })
- .<span class="ident">unwrap</span>();
- }
- <span class="ident">database</span>
- .<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">TransactionDetails</span> {
- <span class="ident">txid</span>,
- <span class="ident">transaction</span>: <span class="prelude-val">Some</span>(<span class="ident">tx</span>),
- <span class="ident">height</span>: <span class="prelude-val">None</span>,
- ..<span class="ident">Default</span>::<span class="ident">default</span>()
- })
- .<span class="ident">unwrap</span>();
-
- <span class="ident">txid</span>
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_filter_available</span>() {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">database</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">new</span>();
- <span class="ident">add_transaction</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">database</span>,
- <span class="macro">vec</span><span class="macro">!</span>[<span class="ident">OutPoint</span>::<span class="ident">from_str</span>(
- <span class="string">"aad194c72fd5cfd16d23da9462930ca91e35df1cfee05242b62f4034f50c3d41:5"</span>,
- )
- .<span class="ident">unwrap</span>()],
- <span class="macro">vec</span><span class="macro">!</span>[<span class="number">50_000</span>],
- );
-
- <span class="kw">let</span> <span class="ident">filtered</span> <span class="op">=</span>
- <span class="ident">filter_available</span>(<span class="kw-2">&</span><span class="ident">database</span>, <span class="ident">database</span>.<span class="ident">iter_utxos</span>().<span class="ident">unwrap</span>().<span class="ident">into_iter</span>()).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">filtered</span>, <span class="kw-2">&</span>[]);
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/wallet/signer.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>signer.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-<span id="203">203</span>
-<span id="204">204</span>
-<span id="205">205</span>
-<span id="206">206</span>
-<span id="207">207</span>
-<span id="208">208</span>
-<span id="209">209</span>
-<span id="210">210</span>
-<span id="211">211</span>
-<span id="212">212</span>
-<span id="213">213</span>
-<span id="214">214</span>
-<span id="215">215</span>
-<span id="216">216</span>
-<span id="217">217</span>
-<span id="218">218</span>
-<span id="219">219</span>
-<span id="220">220</span>
-<span id="221">221</span>
-<span id="222">222</span>
-<span id="223">223</span>
-<span id="224">224</span>
-<span id="225">225</span>
-<span id="226">226</span>
-<span id="227">227</span>
-<span id="228">228</span>
-<span id="229">229</span>
-<span id="230">230</span>
-<span id="231">231</span>
-<span id="232">232</span>
-<span id="233">233</span>
-<span id="234">234</span>
-<span id="235">235</span>
-<span id="236">236</span>
-<span id="237">237</span>
-<span id="238">238</span>
-<span id="239">239</span>
-<span id="240">240</span>
-<span id="241">241</span>
-<span id="242">242</span>
-<span id="243">243</span>
-<span id="244">244</span>
-<span id="245">245</span>
-<span id="246">246</span>
-<span id="247">247</span>
-<span id="248">248</span>
-<span id="249">249</span>
-<span id="250">250</span>
-<span id="251">251</span>
-<span id="252">252</span>
-<span id="253">253</span>
-<span id="254">254</span>
-<span id="255">255</span>
-<span id="256">256</span>
-<span id="257">257</span>
-<span id="258">258</span>
-<span id="259">259</span>
-<span id="260">260</span>
-<span id="261">261</span>
-<span id="262">262</span>
-<span id="263">263</span>
-<span id="264">264</span>
-<span id="265">265</span>
-<span id="266">266</span>
-<span id="267">267</span>
-<span id="268">268</span>
-<span id="269">269</span>
-<span id="270">270</span>
-<span id="271">271</span>
-<span id="272">272</span>
-<span id="273">273</span>
-<span id="274">274</span>
-<span id="275">275</span>
-<span id="276">276</span>
-<span id="277">277</span>
-<span id="278">278</span>
-<span id="279">279</span>
-<span id="280">280</span>
-<span id="281">281</span>
-<span id="282">282</span>
-<span id="283">283</span>
-<span id="284">284</span>
-<span id="285">285</span>
-<span id="286">286</span>
-<span id="287">287</span>
-<span id="288">288</span>
-<span id="289">289</span>
-<span id="290">290</span>
-<span id="291">291</span>
-<span id="292">292</span>
-<span id="293">293</span>
-<span id="294">294</span>
-<span id="295">295</span>
-<span id="296">296</span>
-<span id="297">297</span>
-<span id="298">298</span>
-<span id="299">299</span>
-<span id="300">300</span>
-<span id="301">301</span>
-<span id="302">302</span>
-<span id="303">303</span>
-<span id="304">304</span>
-<span id="305">305</span>
-<span id="306">306</span>
-<span id="307">307</span>
-<span id="308">308</span>
-<span id="309">309</span>
-<span id="310">310</span>
-<span id="311">311</span>
-<span id="312">312</span>
-<span id="313">313</span>
-<span id="314">314</span>
-<span id="315">315</span>
-<span id="316">316</span>
-<span id="317">317</span>
-<span id="318">318</span>
-<span id="319">319</span>
-<span id="320">320</span>
-<span id="321">321</span>
-<span id="322">322</span>
-<span id="323">323</span>
-<span id="324">324</span>
-<span id="325">325</span>
-<span id="326">326</span>
-<span id="327">327</span>
-<span id="328">328</span>
-<span id="329">329</span>
-<span id="330">330</span>
-<span id="331">331</span>
-<span id="332">332</span>
-<span id="333">333</span>
-<span id="334">334</span>
-<span id="335">335</span>
-<span id="336">336</span>
-<span id="337">337</span>
-<span id="338">338</span>
-<span id="339">339</span>
-<span id="340">340</span>
-<span id="341">341</span>
-<span id="342">342</span>
-<span id="343">343</span>
-<span id="344">344</span>
-<span id="345">345</span>
-<span id="346">346</span>
-<span id="347">347</span>
-<span id="348">348</span>
-<span id="349">349</span>
-<span id="350">350</span>
-<span id="351">351</span>
-<span id="352">352</span>
-<span id="353">353</span>
-<span id="354">354</span>
-<span id="355">355</span>
-<span id="356">356</span>
-<span id="357">357</span>
-<span id="358">358</span>
-<span id="359">359</span>
-<span id="360">360</span>
-<span id="361">361</span>
-<span id="362">362</span>
-<span id="363">363</span>
-<span id="364">364</span>
-<span id="365">365</span>
-<span id="366">366</span>
-<span id="367">367</span>
-<span id="368">368</span>
-<span id="369">369</span>
-<span id="370">370</span>
-<span id="371">371</span>
-<span id="372">372</span>
-<span id="373">373</span>
-<span id="374">374</span>
-<span id="375">375</span>
-<span id="376">376</span>
-<span id="377">377</span>
-<span id="378">378</span>
-<span id="379">379</span>
-<span id="380">380</span>
-<span id="381">381</span>
-<span id="382">382</span>
-<span id="383">383</span>
-<span id="384">384</span>
-<span id="385">385</span>
-<span id="386">386</span>
-<span id="387">387</span>
-<span id="388">388</span>
-<span id="389">389</span>
-<span id="390">390</span>
-<span id="391">391</span>
-<span id="392">392</span>
-<span id="393">393</span>
-<span id="394">394</span>
-<span id="395">395</span>
-<span id="396">396</span>
-<span id="397">397</span>
-<span id="398">398</span>
-<span id="399">399</span>
-<span id="400">400</span>
-<span id="401">401</span>
-<span id="402">402</span>
-<span id="403">403</span>
-<span id="404">404</span>
-<span id="405">405</span>
-<span id="406">406</span>
-<span id="407">407</span>
-<span id="408">408</span>
-<span id="409">409</span>
-<span id="410">410</span>
-<span id="411">411</span>
-<span id="412">412</span>
-<span id="413">413</span>
-<span id="414">414</span>
-<span id="415">415</span>
-<span id="416">416</span>
-<span id="417">417</span>
-<span id="418">418</span>
-<span id="419">419</span>
-<span id="420">420</span>
-<span id="421">421</span>
-<span id="422">422</span>
-<span id="423">423</span>
-<span id="424">424</span>
-<span id="425">425</span>
-<span id="426">426</span>
-<span id="427">427</span>
-<span id="428">428</span>
-<span id="429">429</span>
-<span id="430">430</span>
-<span id="431">431</span>
-<span id="432">432</span>
-<span id="433">433</span>
-<span id="434">434</span>
-<span id="435">435</span>
-<span id="436">436</span>
-<span id="437">437</span>
-<span id="438">438</span>
-<span id="439">439</span>
-<span id="440">440</span>
-<span id="441">441</span>
-<span id="442">442</span>
-<span id="443">443</span>
-<span id="444">444</span>
-<span id="445">445</span>
-<span id="446">446</span>
-<span id="447">447</span>
-<span id="448">448</span>
-<span id="449">449</span>
-<span id="450">450</span>
-<span id="451">451</span>
-<span id="452">452</span>
-<span id="453">453</span>
-<span id="454">454</span>
-<span id="455">455</span>
-<span id="456">456</span>
-<span id="457">457</span>
-<span id="458">458</span>
-<span id="459">459</span>
-<span id="460">460</span>
-<span id="461">461</span>
-<span id="462">462</span>
-<span id="463">463</span>
-<span id="464">464</span>
-<span id="465">465</span>
-<span id="466">466</span>
-<span id="467">467</span>
-<span id="468">468</span>
-<span id="469">469</span>
-<span id="470">470</span>
-<span id="471">471</span>
-<span id="472">472</span>
-<span id="473">473</span>
-<span id="474">474</span>
-<span id="475">475</span>
-<span id="476">476</span>
-<span id="477">477</span>
-<span id="478">478</span>
-<span id="479">479</span>
-<span id="480">480</span>
-<span id="481">481</span>
-<span id="482">482</span>
-<span id="483">483</span>
-<span id="484">484</span>
-<span id="485">485</span>
-<span id="486">486</span>
-<span id="487">487</span>
-<span id="488">488</span>
-<span id="489">489</span>
-<span id="490">490</span>
-<span id="491">491</span>
-<span id="492">492</span>
-<span id="493">493</span>
-<span id="494">494</span>
-<span id="495">495</span>
-<span id="496">496</span>
-<span id="497">497</span>
-<span id="498">498</span>
-<span id="499">499</span>
-<span id="500">500</span>
-<span id="501">501</span>
-<span id="502">502</span>
-<span id="503">503</span>
-<span id="504">504</span>
-<span id="505">505</span>
-<span id="506">506</span>
-<span id="507">507</span>
-<span id="508">508</span>
-<span id="509">509</span>
-<span id="510">510</span>
-<span id="511">511</span>
-<span id="512">512</span>
-<span id="513">513</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="doccomment">//! Generalized signers</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! This module provides the ability to add customized signers to a [`Wallet`](super::Wallet)</span>
-<span class="doccomment">//! through the [`Wallet::add_signer`](super::Wallet::add_signer) function.</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ```</span>
-<span class="doccomment">//! # use std::sync::Arc;</span>
-<span class="doccomment">//! # use std::str::FromStr;</span>
-<span class="doccomment">//! # use bitcoin::*;</span>
-<span class="doccomment">//! # use bitcoin::util::psbt;</span>
-<span class="doccomment">//! # use bitcoin::util::bip32::Fingerprint;</span>
-<span class="doccomment">//! # use magical::signer::*;</span>
-<span class="doccomment">//! # use magical::database::*;</span>
-<span class="doccomment">//! # use magical::*;</span>
-<span class="doccomment">//! # #[derive(Debug)]</span>
-<span class="doccomment">//! # struct CustomHSM;</span>
-<span class="doccomment">//! # impl CustomHSM {</span>
-<span class="doccomment">//! # fn sign_input(&self, _psbt: &mut psbt::PartiallySignedTransaction, _input: usize) -> Result<(), SignerError> {</span>
-<span class="doccomment">//! # Ok(())</span>
-<span class="doccomment">//! # }</span>
-<span class="doccomment">//! # fn connect() -> Self {</span>
-<span class="doccomment">//! # CustomHSM</span>
-<span class="doccomment">//! # }</span>
-<span class="doccomment">//! # }</span>
-<span class="doccomment">//! #[derive(Debug)]</span>
-<span class="doccomment">//! struct CustomSigner {</span>
-<span class="doccomment">//! device: CustomHSM,</span>
-<span class="doccomment">//! }</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! impl CustomSigner {</span>
-<span class="doccomment">//! fn connect() -> Self {</span>
-<span class="doccomment">//! CustomSigner { device: CustomHSM::connect() }</span>
-<span class="doccomment">//! }</span>
-<span class="doccomment">//! }</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! impl Signer for CustomSigner {</span>
-<span class="doccomment">//! fn sign(</span>
-<span class="doccomment">//! &self,</span>
-<span class="doccomment">//! psbt: &mut psbt::PartiallySignedTransaction,</span>
-<span class="doccomment">//! input_index: Option<usize>,</span>
-<span class="doccomment">//! ) -> Result<(), SignerError> {</span>
-<span class="doccomment">//! let input_index = input_index.ok_or(SignerError::InputIndexOutOfRange)?;</span>
-<span class="doccomment">//! self.device.sign_input(psbt, input_index)?;</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! Ok(())</span>
-<span class="doccomment">//! }</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! fn sign_whole_tx(&self) -> bool {</span>
-<span class="doccomment">//! false</span>
-<span class="doccomment">//! }</span>
-<span class="doccomment">//! }</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! let custom_signer = CustomSigner::connect();</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! let descriptor = "wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)";</span>
-<span class="doccomment">//! let mut wallet: OfflineWallet<_> = Wallet::new_offline(descriptor, None, Network::Testnet, MemoryDatabase::default())?;</span>
-<span class="doccomment">//! wallet.add_signer(</span>
-<span class="doccomment">//! ScriptType::External,</span>
-<span class="doccomment">//! Fingerprint::from_str("e30f11b8").unwrap().into(),</span>
-<span class="doccomment">//! SignerOrdering(200),</span>
-<span class="doccomment">//! Arc::new(Box::new(custom_signer))</span>
-<span class="doccomment">//! );</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! # Ok::<_, magical::Error>(())</span>
-<span class="doccomment">//! ```</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">cmp</span>::<span class="ident">Ordering</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ops</span>::<span class="ident">Bound</span>::<span class="ident">Included</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>;
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">blockdata</span>::<span class="ident">opcodes</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">blockdata</span>::<span class="ident">script</span>::<span class="ident">Builder</span> <span class="kw">as</span> <span class="ident">ScriptBuilder</span>;
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::{<span class="ident">hash160</span>, <span class="ident">Hash</span>};
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">secp256k1</span>::{<span class="ident">Message</span>, <span class="ident">Secp256k1</span>};
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::{<span class="ident">ExtendedPrivKey</span>, <span class="ident">Fingerprint</span>};
-<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::{<span class="ident">bip143</span>, <span class="ident">psbt</span>};
-<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">PrivateKey</span>, <span class="ident">SigHash</span>, <span class="ident">SigHashType</span>};
-
-<span class="kw">use</span> <span class="ident">miniscript</span>::<span class="ident">descriptor</span>::{<span class="ident">DescriptorPublicKey</span>, <span class="ident">DescriptorSecretKey</span>, <span class="ident">DescriptorXKey</span>, <span class="ident">KeyMap</span>};
-<span class="kw">use</span> <span class="ident">miniscript</span>::{<span class="ident">Legacy</span>, <span class="ident">MiniscriptKey</span>, <span class="ident">Segwitv0</span>};
-
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">XKeyUtils</span>;
-
-<span class="doccomment">/// Identifier of a signer in the `SignersContainers`. Used as a key to find the right signer among</span>
-<span class="doccomment">/// multiple of them</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>, <span class="ident">Hash</span>)]</span>
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">SignerId</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> {
- <span class="ident">PkHash</span>(<span class="op"><</span><span class="ident">Pk</span> <span class="kw">as</span> <span class="ident">MiniscriptKey</span><span class="op">></span>::<span class="ident">Hash</span>),
- <span class="ident">Fingerprint</span>(<span class="ident">Fingerprint</span>),
-}
-
-<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">hash160</span>::<span class="ident">Hash</span><span class="op">></span> <span class="kw">for</span> <span class="ident">SignerId</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">hash</span>: <span class="ident">hash160</span>::<span class="ident">Hash</span>) <span class="op">-</span><span class="op">></span> <span class="ident">SignerId</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
- <span class="ident">SignerId</span>::<span class="ident">PkHash</span>(<span class="ident">hash</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">Fingerprint</span><span class="op">></span> <span class="kw">for</span> <span class="ident">SignerId</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">fing</span>: <span class="ident">Fingerprint</span>) <span class="op">-</span><span class="op">></span> <span class="ident">SignerId</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
- <span class="ident">SignerId</span>::<span class="ident">Fingerprint</span>(<span class="ident">fing</span>)
- }
-}
-
-<span class="doccomment">/// Signing error</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>, <span class="ident">Clone</span>)]</span>
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">SignerError</span> {
- <span class="doccomment">/// The private key is missing for the required public key</span>
- <span class="ident">MissingKey</span>,
- <span class="doccomment">/// The user canceled the operation</span>
- <span class="ident">UserCanceled</span>,
- <span class="doccomment">/// The sighash is missing in the PSBT input</span>
- <span class="ident">MissingSighash</span>,
- <span class="doccomment">/// Input index is out of range</span>
- <span class="ident">InputIndexOutOfRange</span>,
- <span class="doccomment">/// The `non_witness_utxo` field of the transaction is required to sign this input</span>
- <span class="ident">MissingNonWitnessUtxo</span>,
- <span class="doccomment">/// The `non_witness_utxo` specified is invalid</span>
- <span class="ident">InvalidNonWitnessUtxo</span>,
- <span class="doccomment">/// The `witness_utxo` field of the transaction is required to sign this input</span>
- <span class="ident">MissingWitnessUtxo</span>,
- <span class="doccomment">/// The `witness_script` field of the transaction is requied to sign this input</span>
- <span class="ident">MissingWitnessScript</span>,
- <span class="doccomment">/// The fingerprint and derivation path are missing from the psbt input</span>
- <span class="ident">MissingHDKeypath</span>,
-}
-
-<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">SignerError</span> {
- <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
- <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"{:?}"</span>, <span class="self">self</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span> <span class="kw">for</span> <span class="ident">SignerError</span> {}
-
-<span class="doccomment">/// Trait for signers</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// This trait can be implemented to provide customized signers to the wallet. For an example see</span>
-<span class="doccomment">/// [`this module`](crate::wallet::signer)'s documentation.</span>
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">Signer</span>: <span class="ident">fmt</span>::<span class="ident">Debug</span> {
- <span class="doccomment">/// Sign a PSBT</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// The `input_index` argument is only provided if the wallet doesn't declare to sign the whole</span>
- <span class="doccomment">/// transaction in one go (see [`Signer::sign_whole_tx`]). Otherwise its value is `None` and</span>
- <span class="doccomment">/// can be ignored.</span>
- <span class="kw">fn</span> <span class="ident">sign</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">psbt</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span>,
- <span class="ident">input_index</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">SignerError</span><span class="op">></span>;
-
- <span class="doccomment">/// Return whether or not the signer signs the whole transaction in one go instead of every</span>
- <span class="doccomment">/// input individually</span>
- <span class="kw">fn</span> <span class="ident">sign_whole_tx</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span>;
-
- <span class="doccomment">/// Return the secret key for the signer</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// This is used internally to reconstruct the original descriptor that may contain secrets.</span>
- <span class="doccomment">/// External signers that are meant to keep key isolated should just return `None` here (which</span>
- <span class="doccomment">/// is the default for this method, if not overridden).</span>
- <span class="kw">fn</span> <span class="ident">descriptor_secret_key</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">DescriptorSecretKey</span><span class="op">></span> {
- <span class="prelude-val">None</span>
- }
-}
-
-<span class="kw">impl</span> <span class="ident">Signer</span> <span class="kw">for</span> <span class="ident">DescriptorXKey</span><span class="op"><</span><span class="ident">ExtendedPrivKey</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">sign</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">psbt</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span>,
- <span class="ident">input_index</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">SignerError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">input_index</span> <span class="op">=</span> <span class="ident">input_index</span>.<span class="ident">unwrap</span>();
- <span class="kw">if</span> <span class="ident">input_index</span> <span class="op">></span><span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">len</span>() {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">SignerError</span>::<span class="ident">InputIndexOutOfRange</span>);
- }
-
- <span class="kw">let</span> <span class="ident">deriv_path</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="ident">input_index</span>]
- .<span class="ident">hd_keypaths</span>
- .<span class="ident">iter</span>()
- .<span class="ident">filter_map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="kw-2">&</span>(<span class="ident">fingerprint</span>, <span class="kw-2">ref</span> <span class="ident">path</span>))<span class="op">|</span> <span class="self">self</span>.<span class="ident">matches</span>(<span class="ident">fingerprint</span>.<span class="ident">clone</span>(), <span class="kw-2">&</span><span class="ident">path</span>))
- .<span class="ident">next</span>()
- {
- <span class="prelude-val">Some</span>(<span class="ident">deriv_path</span>) <span class="op">=</span><span class="op">></span> <span class="ident">deriv_path</span>,
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">Ok</span>(()), <span class="comment">// TODO: should report an error maybe?</span>
- };
-
- <span class="kw">let</span> <span class="ident">ctx</span> <span class="op">=</span> <span class="ident">Secp256k1</span>::<span class="ident">signing_only</span>();
-
- <span class="kw">let</span> <span class="ident">derived_key</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">xkey</span>.<span class="ident">derive_priv</span>(<span class="kw-2">&</span><span class="ident">ctx</span>, <span class="kw-2">&</span><span class="ident">deriv_path</span>).<span class="ident">unwrap</span>();
- <span class="ident">derived_key</span>.<span class="ident">private_key</span>.<span class="ident">sign</span>(<span class="ident">psbt</span>, <span class="prelude-val">Some</span>(<span class="ident">input_index</span>))
- }
-
- <span class="kw">fn</span> <span class="ident">sign_whole_tx</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="bool-val">false</span>
- }
-
- <span class="kw">fn</span> <span class="ident">descriptor_secret_key</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">DescriptorSecretKey</span><span class="op">></span> {
- <span class="prelude-val">Some</span>(<span class="ident">DescriptorSecretKey</span>::<span class="ident">XPrv</span>(<span class="self">self</span>.<span class="ident">clone</span>()))
- }
-}
-
-<span class="kw">impl</span> <span class="ident">Signer</span> <span class="kw">for</span> <span class="ident">PrivateKey</span> {
- <span class="kw">fn</span> <span class="ident">sign</span>(
- <span class="kw-2">&</span><span class="self">self</span>,
- <span class="ident">psbt</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span>,
- <span class="ident">input_index</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">SignerError</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">input_index</span> <span class="op">=</span> <span class="ident">input_index</span>.<span class="ident">unwrap</span>();
- <span class="kw">if</span> <span class="ident">input_index</span> <span class="op">></span><span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">len</span>() {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">SignerError</span>::<span class="ident">InputIndexOutOfRange</span>);
- }
-
- <span class="kw">let</span> <span class="ident">ctx</span> <span class="op">=</span> <span class="ident">Secp256k1</span>::<span class="ident">signing_only</span>();
-
- <span class="kw">let</span> <span class="ident">pubkey</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">public_key</span>(<span class="kw-2">&</span><span class="ident">ctx</span>);
- <span class="kw">if</span> <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="ident">input_index</span>].<span class="ident">partial_sigs</span>.<span class="ident">contains_key</span>(<span class="kw-2">&</span><span class="ident">pubkey</span>) {
- <span class="kw">return</span> <span class="prelude-val">Ok</span>(());
- }
-
- <span class="comment">// FIXME: use the presence of `witness_utxo` as an indication that we should make a bip143</span>
- <span class="comment">// sig. Does this make sense? Should we add an extra argument to explicitly swith between</span>
- <span class="comment">// these? The original idea was to declare sign() as sign<Ctx: ScriptContex>() and use Ctx,</span>
- <span class="comment">// but that violates the rules for trait-objects, so we can't do it.</span>
- <span class="kw">let</span> (<span class="ident">hash</span>, <span class="ident">sighash</span>) <span class="op">=</span> <span class="kw">match</span> <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="ident">input_index</span>].<span class="ident">witness_utxo</span> {
- <span class="prelude-val">Some</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Segwitv0</span>::<span class="ident">sighash</span>(<span class="ident">psbt</span>, <span class="ident">input_index</span>)<span class="question-mark">?</span>,
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="ident">Legacy</span>::<span class="ident">sighash</span>(<span class="ident">psbt</span>, <span class="ident">input_index</span>)<span class="question-mark">?</span>,
- };
-
- <span class="kw">let</span> <span class="ident">signature</span> <span class="op">=</span> <span class="ident">ctx</span>.<span class="ident">sign</span>(
- <span class="kw-2">&</span><span class="ident">Message</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">hash</span>.<span class="ident">into_inner</span>()[..]).<span class="ident">unwrap</span>(),
- <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">key</span>,
- );
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">final_signature</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="number">75</span>);
- <span class="ident">final_signature</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">signature</span>.<span class="ident">serialize_der</span>());
- <span class="ident">final_signature</span>.<span class="ident">push</span>(<span class="ident">sighash</span>.<span class="ident">as_u32</span>() <span class="kw">as</span> <span class="ident">u8</span>);
-
- <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="ident">input_index</span>]
- .<span class="ident">partial_sigs</span>
- .<span class="ident">insert</span>(<span class="ident">pubkey</span>, <span class="ident">final_signature</span>);
-
- <span class="prelude-val">Ok</span>(())
- }
-
- <span class="kw">fn</span> <span class="ident">sign_whole_tx</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="bool-val">false</span>
- }
-
- <span class="kw">fn</span> <span class="ident">descriptor_secret_key</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">DescriptorSecretKey</span><span class="op">></span> {
- <span class="prelude-val">Some</span>(<span class="ident">DescriptorSecretKey</span>::<span class="ident">PrivKey</span>(<span class="self">self</span>.<span class="ident">clone</span>()))
- }
-}
-
-<span class="doccomment">/// Defines the order in which signers are called</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// The default value is `100`. Signers with an ordering above that will be called later,</span>
-<span class="doccomment">/// and they will thus see the partial signatures added to the transaction once they get to sign</span>
-<span class="doccomment">/// themselves.</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">PartialOrd</span>, <span class="ident">PartialEq</span>, <span class="ident">Ord</span>, <span class="ident">Eq</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">SignerOrdering</span>(<span class="kw">pub</span> <span class="ident">usize</span>);
-
-<span class="kw">impl</span> <span class="ident">std</span>::<span class="ident">default</span>::<span class="ident">Default</span> <span class="kw">for</span> <span class="ident">SignerOrdering</span> {
- <span class="kw">fn</span> <span class="ident">default</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">SignerOrdering</span>(<span class="number">100</span>)
- }
-}
-
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>)]</span>
-<span class="kw">struct</span> <span class="ident">SignersContainerKey</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> {
- <span class="ident">id</span>: <span class="ident">SignerId</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span>,
- <span class="ident">ordering</span>: <span class="ident">SignerOrdering</span>,
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> <span class="ident">From</span><span class="op"><</span>(<span class="ident">SignerId</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span>, <span class="ident">SignerOrdering</span>)<span class="op">></span> <span class="kw">for</span> <span class="ident">SignersContainerKey</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">tuple</span>: (<span class="ident">SignerId</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span>, <span class="ident">SignerOrdering</span>)) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">SignersContainerKey</span> {
- <span class="ident">id</span>: <span class="ident">tuple</span>.<span class="number">0</span>,
- <span class="ident">ordering</span>: <span class="ident">tuple</span>.<span class="number">1</span>,
- }
- }
-}
-
-<span class="doccomment">/// Container for multiple signers</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Default</span>, <span class="ident">Clone</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span>(
- <span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">SignersContainerKey</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span>, <span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Signer</span><span class="op">></span><span class="op">></span><span class="op">></span>,
-);
-
-<span class="kw">impl</span> <span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">as_key_map</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">KeyMap</span> {
- <span class="self">self</span>.<span class="number">0</span>
- .<span class="ident">values</span>()
- .<span class="ident">filter_map</span>(<span class="op">|</span><span class="ident">signer</span><span class="op">|</span> <span class="ident">signer</span>.<span class="ident">descriptor_secret_key</span>())
- .<span class="ident">filter_map</span>(<span class="op">|</span><span class="ident">secret</span><span class="op">|</span> <span class="ident">secret</span>.<span class="ident">as_public</span>().<span class="ident">ok</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">public</span><span class="op">|</span> (<span class="ident">public</span>, <span class="ident">secret</span>)))
- .<span class="ident">collect</span>()
- }
-}
-
-<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">KeyMap</span><span class="op">></span> <span class="kw">for</span> <span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">keymap</span>: <span class="ident">KeyMap</span>) <span class="op">-</span><span class="op">></span> <span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">container</span> <span class="op">=</span> <span class="ident">SignersContainer</span>::<span class="ident">new</span>();
-
- <span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">secret</span>) <span class="kw">in</span> <span class="ident">keymap</span> {
- <span class="kw">match</span> <span class="ident">secret</span> {
- <span class="ident">DescriptorSecretKey</span>::<span class="ident">PrivKey</span>(<span class="ident">private_key</span>) <span class="op">=</span><span class="op">></span> <span class="ident">container</span>.<span class="ident">add_external</span>(
- <span class="ident">SignerId</span>::<span class="ident">from</span>(
- <span class="ident">private_key</span>
- .<span class="ident">public_key</span>(<span class="kw-2">&</span><span class="ident">Secp256k1</span>::<span class="ident">signing_only</span>())
- .<span class="ident">to_pubkeyhash</span>(),
- ),
- <span class="ident">SignerOrdering</span>::<span class="ident">default</span>(),
- <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">private_key</span>)),
- ),
- <span class="ident">DescriptorSecretKey</span>::<span class="ident">XPrv</span>(<span class="ident">xprv</span>) <span class="op">=</span><span class="op">></span> <span class="ident">container</span>.<span class="ident">add_external</span>(
- <span class="ident">SignerId</span>::<span class="ident">from</span>(<span class="ident">xprv</span>.<span class="ident">root_fingerprint</span>()),
- <span class="ident">SignerOrdering</span>::<span class="ident">default</span>(),
- <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">xprv</span>)),
- ),
- };
- }
-
- <span class="ident">container</span>
- }
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> <span class="ident">SignersContainer</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span> {
- <span class="doccomment">/// Default constructor</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">SignersContainer</span>(<span class="ident">Default</span>::<span class="ident">default</span>())
- }
-
- <span class="doccomment">/// Adds an external signer to the container for the specified id. Optionally returns the</span>
- <span class="doccomment">/// signer that was previosuly in the container, if any</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">add_external</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
- <span class="ident">id</span>: <span class="ident">SignerId</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span>,
- <span class="ident">ordering</span>: <span class="ident">SignerOrdering</span>,
- <span class="ident">signer</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Signer</span><span class="op">></span><span class="op">></span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Signer</span><span class="op">></span><span class="op">></span><span class="op">></span> {
- <span class="self">self</span>.<span class="number">0</span>.<span class="ident">insert</span>((<span class="ident">id</span>, <span class="ident">ordering</span>).<span class="ident">into</span>(), <span class="ident">signer</span>)
- }
-
- <span class="doccomment">/// Removes a signer from the container and returns it</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">remove</span>(
- <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
- <span class="ident">id</span>: <span class="ident">SignerId</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span>,
- <span class="ident">ordering</span>: <span class="ident">SignerOrdering</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Signer</span><span class="op">></span><span class="op">></span><span class="op">></span> {
- <span class="self">self</span>.<span class="number">0</span>.<span class="ident">remove</span>(<span class="kw-2">&</span>(<span class="ident">id</span>, <span class="ident">ordering</span>).<span class="ident">into</span>())
- }
-
- <span class="doccomment">/// Returns the list of identifiers of all the signers in the container</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">ids</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">SignerId</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span><span class="op">></span> {
- <span class="self">self</span>.<span class="number">0</span>
- .<span class="ident">keys</span>()
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">SignersContainerKey</span> { <span class="ident">id</span>, .. }<span class="op">|</span> <span class="ident">id</span>)
- .<span class="ident">collect</span>()
- }
-
- <span class="doccomment">/// Returns the list of signers in the container, sorted by lowest to highest `ordering`</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">signers</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Signer</span><span class="op">></span><span class="op">></span><span class="op">></span> {
- <span class="self">self</span>.<span class="number">0</span>.<span class="ident">values</span>().<span class="ident">collect</span>()
- }
-
- <span class="doccomment">/// Finds the signer with lowest ordering for a given id in the container.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">find</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">id</span>: <span class="ident">SignerId</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">Arc</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Signer</span><span class="op">></span><span class="op">></span><span class="op">></span> {
- <span class="self">self</span>.<span class="number">0</span>
- .<span class="ident">range</span>((
- <span class="ident">Included</span>(<span class="kw-2">&</span>(<span class="ident">id</span>.<span class="ident">clone</span>(), <span class="ident">SignerOrdering</span>(<span class="number">0</span>)).<span class="ident">into</span>()),
- <span class="ident">Included</span>(<span class="kw-2">&</span>(<span class="ident">id</span>, <span class="ident">SignerOrdering</span>(<span class="ident">usize</span>::<span class="ident">MAX</span>)).<span class="ident">into</span>()),
- ))
- .<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">v</span>)<span class="op">|</span> <span class="ident">v</span>)
- .<span class="ident">nth</span>(<span class="number">0</span>)
- }
-}
-
-<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">trait</span> <span class="ident">ComputeSighash</span> {
- <span class="kw">fn</span> <span class="ident">sighash</span>(
- <span class="ident">psbt</span>: <span class="kw-2">&</span><span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span>,
- <span class="ident">input_index</span>: <span class="ident">usize</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">SigHash</span>, <span class="ident">SigHashType</span>), <span class="ident">SignerError</span><span class="op">></span>;
-}
-
-<span class="kw">impl</span> <span class="ident">ComputeSighash</span> <span class="kw">for</span> <span class="ident">Legacy</span> {
- <span class="kw">fn</span> <span class="ident">sighash</span>(
- <span class="ident">psbt</span>: <span class="kw-2">&</span><span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span>,
- <span class="ident">input_index</span>: <span class="ident">usize</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">SigHash</span>, <span class="ident">SigHashType</span>), <span class="ident">SignerError</span><span class="op">></span> {
- <span class="kw">if</span> <span class="ident">input_index</span> <span class="op">></span><span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">len</span>() {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">SignerError</span>::<span class="ident">InputIndexOutOfRange</span>);
- }
-
- <span class="kw">let</span> <span class="ident">psbt_input</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="ident">input_index</span>];
- <span class="kw">let</span> <span class="ident">tx_input</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>.<span class="ident">input</span>[<span class="ident">input_index</span>];
-
- <span class="kw">let</span> <span class="ident">sighash</span> <span class="op">=</span> <span class="ident">psbt_input</span>.<span class="ident">sighash_type</span>.<span class="ident">ok_or</span>(<span class="ident">SignerError</span>::<span class="ident">MissingSighash</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="kw">match</span> <span class="kw-2">&</span><span class="ident">psbt_input</span>.<span class="ident">redeem_script</span> {
- <span class="kw-2">&</span><span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">redeem_script</span>) <span class="op">=</span><span class="op">></span> <span class="ident">redeem_script</span>.<span class="ident">clone</span>(),
- <span class="kw-2">&</span><span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> {
- <span class="kw">let</span> <span class="ident">non_witness_utxo</span> <span class="op">=</span> <span class="ident">psbt_input</span>
- .<span class="ident">non_witness_utxo</span>
- .<span class="ident">as_ref</span>()
- .<span class="ident">ok_or</span>(<span class="ident">SignerError</span>::<span class="ident">MissingNonWitnessUtxo</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">prev_out</span> <span class="op">=</span> <span class="ident">non_witness_utxo</span>
- .<span class="ident">output</span>
- .<span class="ident">get</span>(<span class="ident">tx_input</span>.<span class="ident">previous_output</span>.<span class="ident">vout</span> <span class="kw">as</span> <span class="ident">usize</span>)
- .<span class="ident">ok_or</span>(<span class="ident">SignerError</span>::<span class="ident">InvalidNonWitnessUtxo</span>)<span class="question-mark">?</span>;
-
- <span class="ident">prev_out</span>.<span class="ident">script_pubkey</span>.<span class="ident">clone</span>()
- }
- };
-
- <span class="prelude-val">Ok</span>((
- <span class="ident">psbt</span>.<span class="ident">global</span>
- .<span class="ident">unsigned_tx</span>
- .<span class="ident">signature_hash</span>(<span class="ident">input_index</span>, <span class="kw-2">&</span><span class="ident">script</span>, <span class="ident">sighash</span>.<span class="ident">as_u32</span>()),
- <span class="ident">sighash</span>,
- ))
- }
-}
-
-<span class="kw">impl</span> <span class="ident">ComputeSighash</span> <span class="kw">for</span> <span class="ident">Segwitv0</span> {
- <span class="kw">fn</span> <span class="ident">sighash</span>(
- <span class="ident">psbt</span>: <span class="kw-2">&</span><span class="ident">psbt</span>::<span class="ident">PartiallySignedTransaction</span>,
- <span class="ident">input_index</span>: <span class="ident">usize</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">SigHash</span>, <span class="ident">SigHashType</span>), <span class="ident">SignerError</span><span class="op">></span> {
- <span class="kw">if</span> <span class="ident">input_index</span> <span class="op">></span><span class="op">=</span> <span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">len</span>() {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">SignerError</span>::<span class="ident">InputIndexOutOfRange</span>);
- }
-
- <span class="kw">let</span> <span class="ident">psbt_input</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="ident">input_index</span>];
-
- <span class="kw">let</span> <span class="ident">sighash</span> <span class="op">=</span> <span class="ident">psbt_input</span>.<span class="ident">sighash_type</span>.<span class="ident">ok_or</span>(<span class="ident">SignerError</span>::<span class="ident">MissingSighash</span>)<span class="question-mark">?</span>;
-
- <span class="kw">let</span> <span class="ident">witness_utxo</span> <span class="op">=</span> <span class="ident">psbt_input</span>
- .<span class="ident">witness_utxo</span>
- .<span class="ident">as_ref</span>()
- .<span class="ident">ok_or</span>(<span class="ident">SignerError</span>::<span class="ident">MissingNonWitnessUtxo</span>)<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="ident">witness_utxo</span>.<span class="ident">value</span>;
-
- <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="kw">match</span> <span class="kw-2">&</span><span class="ident">psbt_input</span>.<span class="ident">witness_script</span> {
- <span class="kw-2">&</span><span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">witness_script</span>) <span class="op">=</span><span class="op">></span> <span class="ident">witness_script</span>.<span class="ident">clone</span>(),
- <span class="kw-2">&</span><span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> {
- <span class="kw">if</span> <span class="ident">witness_utxo</span>.<span class="ident">script_pubkey</span>.<span class="ident">is_v0_p2wpkh</span>() {
- <span class="ident">ScriptBuilder</span>::<span class="ident">new</span>()
- .<span class="ident">push_opcode</span>(<span class="ident">opcodes</span>::<span class="ident">all</span>::<span class="ident">OP_DUP</span>)
- .<span class="ident">push_opcode</span>(<span class="ident">opcodes</span>::<span class="ident">all</span>::<span class="ident">OP_HASH160</span>)
- .<span class="ident">push_slice</span>(<span class="kw-2">&</span><span class="ident">witness_utxo</span>.<span class="ident">script_pubkey</span>[<span class="number">2</span>..])
- .<span class="ident">push_opcode</span>(<span class="ident">opcodes</span>::<span class="ident">all</span>::<span class="ident">OP_EQUALVERIFY</span>)
- .<span class="ident">push_opcode</span>(<span class="ident">opcodes</span>::<span class="ident">all</span>::<span class="ident">OP_CHECKSIG</span>)
- .<span class="ident">into_script</span>()
- } <span class="kw">else</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">SignerError</span>::<span class="ident">MissingWitnessScript</span>);
- }
- }
- };
-
- <span class="prelude-val">Ok</span>((
- <span class="ident">bip143</span>::<span class="ident">SigHashCache</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unsigned_tx</span>).<span class="ident">signature_hash</span>(
- <span class="ident">input_index</span>,
- <span class="kw-2">&</span><span class="ident">script</span>,
- <span class="ident">value</span>,
- <span class="ident">sighash</span>,
- ),
- <span class="ident">sighash</span>,
- ))
- }
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> <span class="ident">PartialOrd</span> <span class="kw">for</span> <span class="ident">SignersContainerKey</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">partial_cmp</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">other</span>: <span class="kw-2">&</span><span class="self">Self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Ordering</span><span class="op">></span> {
- <span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">cmp</span>(<span class="ident">other</span>))
- }
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> <span class="ident">Ord</span> <span class="kw">for</span> <span class="ident">SignersContainerKey</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">cmp</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">other</span>: <span class="kw-2">&</span><span class="self">Self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Ordering</span> {
- <span class="self">self</span>.<span class="ident">ordering</span>.<span class="ident">cmp</span>(<span class="kw-2">&</span><span class="ident">other</span>.<span class="ident">ordering</span>)
- }
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> <span class="ident">PartialEq</span> <span class="kw">for</span> <span class="ident">SignersContainerKey</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span> {
- <span class="kw">fn</span> <span class="ident">eq</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">other</span>: <span class="kw-2">&</span><span class="self">Self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="self">self</span>.<span class="ident">ordering</span> <span class="op">=</span><span class="op">=</span> <span class="ident">other</span>.<span class="ident">ordering</span>
- }
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> <span class="ident">Eq</span> <span class="kw">for</span> <span class="ident">SignersContainerKey</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span> {}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/wallet/time.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>time.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10">10</span>
-<span id="11">11</span>
-<span id="12">12</span>
-<span id="13">13</span>
-<span id="14">14</span>
-<span id="15">15</span>
-<span id="16">16</span>
-<span id="17">17</span>
-<span id="18">18</span>
-<span id="19">19</span>
-<span id="20">20</span>
-<span id="21">21</span>
-<span id="22">22</span>
-<span id="23">23</span>
-<span id="24">24</span>
-<span id="25">25</span>
-<span id="26">26</span>
-<span id="27">27</span>
-<span id="28">28</span>
-<span id="29">29</span>
-<span id="30">30</span>
-<span id="31">31</span>
-<span id="32">32</span>
-<span id="33">33</span>
-<span id="34">34</span>
-<span id="35">35</span>
-<span id="36">36</span>
-<span id="37">37</span>
-<span id="38">38</span>
-<span id="39">39</span>
-<span id="40">40</span>
-<span id="41">41</span>
-<span id="42">42</span>
-<span id="43">43</span>
-<span id="44">44</span>
-<span id="45">45</span>
-<span id="46">46</span>
-<span id="47">47</span>
-<span id="48">48</span>
-<span id="49">49</span>
-<span id="50">50</span>
-<span id="51">51</span>
-<span id="52">52</span>
-<span id="53">53</span>
-<span id="54">54</span>
-<span id="55">55</span>
-<span id="56">56</span>
-<span id="57">57</span>
-<span id="58">58</span>
-<span id="59">59</span>
-<span id="60">60</span>
-<span id="61">61</span>
-<span id="62">62</span>
-<span id="63">63</span>
-<span id="64">64</span>
-<span id="65">65</span>
-<span id="66">66</span>
-<span id="67">67</span>
-<span id="68">68</span>
-<span id="69">69</span>
-<span id="70">70</span>
-<span id="71">71</span>
-<span id="72">72</span>
-<span id="73">73</span>
-<span id="74">74</span>
-<span id="75">75</span>
-<span id="76">76</span>
-<span id="77">77</span>
-<span id="78">78</span>
-<span id="79">79</span>
-<span id="80">80</span>
-<span id="81">81</span>
-<span id="82">82</span>
-<span id="83">83</span>
-<span id="84">84</span>
-<span id="85">85</span>
-<span id="86">86</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="doccomment">//! Cross-platform time</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! This module provides a function to get the current timestamp that works on all the platforms</span>
-<span class="doccomment">//! supported by the library.</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! It can be useful to compare it with the timestamps found in</span>
-<span class="doccomment">//! [`TransactionDetails`](crate::types::TransactionDetails).</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">Duration</span>;
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>)]</span>
-<span class="kw">use</span> <span class="ident">js_sys</span>::<span class="ident">Date</span>;
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">not</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>))]</span>
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::{<span class="ident">Instant</span> <span class="kw">as</span> <span class="ident">SystemInstant</span>, <span class="ident">SystemTime</span>, <span class="ident">UNIX_EPOCH</span>};
-
-<span class="doccomment">/// Return the current timestamp in seconds</span>
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">not</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>))]</span>
-<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_timestamp</span>() <span class="op">-</span><span class="op">></span> <span class="ident">u64</span> {
- <span class="ident">SystemTime</span>::<span class="ident">now</span>()
- .<span class="ident">duration_since</span>(<span class="ident">UNIX_EPOCH</span>)
- .<span class="ident">unwrap</span>()
- .<span class="ident">as_secs</span>()
-}
-<span class="doccomment">/// Return the current timestamp in seconds</span>
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>)]</span>
-<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_timestamp</span>() <span class="op">-</span><span class="op">></span> <span class="ident">u64</span> {
- <span class="kw">let</span> <span class="ident">millis</span> <span class="op">=</span> <span class="ident">Date</span>::<span class="ident">now</span>();
-
- (<span class="ident">millis</span> <span class="op">/</span> <span class="number">1000.0</span>) <span class="kw">as</span> <span class="ident">u64</span>
-}
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">not</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>))]</span>
-<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">struct</span> <span class="ident">Instant</span>(<span class="ident">SystemInstant</span>);
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>)]</span>
-<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">struct</span> <span class="ident">Instant</span>(<span class="ident">Duration</span>);
-
-<span class="kw">impl</span> <span class="ident">Instant</span> {
- <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">not</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>))]</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">Instant</span>(<span class="ident">SystemInstant</span>::<span class="ident">now</span>())
- }
- <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>)]</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="kw">let</span> <span class="ident">millis</span> <span class="op">=</span> <span class="ident">Date</span>::<span class="ident">now</span>();
-
- <span class="kw">let</span> <span class="ident">secs</span> <span class="op">=</span> <span class="ident">millis</span> <span class="op">/</span> <span class="number">1000.0</span>;
- <span class="kw">let</span> <span class="ident">nanos</span> <span class="op">=</span> (<span class="ident">millis</span> <span class="op">%</span> <span class="number">1000.0</span>) <span class="op">*</span> <span class="number">1e6</span>;
-
- <span class="ident">Instant</span>(<span class="ident">Duration</span>::<span class="ident">new</span>(<span class="ident">secs</span> <span class="kw">as</span> <span class="ident">u64</span>, <span class="ident">nanos</span> <span class="kw">as</span> <span class="ident">u32</span>))
- }
-
- <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">not</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>))]</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">elapsed</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Duration</span> {
- <span class="self">self</span>.<span class="number">0</span>.<span class="ident">elapsed</span>()
- }
- <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>)]</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">elapsed</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Duration</span> {
- <span class="kw">let</span> <span class="ident">now</span> <span class="op">=</span> <span class="ident">Instant</span>::<span class="ident">new</span>();
-
- <span class="ident">now</span>.<span class="number">0</span>.<span class="ident">checked_sub</span>(<span class="self">self</span>.<span class="number">0</span>).<span class="ident">unwrap_or</span>(<span class="ident">Duration</span>::<span class="ident">new</span>(<span class="number">0</span>, <span class="number">0</span>))
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/wallet/tx_builder.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>tx_builder.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-<span id="203">203</span>
-<span id="204">204</span>
-<span id="205">205</span>
-<span id="206">206</span>
-<span id="207">207</span>
-<span id="208">208</span>
-<span id="209">209</span>
-<span id="210">210</span>
-<span id="211">211</span>
-<span id="212">212</span>
-<span id="213">213</span>
-<span id="214">214</span>
-<span id="215">215</span>
-<span id="216">216</span>
-<span id="217">217</span>
-<span id="218">218</span>
-<span id="219">219</span>
-<span id="220">220</span>
-<span id="221">221</span>
-<span id="222">222</span>
-<span id="223">223</span>
-<span id="224">224</span>
-<span id="225">225</span>
-<span id="226">226</span>
-<span id="227">227</span>
-<span id="228">228</span>
-<span id="229">229</span>
-<span id="230">230</span>
-<span id="231">231</span>
-<span id="232">232</span>
-<span id="233">233</span>
-<span id="234">234</span>
-<span id="235">235</span>
-<span id="236">236</span>
-<span id="237">237</span>
-<span id="238">238</span>
-<span id="239">239</span>
-<span id="240">240</span>
-<span id="241">241</span>
-<span id="242">242</span>
-<span id="243">243</span>
-<span id="244">244</span>
-<span id="245">245</span>
-<span id="246">246</span>
-<span id="247">247</span>
-<span id="248">248</span>
-<span id="249">249</span>
-<span id="250">250</span>
-<span id="251">251</span>
-<span id="252">252</span>
-<span id="253">253</span>
-<span id="254">254</span>
-<span id="255">255</span>
-<span id="256">256</span>
-<span id="257">257</span>
-<span id="258">258</span>
-<span id="259">259</span>
-<span id="260">260</span>
-<span id="261">261</span>
-<span id="262">262</span>
-<span id="263">263</span>
-<span id="264">264</span>
-<span id="265">265</span>
-<span id="266">266</span>
-<span id="267">267</span>
-<span id="268">268</span>
-<span id="269">269</span>
-<span id="270">270</span>
-<span id="271">271</span>
-<span id="272">272</span>
-<span id="273">273</span>
-<span id="274">274</span>
-<span id="275">275</span>
-<span id="276">276</span>
-<span id="277">277</span>
-<span id="278">278</span>
-<span id="279">279</span>
-<span id="280">280</span>
-<span id="281">281</span>
-<span id="282">282</span>
-<span id="283">283</span>
-<span id="284">284</span>
-<span id="285">285</span>
-<span id="286">286</span>
-<span id="287">287</span>
-<span id="288">288</span>
-<span id="289">289</span>
-<span id="290">290</span>
-<span id="291">291</span>
-<span id="292">292</span>
-<span id="293">293</span>
-<span id="294">294</span>
-<span id="295">295</span>
-<span id="296">296</span>
-<span id="297">297</span>
-<span id="298">298</span>
-<span id="299">299</span>
-<span id="300">300</span>
-<span id="301">301</span>
-<span id="302">302</span>
-<span id="303">303</span>
-<span id="304">304</span>
-<span id="305">305</span>
-<span id="306">306</span>
-<span id="307">307</span>
-<span id="308">308</span>
-<span id="309">309</span>
-<span id="310">310</span>
-<span id="311">311</span>
-<span id="312">312</span>
-<span id="313">313</span>
-<span id="314">314</span>
-<span id="315">315</span>
-<span id="316">316</span>
-<span id="317">317</span>
-<span id="318">318</span>
-<span id="319">319</span>
-<span id="320">320</span>
-<span id="321">321</span>
-<span id="322">322</span>
-<span id="323">323</span>
-<span id="324">324</span>
-<span id="325">325</span>
-<span id="326">326</span>
-<span id="327">327</span>
-<span id="328">328</span>
-<span id="329">329</span>
-<span id="330">330</span>
-<span id="331">331</span>
-<span id="332">332</span>
-<span id="333">333</span>
-<span id="334">334</span>
-<span id="335">335</span>
-<span id="336">336</span>
-<span id="337">337</span>
-<span id="338">338</span>
-<span id="339">339</span>
-<span id="340">340</span>
-<span id="341">341</span>
-<span id="342">342</span>
-<span id="343">343</span>
-<span id="344">344</span>
-<span id="345">345</span>
-<span id="346">346</span>
-<span id="347">347</span>
-<span id="348">348</span>
-<span id="349">349</span>
-<span id="350">350</span>
-<span id="351">351</span>
-<span id="352">352</span>
-<span id="353">353</span>
-<span id="354">354</span>
-<span id="355">355</span>
-<span id="356">356</span>
-<span id="357">357</span>
-<span id="358">358</span>
-<span id="359">359</span>
-<span id="360">360</span>
-<span id="361">361</span>
-<span id="362">362</span>
-<span id="363">363</span>
-<span id="364">364</span>
-<span id="365">365</span>
-<span id="366">366</span>
-<span id="367">367</span>
-<span id="368">368</span>
-<span id="369">369</span>
-<span id="370">370</span>
-<span id="371">371</span>
-<span id="372">372</span>
-<span id="373">373</span>
-<span id="374">374</span>
-<span id="375">375</span>
-<span id="376">376</span>
-<span id="377">377</span>
-<span id="378">378</span>
-<span id="379">379</span>
-<span id="380">380</span>
-<span id="381">381</span>
-<span id="382">382</span>
-<span id="383">383</span>
-<span id="384">384</span>
-<span id="385">385</span>
-<span id="386">386</span>
-<span id="387">387</span>
-<span id="388">388</span>
-<span id="389">389</span>
-<span id="390">390</span>
-<span id="391">391</span>
-<span id="392">392</span>
-<span id="393">393</span>
-<span id="394">394</span>
-<span id="395">395</span>
-<span id="396">396</span>
-<span id="397">397</span>
-<span id="398">398</span>
-<span id="399">399</span>
-<span id="400">400</span>
-<span id="401">401</span>
-<span id="402">402</span>
-<span id="403">403</span>
-<span id="404">404</span>
-<span id="405">405</span>
-<span id="406">406</span>
-<span id="407">407</span>
-<span id="408">408</span>
-<span id="409">409</span>
-<span id="410">410</span>
-<span id="411">411</span>
-<span id="412">412</span>
-<span id="413">413</span>
-<span id="414">414</span>
-<span id="415">415</span>
-<span id="416">416</span>
-<span id="417">417</span>
-<span id="418">418</span>
-<span id="419">419</span>
-<span id="420">420</span>
-<span id="421">421</span>
-<span id="422">422</span>
-<span id="423">423</span>
-<span id="424">424</span>
-<span id="425">425</span>
-<span id="426">426</span>
-<span id="427">427</span>
-<span id="428">428</span>
-<span id="429">429</span>
-<span id="430">430</span>
-<span id="431">431</span>
-<span id="432">432</span>
-<span id="433">433</span>
-<span id="434">434</span>
-<span id="435">435</span>
-<span id="436">436</span>
-<span id="437">437</span>
-<span id="438">438</span>
-<span id="439">439</span>
-<span id="440">440</span>
-<span id="441">441</span>
-<span id="442">442</span>
-<span id="443">443</span>
-<span id="444">444</span>
-<span id="445">445</span>
-<span id="446">446</span>
-<span id="447">447</span>
-<span id="448">448</span>
-<span id="449">449</span>
-<span id="450">450</span>
-<span id="451">451</span>
-<span id="452">452</span>
-<span id="453">453</span>
-<span id="454">454</span>
-<span id="455">455</span>
-<span id="456">456</span>
-<span id="457">457</span>
-<span id="458">458</span>
-<span id="459">459</span>
-<span id="460">460</span>
-<span id="461">461</span>
-<span id="462">462</span>
-<span id="463">463</span>
-<span id="464">464</span>
-<span id="465">465</span>
-<span id="466">466</span>
-<span id="467">467</span>
-<span id="468">468</span>
-<span id="469">469</span>
-<span id="470">470</span>
-<span id="471">471</span>
-<span id="472">472</span>
-<span id="473">473</span>
-<span id="474">474</span>
-<span id="475">475</span>
-<span id="476">476</span>
-<span id="477">477</span>
-<span id="478">478</span>
-<span id="479">479</span>
-<span id="480">480</span>
-<span id="481">481</span>
-<span id="482">482</span>
-<span id="483">483</span>
-<span id="484">484</span>
-<span id="485">485</span>
-<span id="486">486</span>
-<span id="487">487</span>
-<span id="488">488</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="doccomment">//! Transaction builder</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ## Example</span>
-<span class="doccomment">//!</span>
-<span class="doccomment">//! ```</span>
-<span class="doccomment">//! # use std::str::FromStr;</span>
-<span class="doccomment">//! # use bitcoin::*;</span>
-<span class="doccomment">//! # use magical::*;</span>
-<span class="doccomment">//! # let to_address = Address::from_str("2N4eQYCbKUHCCTUjBJeHcJp9ok6J2GZsTDt").unwrap();</span>
-<span class="doccomment">//! // Create a transaction with one output to `to_address` of 50_000 satoshi, with a custom fee rate</span>
-<span class="doccomment">//! // of 5.0 satoshi/vbyte, only spending non-change outputs and with RBF signaling</span>
-<span class="doccomment">//! // enabled</span>
-<span class="doccomment">//! let builder = TxBuilder::with_recipients(vec![(to_address.script_pubkey(), 50_000)])</span>
-<span class="doccomment">//! .fee_rate(FeeRate::from_sat_per_vb(5.0))</span>
-<span class="doccomment">//! .do_not_spend_change()</span>
-<span class="doccomment">//! .enable_rbf();</span>
-<span class="doccomment">//! ```</span>
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">default</span>::<span class="ident">Default</span>;
-
-<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">OutPoint</span>, <span class="ident">Script</span>, <span class="ident">SigHashType</span>, <span class="ident">Transaction</span>};
-
-<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">coin_selection</span>::{<span class="ident">CoinSelectionAlgorithm</span>, <span class="ident">DefaultCoinSelectionAlgorithm</span>};
-<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::{<span class="ident">FeeRate</span>, <span class="ident">UTXO</span>};
-
-<span class="doccomment">/// A transaction builder</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// This structure contains the configuration that the wallet must follow to build a transaction.</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// For an example see [this module](super::tx_builder)'s documentation;</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Default</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">Cs</span>: <span class="ident">CoinSelectionAlgorithm</span><span class="op">></span> {
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">recipients</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">Script</span>, <span class="ident">u64</span>)<span class="op">></span>,
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">send_all</span>: <span class="ident">bool</span>,
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">fee_rate</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">FeeRate</span><span class="op">></span>,
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">policy_path</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span><span class="op">></span><span class="op">></span>,
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">utxos</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">OutPoint</span><span class="op">></span><span class="op">></span>,
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">unspendable</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">OutPoint</span><span class="op">></span><span class="op">></span>,
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">sighash</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">SigHashType</span><span class="op">></span>,
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">ordering</span>: <span class="ident">TxOrdering</span>,
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">locktime</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">rbf</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">version</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Version</span><span class="op">></span>,
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">change_policy</span>: <span class="ident">ChangeSpendPolicy</span>,
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">force_non_witness_utxo</span>: <span class="ident">bool</span>,
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">coin_selection</span>: <span class="ident">Cs</span>,
-}
-
-<span class="kw">impl</span> <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">DefaultCoinSelectionAlgorithm</span><span class="op">></span> {
- <span class="doccomment">/// Create an empty builder</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">Self</span>::<span class="ident">default</span>()
- }
-
- <span class="doccomment">/// Create a builder starting from a list of recipients</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">with_recipients</span>(<span class="ident">recipients</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">Script</span>, <span class="ident">u64</span>)<span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">Self</span>::<span class="ident">default</span>().<span class="ident">set_recipients</span>(<span class="ident">recipients</span>)
- }
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">Cs</span>: <span class="ident">CoinSelectionAlgorithm</span><span class="op">></span> <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">Cs</span><span class="op">></span> {
- <span class="doccomment">/// Replace the recipients already added with a new list</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">set_recipients</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">recipients</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">Script</span>, <span class="ident">u64</span>)<span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">recipients</span> <span class="op">=</span> <span class="ident">recipients</span>;
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Add a recipient to the internal list</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">add_recipient</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">script_pubkey</span>: <span class="ident">Script</span>, <span class="ident">amount</span>: <span class="ident">u64</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">recipients</span>.<span class="ident">push</span>((<span class="ident">script_pubkey</span>, <span class="ident">amount</span>));
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Send all the selected utxos to a single output</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// Adding more than one recipients with this option enabled will result in an error.</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// The value associated with the only recipient is irrelevant and will be replaced by the wallet.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">send_all</span>(<span class="kw-2">mut</span> <span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">send_all</span> <span class="op">=</span> <span class="bool-val">true</span>;
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Set a custom fee rate</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">fee_rate</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">fee_rate</span>: <span class="ident">FeeRate</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">fee_rate</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">fee_rate</span>);
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Set the policy path to use while creating the transaction</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// This method accepts a map where the key is the policy node id (see</span>
- <span class="doccomment">/// [`Policy::id`](crate::descriptor::Policy::id)) and the value is the list of the indexes of</span>
- <span class="doccomment">/// the items that are intended to be satisfied from the policy node (see</span>
- <span class="doccomment">/// [`SatisfiableItem::Thresh::items`](crate::descriptor::policy::SatisfiableItem::Thresh::items)).</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">policy_path</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">policy_path</span>: <span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">Vec</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">policy_path</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">policy_path</span>);
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Replace the internal list of utxos that **must** be spent with a new list</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// These have priority over the "unspendable" utxos, meaning that if a utxo is present both in</span>
- <span class="doccomment">/// the "utxos" and the "unspendable" list, it will be spent.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">utxos</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">OutPoint</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">utxos</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">utxos</span>);
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Add a utxo to the internal list of utxos that **must** be spent</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// These have priority over the "unspendable" utxos, meaning that if a utxo is present both in</span>
- <span class="doccomment">/// the "utxos" and the "unspendable" list, it will be spent.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">add_utxo</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">utxo</span>: <span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">utxos</span>.<span class="ident">get_or_insert</span>(<span class="macro">vec</span><span class="macro">!</span>[]).<span class="ident">push</span>(<span class="ident">utxo</span>);
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Replace the internal list of unspendable utxos with a new list</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// It's important to note that the "must-be-spent" utxos added with [`TxBuilder::utxos`] and</span>
- <span class="doccomment">/// [`TxBuilder::add_utxo`] have priority over these. See the docs of the two linked methods</span>
- <span class="doccomment">/// for more details.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">unspendable</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">unspendable</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">OutPoint</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">unspendable</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">unspendable</span>);
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Add a utxo to the internal list of unspendable utxos</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// It's important to note that the "must-be-spent" utxos added with [`TxBuilder::utxos`] and</span>
- <span class="doccomment">/// [`TxBuilder::add_utxo`] have priority over this. See the docs of the two linked methods</span>
- <span class="doccomment">/// for more details.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">add_unspendable</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">unspendable</span>: <span class="ident">OutPoint</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">unspendable</span>.<span class="ident">get_or_insert</span>(<span class="macro">vec</span><span class="macro">!</span>[]).<span class="ident">push</span>(<span class="ident">unspendable</span>);
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Sign with a specific sig hash</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// **Use this option very carefully**</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">sighash</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">sighash</span>: <span class="ident">SigHashType</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">sighash</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">sighash</span>);
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Choose the ordering for inputs and outputs of the transaction</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">ordering</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">ordering</span>: <span class="ident">TxOrdering</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">ordering</span> <span class="op">=</span> <span class="ident">ordering</span>;
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Use a specific nLockTime while creating the transaction</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// This can cause conflicts if the wallet's descriptors contain an "after" (OP_CLTV) operator.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">nlocktime</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">locktime</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">locktime</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">locktime</span>);
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Enable signaling RBF</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// This will use the default nSequence value of `0xFFFFFFFD`.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">enable_rbf</span>(<span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">enable_rbf_with_sequence</span>(<span class="number">0xFFFFFFFD</span>)
- }
-
- <span class="doccomment">/// Enable signaling RBF with a specific nSequence value</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// This can cause conflicts if the wallet's descriptors contain an "older" (OP_CSV) operator</span>
- <span class="doccomment">/// and the given `nsequence` is lower than the CSV value.</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// If the `nsequence` is higher than `0xFFFFFFFD` an error will be thrown, since it would not</span>
- <span class="doccomment">/// be a valid nSequence to signal RBF.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">enable_rbf_with_sequence</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">nsequence</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">rbf</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">nsequence</span>);
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Build a transaction with a specific version</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// The `version` should always be greater than `0` and greater than `1` if the wallet's</span>
- <span class="doccomment">/// descriptors contain an "older" (OP_CSV) operator.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">version</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">version</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">version</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">Version</span>(<span class="ident">version</span>));
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Do not spend change outputs</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// This effectively adds all the change outputs to the "unspendable" list. See</span>
- <span class="doccomment">/// [`TxBuilder::unspendable`].</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">do_not_spend_change</span>(<span class="kw-2">mut</span> <span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">change_policy</span> <span class="op">=</span> <span class="ident">ChangeSpendPolicy</span>::<span class="ident">ChangeForbidden</span>;
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Only spend change outputs</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// This effectively adds all the non-change outputs to the "unspendable" list. See</span>
- <span class="doccomment">/// [`TxBuilder::unspendable`].</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">only_spend_change</span>(<span class="kw-2">mut</span> <span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">change_policy</span> <span class="op">=</span> <span class="ident">ChangeSpendPolicy</span>::<span class="ident">OnlyChange</span>;
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Set a specific [`ChangeSpendPolicy`]. See [`TxBuilder::do_not_spend_change`] and</span>
- <span class="doccomment">/// [`TxBuilder::only_spend_change`] for some shortcuts.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">change_policy</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">change_policy</span>: <span class="ident">ChangeSpendPolicy</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">change_policy</span> <span class="op">=</span> <span class="ident">change_policy</span>;
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Fill-in the [`psbt::Input::non_witness_utxo`](bitcoin::util::psbt::Input::non_witness_utxo) field even if the wallet only has SegWit</span>
- <span class="doccomment">/// descriptors.</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// This is useful for signers which always require it, like Trezor hardware wallets.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">force_non_witness_utxo</span>(<span class="kw-2">mut</span> <span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="self">self</span>.<span class="ident">force_non_witness_utxo</span> <span class="op">=</span> <span class="bool-val">true</span>;
- <span class="self">self</span>
- }
-
- <span class="doccomment">/// Choose the coin selection algorithm</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// Overrides the [`DefaultCoinSelectionAlgorithm`](super::coin_selection::DefaultCoinSelectionAlgorithm).</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">coin_selection</span><span class="op"><</span><span class="ident">P</span>: <span class="ident">CoinSelectionAlgorithm</span><span class="op">></span>(<span class="self">self</span>, <span class="ident">coin_selection</span>: <span class="ident">P</span>) <span class="op">-</span><span class="op">></span> <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">P</span><span class="op">></span> {
- <span class="ident">TxBuilder</span> {
- <span class="ident">recipients</span>: <span class="self">self</span>.<span class="ident">recipients</span>,
- <span class="ident">send_all</span>: <span class="self">self</span>.<span class="ident">send_all</span>,
- <span class="ident">fee_rate</span>: <span class="self">self</span>.<span class="ident">fee_rate</span>,
- <span class="ident">policy_path</span>: <span class="self">self</span>.<span class="ident">policy_path</span>,
- <span class="ident">utxos</span>: <span class="self">self</span>.<span class="ident">utxos</span>,
- <span class="ident">unspendable</span>: <span class="self">self</span>.<span class="ident">unspendable</span>,
- <span class="ident">sighash</span>: <span class="self">self</span>.<span class="ident">sighash</span>,
- <span class="ident">ordering</span>: <span class="self">self</span>.<span class="ident">ordering</span>,
- <span class="ident">locktime</span>: <span class="self">self</span>.<span class="ident">locktime</span>,
- <span class="ident">rbf</span>: <span class="self">self</span>.<span class="ident">rbf</span>,
- <span class="ident">version</span>: <span class="self">self</span>.<span class="ident">version</span>,
- <span class="ident">change_policy</span>: <span class="self">self</span>.<span class="ident">change_policy</span>,
- <span class="ident">force_non_witness_utxo</span>: <span class="self">self</span>.<span class="ident">force_non_witness_utxo</span>,
- <span class="ident">coin_selection</span>,
- }
- }
-}
-
-<span class="doccomment">/// Ordering of the transaction's inputs and outputs</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Ord</span>, <span class="ident">PartialOrd</span>, <span class="ident">Eq</span>, <span class="ident">PartialEq</span>, <span class="ident">Hash</span>, <span class="ident">Clone</span>, <span class="ident">Copy</span>)]</span>
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">TxOrdering</span> {
- <span class="doccomment">/// Randomized (default)</span>
- <span class="ident">Shuffle</span>,
- <span class="doccomment">/// Unchanged</span>
- <span class="ident">Untouched</span>,
- <span class="doccomment">/// BIP69 / Lexicographic</span>
- <span class="ident">BIP69Lexicographic</span>,
-}
-
-<span class="kw">impl</span> <span class="ident">Default</span> <span class="kw">for</span> <span class="ident">TxOrdering</span> {
- <span class="kw">fn</span> <span class="ident">default</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">TxOrdering</span>::<span class="ident">Shuffle</span>
- }
-}
-
-<span class="kw">impl</span> <span class="ident">TxOrdering</span> {
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">sort_tx</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">tx</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">Transaction</span>) {
- <span class="kw">match</span> <span class="self">self</span> {
- <span class="ident">TxOrdering</span>::<span class="ident">Untouched</span> <span class="op">=</span><span class="op">></span> {}
- <span class="ident">TxOrdering</span>::<span class="ident">Shuffle</span> <span class="op">=</span><span class="op">></span> {
- <span class="kw">use</span> <span class="ident">rand</span>::<span class="ident">seq</span>::<span class="ident">SliceRandom</span>;
- <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
- <span class="kw">use</span> <span class="ident">rand</span>::<span class="ident">SeedableRng</span>;
-
- <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">not</span>(<span class="ident">test</span>))]</span>
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">rng</span> <span class="op">=</span> <span class="ident">rand</span>::<span class="ident">thread_rng</span>();
- <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">rng</span> <span class="op">=</span> <span class="ident">rand</span>::<span class="ident">rngs</span>::<span class="ident">StdRng</span>::<span class="ident">seed_from_u64</span>(<span class="number">0</span>);
-
- <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">shuffle</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">rng</span>);
- }
- <span class="ident">TxOrdering</span>::<span class="ident">BIP69Lexicographic</span> <span class="op">=</span><span class="op">></span> {
- <span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">sort_unstable_by_key</span>(<span class="op">|</span><span class="ident">txin</span><span class="op">|</span> {
- (<span class="ident">txin</span>.<span class="ident">previous_output</span>.<span class="ident">txid</span>, <span class="ident">txin</span>.<span class="ident">previous_output</span>.<span class="ident">vout</span>)
- });
- <span class="ident">tx</span>.<span class="ident">output</span>
- .<span class="ident">sort_unstable_by_key</span>(<span class="op">|</span><span class="ident">txout</span><span class="op">|</span> (<span class="ident">txout</span>.<span class="ident">value</span>, <span class="ident">txout</span>.<span class="ident">script_pubkey</span>.<span class="ident">clone</span>()));
- }
- }
- }
-}
-
-<span class="doccomment">/// Transaction version</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// Has a default value of `1`</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Ord</span>, <span class="ident">PartialOrd</span>, <span class="ident">Eq</span>, <span class="ident">PartialEq</span>, <span class="ident">Hash</span>, <span class="ident">Clone</span>, <span class="ident">Copy</span>)]</span>
-<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">struct</span> <span class="ident">Version</span>(<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">u32</span>);
-
-<span class="kw">impl</span> <span class="ident">Default</span> <span class="kw">for</span> <span class="ident">Version</span> {
- <span class="kw">fn</span> <span class="ident">default</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">Version</span>(<span class="number">1</span>)
- }
-}
-
-<span class="doccomment">/// Policy regarding the use of change outputs when creating a transaction</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Ord</span>, <span class="ident">PartialOrd</span>, <span class="ident">Eq</span>, <span class="ident">PartialEq</span>, <span class="ident">Hash</span>, <span class="ident">Clone</span>, <span class="ident">Copy</span>)]</span>
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">ChangeSpendPolicy</span> {
- <span class="doccomment">/// Use both change and non-change outputs (default)</span>
- <span class="ident">ChangeAllowed</span>,
- <span class="doccomment">/// Only use change outputs (see [`TxBuilder::only_spend_change`])</span>
- <span class="ident">OnlyChange</span>,
- <span class="doccomment">/// Only use non-change outputs (see [`TxBuilder::do_not_spend_change`])</span>
- <span class="ident">ChangeForbidden</span>,
-}
-
-<span class="kw">impl</span> <span class="ident">Default</span> <span class="kw">for</span> <span class="ident">ChangeSpendPolicy</span> {
- <span class="kw">fn</span> <span class="ident">default</span>() <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">ChangeSpendPolicy</span>::<span class="ident">ChangeAllowed</span>
- }
-}
-
-<span class="kw">impl</span> <span class="ident">ChangeSpendPolicy</span> {
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">filter_utxos</span><span class="op"><</span><span class="ident">I</span>: <span class="ident">Iterator</span><span class="op"><</span><span class="ident">Item</span> <span class="op">=</span> <span class="ident">UTXO</span><span class="op">></span><span class="op">></span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">iter</span>: <span class="ident">I</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span> {
- <span class="kw">match</span> <span class="self">self</span> {
- <span class="ident">ChangeSpendPolicy</span>::<span class="ident">ChangeAllowed</span> <span class="op">=</span><span class="op">></span> <span class="ident">iter</span>.<span class="ident">collect</span>(),
- <span class="ident">ChangeSpendPolicy</span>::<span class="ident">OnlyChange</span> <span class="op">=</span><span class="op">></span> <span class="ident">iter</span>.<span class="ident">filter</span>(<span class="op">|</span><span class="ident">utxo</span><span class="op">|</span> <span class="ident">utxo</span>.<span class="ident">is_internal</span>).<span class="ident">collect</span>(),
- <span class="ident">ChangeSpendPolicy</span>::<span class="ident">ChangeForbidden</span> <span class="op">=</span><span class="op">></span> <span class="ident">iter</span>.<span class="ident">filter</span>(<span class="op">|</span><span class="ident">utxo</span><span class="op">|</span> <span class="op">!</span><span class="ident">utxo</span>.<span class="ident">is_internal</span>).<span class="ident">collect</span>(),
- }
- }
-}
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="kw">mod</span> <span class="ident">test</span> {
- <span class="kw">const</span> <span class="ident">ORDERING_TEST_TX</span>: <span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span> <span class="op">=</span> <span class="string">"0200000003c26f3eb7932f7acddc5ddd26602b77e7516079b03090a16e2c2f54\
- 85d1fd600f0100000000ffffffffc26f3eb7932f7acddc5ddd26602b77e75160\
- 79b03090a16e2c2f5485d1fd600f0000000000ffffffff571fb3e02278217852\
- dd5d299947e2b7354a639adc32ec1fa7b82cfb5dec530e0500000000ffffffff\
- 03e80300000000000002aaeee80300000000000001aa200300000000000001ff\
- 00000000"</span>;
- <span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">ordering_test_tx</span> {
- () <span class="op">=</span><span class="op">></span> {
- <span class="ident">deserialize</span>::<span class="op"><</span><span class="ident">bitcoin</span>::<span class="ident">Transaction</span><span class="op">></span>(<span class="kw-2">&</span><span class="ident">Vec</span>::<span class="op"><</span><span class="ident">u8</span><span class="op">></span>::<span class="ident">from_hex</span>(<span class="ident">ORDERING_TEST_TX</span>).<span class="ident">unwrap</span>())
- .<span class="ident">unwrap</span>()
- };
- }
-
- <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">deserialize</span>;
- <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">hex</span>::<span class="ident">FromHex</span>;
-
- <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_output_ordering_default_shuffle</span>() {
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">TxOrdering</span>::<span class="ident">default</span>(), <span class="ident">TxOrdering</span>::<span class="ident">Shuffle</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_output_ordering_untouched</span>() {
- <span class="kw">let</span> <span class="ident">original_tx</span> <span class="op">=</span> <span class="macro">ordering_test_tx</span><span class="macro">!</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">original_tx</span>.<span class="ident">clone</span>();
-
- <span class="ident">TxOrdering</span>::<span class="ident">Untouched</span>.<span class="ident">sort_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>);
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">original_tx</span>, <span class="ident">tx</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_output_ordering_shuffle</span>() {
- <span class="kw">let</span> <span class="ident">original_tx</span> <span class="op">=</span> <span class="macro">ordering_test_tx</span><span class="macro">!</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">original_tx</span>.<span class="ident">clone</span>();
-
- <span class="ident">TxOrdering</span>::<span class="ident">Shuffle</span>.<span class="ident">sort_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>);
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">original_tx</span>.<span class="ident">input</span>, <span class="ident">tx</span>.<span class="ident">input</span>);
- <span class="macro">assert_ne</span><span class="macro">!</span>(<span class="ident">original_tx</span>.<span class="ident">output</span>, <span class="ident">tx</span>.<span class="ident">output</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_output_ordering_bip69</span>() {
- <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
-
- <span class="kw">let</span> <span class="ident">original_tx</span> <span class="op">=</span> <span class="macro">ordering_test_tx</span><span class="macro">!</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">original_tx</span>.<span class="ident">clone</span>();
-
- <span class="ident">TxOrdering</span>::<span class="ident">BIP69Lexicographic</span>.<span class="ident">sort_tx</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tx</span>);
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tx</span>.<span class="ident">input</span>[<span class="number">0</span>].<span class="ident">previous_output</span>,
- <span class="ident">bitcoin</span>::<span class="ident">OutPoint</span>::<span class="ident">from_str</span>(
- <span class="string">"0e53ec5dfb2cb8a71fec32dc9a634a35b7e24799295ddd5278217822e0b31f57:5"</span>
- )
- .<span class="ident">unwrap</span>()
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tx</span>.<span class="ident">input</span>[<span class="number">1</span>].<span class="ident">previous_output</span>,
- <span class="ident">bitcoin</span>::<span class="ident">OutPoint</span>::<span class="ident">from_str</span>(
- <span class="string">"0f60fdd185542f2c6ea19030b0796051e7772b6026dd5ddccd7a2f93b73e6fc2:0"</span>
- )
- .<span class="ident">unwrap</span>()
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">tx</span>.<span class="ident">input</span>[<span class="number">2</span>].<span class="ident">previous_output</span>,
- <span class="ident">bitcoin</span>::<span class="ident">OutPoint</span>::<span class="ident">from_str</span>(
- <span class="string">"0f60fdd185542f2c6ea19030b0796051e7772b6026dd5ddccd7a2f93b73e6fc2:1"</span>
- )
- .<span class="ident">unwrap</span>()
- );
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>[<span class="number">0</span>].<span class="ident">value</span>, <span class="number">800</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>[<span class="number">1</span>].<span class="ident">script_pubkey</span>, <span class="ident">From</span>::<span class="ident">from</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="number">0xAA</span>]));
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">tx</span>.<span class="ident">output</span>[<span class="number">2</span>].<span class="ident">script_pubkey</span>, <span class="ident">From</span>::<span class="ident">from</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="number">0xAA</span>, <span class="number">0xEE</span>]));
- }
-
- <span class="kw">fn</span> <span class="ident">get_test_utxos</span>() <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span> {
- <span class="macro">vec</span><span class="macro">!</span>[
- <span class="ident">UTXO</span> {
- <span class="ident">outpoint</span>: <span class="ident">OutPoint</span> {
- <span class="ident">txid</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
- <span class="ident">vout</span>: <span class="number">0</span>,
- },
- <span class="ident">txout</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
- <span class="ident">is_internal</span>: <span class="bool-val">false</span>,
- },
- <span class="ident">UTXO</span> {
- <span class="ident">outpoint</span>: <span class="ident">OutPoint</span> {
- <span class="ident">txid</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
- <span class="ident">vout</span>: <span class="number">1</span>,
- },
- <span class="ident">txout</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
- <span class="ident">is_internal</span>: <span class="bool-val">true</span>,
- },
- ]
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_change_spend_policy_default</span>() {
- <span class="kw">let</span> <span class="ident">change_spend_policy</span> <span class="op">=</span> <span class="ident">ChangeSpendPolicy</span>::<span class="ident">default</span>();
- <span class="kw">let</span> <span class="ident">filtered</span> <span class="op">=</span> <span class="ident">change_spend_policy</span>.<span class="ident">filter_utxos</span>(<span class="ident">get_test_utxos</span>().<span class="ident">into_iter</span>());
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">filtered</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_change_spend_policy_no_internal</span>() {
- <span class="kw">let</span> <span class="ident">change_spend_policy</span> <span class="op">=</span> <span class="ident">ChangeSpendPolicy</span>::<span class="ident">ChangeForbidden</span>;
- <span class="kw">let</span> <span class="ident">filtered</span> <span class="op">=</span> <span class="ident">change_spend_policy</span>.<span class="ident">filter_utxos</span>(<span class="ident">get_test_utxos</span>().<span class="ident">into_iter</span>());
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">filtered</span>.<span class="ident">len</span>(), <span class="number">1</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">filtered</span>[<span class="number">0</span>].<span class="ident">is_internal</span>, <span class="bool-val">false</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_change_spend_policy_only_internal</span>() {
- <span class="kw">let</span> <span class="ident">change_spend_policy</span> <span class="op">=</span> <span class="ident">ChangeSpendPolicy</span>::<span class="ident">OnlyChange</span>;
- <span class="kw">let</span> <span class="ident">filtered</span> <span class="op">=</span> <span class="ident">change_spend_policy</span>.<span class="ident">filter_utxos</span>(<span class="ident">get_test_utxos</span>().<span class="ident">into_iter</span>());
-
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">filtered</span>.<span class="ident">len</span>(), <span class="number">1</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">filtered</span>[<span class="number">0</span>].<span class="ident">is_internal</span>, <span class="bool-val">true</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_default_tx_version_1</span>() {
- <span class="kw">let</span> <span class="ident">version</span> <span class="op">=</span> <span class="ident">Version</span>::<span class="ident">default</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">version</span>.<span class="number">0</span>, <span class="number">1</span>);
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-<!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="Source to the Rust file `src/wallet/utils.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>utils.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../magical/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-</pre><div class="example-wrap"><pre class="rust ">
-<span class="comment">// Magical Bitcoin Library</span>
-<span class="comment">// Written in 2020 by</span>
-<span class="comment">// Alekos Filini <alekos.filini@gmail.com></span>
-<span class="comment">//</span>
-<span class="comment">// Copyright (c) 2020 Magical Bitcoin</span>
-<span class="comment">//</span>
-<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="comment">// of this software and associated documentation files (the "Software"), to deal</span>
-<span class="comment">// in the Software without restriction, including without limitation the rights</span>
-<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
-<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span>
-<span class="comment">// furnished to do so, subject to the following conditions:</span>
-<span class="comment">//</span>
-<span class="comment">// The above copyright notice and this permission notice shall be included in all</span>
-<span class="comment">// copies or substantial portions of the Software.</span>
-<span class="comment">//</span>
-<span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
-<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
-<span class="comment">// SOFTWARE.</span>
-
-<span class="kw">use</span> <span class="ident">miniscript</span>::{<span class="ident">MiniscriptKey</span>, <span class="ident">Satisfier</span>};
-
-<span class="comment">// De-facto standard "dust limit" (even though it should change based on the output type)</span>
-<span class="kw">const</span> <span class="ident">DUST_LIMIT_SATOSHI</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">546</span>;
-
-<span class="doccomment">/// Trait to check if a value is below the dust limit</span>
-<span class="comment">// we implement this trait to make sure we don't mess up the comparison with off-by-one like a <</span>
-<span class="comment">// instead of a <= etc. The constant value for the dust limit is not public on purpose, to</span>
-<span class="comment">// encourage the usage of this trait.</span>
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">IsDust</span> {
- <span class="doccomment">/// Check whether or not a value is below dust limit</span>
- <span class="kw">fn</span> <span class="ident">is_dust</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span>;
-}
-
-<span class="kw">impl</span> <span class="ident">IsDust</span> <span class="kw">for</span> <span class="ident">u64</span> {
- <span class="kw">fn</span> <span class="ident">is_dust</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="kw-2">*</span><span class="self">self</span> <span class="op"><</span><span class="op">=</span> <span class="ident">DUST_LIMIT_SATOSHI</span>
- }
-}
-
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">After</span> {
- <span class="kw">pub</span> <span class="ident">current_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
- <span class="kw">pub</span> <span class="ident">assume_height_reached</span>: <span class="ident">bool</span>,
-}
-
-<span class="kw">impl</span> <span class="ident">After</span> {
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">current_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>, <span class="ident">assume_height_reached</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="ident">After</span> {
- <span class="ident">After</span> {
- <span class="ident">current_height</span>,
- <span class="ident">assume_height_reached</span>,
- }
- }
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> <span class="ident">Satisfier</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span> <span class="kw">for</span> <span class="ident">After</span> {
- <span class="kw">fn</span> <span class="ident">check_after</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">n</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">current_height</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">current_height</span> {
- <span class="ident">current_height</span> <span class="op">></span><span class="op">=</span> <span class="ident">n</span>
- } <span class="kw">else</span> {
- <span class="self">self</span>.<span class="ident">assume_height_reached</span>
- }
- }
-}
-
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Older</span> {
- <span class="kw">pub</span> <span class="ident">current_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
- <span class="kw">pub</span> <span class="ident">create_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
- <span class="kw">pub</span> <span class="ident">assume_height_reached</span>: <span class="ident">bool</span>,
-}
-
-<span class="kw">impl</span> <span class="ident">Older</span> {
- <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">new</span>(
- <span class="ident">current_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
- <span class="ident">create_height</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
- <span class="ident">assume_height_reached</span>: <span class="ident">bool</span>,
- ) <span class="op">-</span><span class="op">></span> <span class="ident">Older</span> {
- <span class="ident">Older</span> {
- <span class="ident">current_height</span>,
- <span class="ident">create_height</span>,
- <span class="ident">assume_height_reached</span>,
- }
- }
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span><span class="op">></span> <span class="ident">Satisfier</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span> <span class="kw">for</span> <span class="ident">Older</span> {
- <span class="kw">fn</span> <span class="ident">check_older</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">n</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">current_height</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">current_height</span> {
- <span class="comment">// TODO: test >= / ></span>
- <span class="ident">current_height</span> <span class="kw">as</span> <span class="ident">u64</span> <span class="op">></span><span class="op">=</span> <span class="self">self</span>.<span class="ident">create_height</span>.<span class="ident">unwrap_or</span>(<span class="number">0</span>) <span class="kw">as</span> <span class="ident">u64</span> <span class="op">+</span> <span class="ident">n</span> <span class="kw">as</span> <span class="ident">u64</span>
- } <span class="kw">else</span> {
- <span class="self">self</span>.<span class="ident">assume_height_reached</span>
- }
- }
-}
-
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">ChunksIterator</span><span class="op"><</span><span class="ident">I</span>: <span class="ident">Iterator</span><span class="op">></span> {
- <span class="ident">iter</span>: <span class="ident">I</span>,
- <span class="ident">size</span>: <span class="ident">usize</span>,
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">I</span>: <span class="ident">Iterator</span><span class="op">></span> <span class="ident">ChunksIterator</span><span class="op"><</span><span class="ident">I</span><span class="op">></span> {
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">iter</span>: <span class="ident">I</span>, <span class="ident">size</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
- <span class="ident">ChunksIterator</span> { <span class="ident">iter</span>, <span class="ident">size</span> }
- }
-}
-
-<span class="kw">impl</span><span class="op"><</span><span class="ident">I</span>: <span class="ident">Iterator</span><span class="op">></span> <span class="ident">Iterator</span> <span class="kw">for</span> <span class="ident">ChunksIterator</span><span class="op"><</span><span class="ident">I</span><span class="op">></span> {
- <span class="kw">type</span> <span class="ident">Item</span> <span class="op">=</span> <span class="ident">Vec</span><span class="op"><</span><span class="op"><</span><span class="ident">I</span> <span class="kw">as</span> <span class="ident">std</span>::<span class="ident">iter</span>::<span class="ident">Iterator</span><span class="op">></span>::<span class="ident">Item</span><span class="op">></span>;
-
- <span class="kw">fn</span> <span class="ident">next</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="self">Self</span>::<span class="ident">Item</span><span class="op">></span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">v</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
- <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="self">self</span>.<span class="ident">size</span> {
- <span class="kw">let</span> <span class="ident">e</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">iter</span>.<span class="ident">next</span>();
-
- <span class="kw">match</span> <span class="ident">e</span> {
- <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">break</span>,
- <span class="prelude-val">Some</span>(<span class="ident">val</span>) <span class="op">=</span><span class="op">></span> <span class="ident">v</span>.<span class="ident">push</span>(<span class="ident">val</span>),
- }
- }
-
- <span class="kw">if</span> <span class="ident">v</span>.<span class="ident">is_empty</span>() {
- <span class="kw">return</span> <span class="prelude-val">None</span>;
- }
-
- <span class="prelude-val">Some</span>(<span class="ident">v</span>)
- }
-}
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="kw">mod</span> <span class="ident">test</span> {
- <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">FeeRate</span>;
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_fee_from_btc_per_kb</span>() {
- <span class="kw">let</span> <span class="ident">fee</span> <span class="op">=</span> <span class="ident">FeeRate</span>::<span class="ident">from_btc_per_kvb</span>(<span class="number">1e-5</span>);
- <span class="macro">assert</span><span class="macro">!</span>((<span class="ident">fee</span>.<span class="ident">as_sat_vb</span>() <span class="op">-</span> <span class="number">1.0</span>).<span class="ident">abs</span>() <span class="op"><</span> <span class="number">0.0001</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_fee_from_sats_vbyte</span>() {
- <span class="kw">let</span> <span class="ident">fee</span> <span class="op">=</span> <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">1.0</span>);
- <span class="macro">assert</span><span class="macro">!</span>((<span class="ident">fee</span>.<span class="ident">as_sat_vb</span>() <span class="op">-</span> <span class="number">1.0</span>).<span class="ident">abs</span>() <span class="op"><</span> <span class="number">0.0001</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_fee_default_min_relay_fee</span>() {
- <span class="kw">let</span> <span class="ident">fee</span> <span class="op">=</span> <span class="ident">FeeRate</span>::<span class="ident">default_min_relay_fee</span>();
- <span class="macro">assert</span><span class="macro">!</span>((<span class="ident">fee</span>.<span class="ident">as_sat_vb</span>() <span class="op">-</span> <span class="number">1.0</span>).<span class="ident">abs</span>() <span class="op"><</span> <span class="number">0.0001</span>);
- }
-}
-</pre></div>
-</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "magical";</script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
\ No newline at end of file
+++ /dev/null
-var resourcesSuffix="";var currentTheme=document.getElementById("themeStyle");var mainTheme=document.getElementById("mainThemeStyle");var savedHref=[];function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(!elem||!elem.classList){return}elem.classList.add(className)}function removeClass(elem,className){if(!elem||!elem.classList){return}elem.classList.remove(className)}function onEach(arr,func,reversed){if(arr&&arr.length>0&&func){var length=arr.length;var i;if(reversed!==true){for(i=0;i<length;++i){if(func(arr[i])===true){return true}}}else{for(i=length-1;i>=0;--i){if(func(arr[i])===true){return true}}}}return false}function onEachLazy(lazyArray,func,reversed){return onEach(Array.prototype.slice.call(lazyArray),func,reversed)}function hasOwnProperty(obj,property){return Object.prototype.hasOwnProperty.call(obj,property)}function usableLocalStorage(){if(typeof Storage==="undefined"){return false}try{return window.localStorage!==null&&window.localStorage!==undefined}catch(err){return false}}function updateLocalStorage(name,value){if(usableLocalStorage()){localStorage[name]=value}else{}}function getCurrentValue(name){if(usableLocalStorage()&&localStorage[name]!==undefined){return localStorage[name]}return null}function switchTheme(styleElem,mainStyleElem,newTheme,saveTheme){var fullBasicCss="rustdoc"+resourcesSuffix+".css";var fullNewTheme=newTheme+resourcesSuffix+".css";var newHref=mainStyleElem.href.replace(fullBasicCss,fullNewTheme);if(styleElem.href===newHref){return}var found=false;if(savedHref.length===0){onEachLazy(document.getElementsByTagName("link"),function(el){savedHref.push(el.href)})}onEach(savedHref,function(el){if(el===newHref){found=true;return true}});if(found===true){styleElem.href=newHref;if(saveTheme===true){updateLocalStorage("rustdoc-theme",newTheme)}}}function getSystemValue(){var property=getComputedStyle(document.documentElement).getPropertyValue('content');return property.replace(/[\"\']/g,"")}switchTheme(currentTheme,mainTheme,getCurrentValue("rustdoc-theme")||getSystemValue()||"light",false)
\ No newline at end of file
+++ /dev/null
-var themes=document.getElementById("theme-choices");var themePicker=document.getElementById("theme-picker");function showThemeButtonState(){themes.style.display="block";themePicker.style.borderBottomRightRadius="0";themePicker.style.borderBottomLeftRadius="0"}function hideThemeButtonState(){themes.style.display="none";themePicker.style.borderBottomRightRadius="3px";themePicker.style.borderBottomLeftRadius="3px"}function switchThemeButtonState(){if(themes.style.display==="block"){hideThemeButtonState()}else{showThemeButtonState()}};function handleThemeButtonsBlur(e){var active=document.activeElement;var related=e.relatedTarget;if(active.id!=="themePicker"&&(!active.parentNode||active.parentNode.id!=="theme-choices")&&(!related||(related.id!=="themePicker"&&(!related.parentNode||related.parentNode.id!=="theme-choices")))){hideThemeButtonState()}}themePicker.onclick=switchThemeButtonState;themePicker.onblur=handleThemeButtonsBlur;["dark","light"].forEach(function(item){var but=document.createElement('button');but.textContent=item;but.onclick=function(el){switchTheme(currentTheme,mainTheme,item,true)};but.onblur=handleThemeButtonsBlur;themes.appendChild(but)})
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Capa_1" width="27.434" height="29.5" enable-background="new 0 0 27.434 29.5" version="1.1" viewBox="0 0 27.434 29.5" xml:space="preserve"><g><path d="M27.315,18.389c-0.165-0.604-0.509-1.113-0.981-1.459c-0.042-0.144-0.083-0.429-0.015-0.761l0.037-0.177v-0.182V14.8 c0-1.247-0.006-1.277-0.048-1.472c-0.076-0.354-0.035-0.653,0.007-0.803c0.477-0.346,0.828-0.861,0.996-1.476 c0.261-0.956,0.076-2.091-0.508-3.114l-0.591-1.032c-0.746-1.307-1.965-2.119-3.182-2.119c-0.378,0-0.75,0.081-1.085,0.235 c-0.198-0.025-0.554-0.15-0.855-0.389l-0.103-0.082l-0.114-0.065l-1.857-1.067L18.92,3.36l-0.105-0.044 c-0.376-0.154-0.658-0.41-0.768-0.556C17.918,1.172,16.349,0,14.296,0H13.14c-2.043,0-3.608,1.154-3.749,2.721 C9.277,2.862,8.999,3.104,8.633,3.25l-0.1,0.039L8.439,3.341L6.495,4.406L6.363,4.479L6.245,4.573 C5.936,4.82,5.596,4.944,5.416,4.977c-0.314-0.139-0.66-0.21-1.011-0.21c-1.198,0-2.411,0.819-3.165,2.139L0.65,7.938 c-0.412,0.72-0.642,1.521-0.644,2.258c-0.003,0.952,0.362,1.756,1.013,2.256c0.034,0.155,0.061,0.448-0.016,0.786 c-0.038,0.168-0.062,0.28-0.062,1.563c0,1.148,0,1.148,0.015,1.262l0.009,0.073l0.017,0.073c0.073,0.346,0.045,0.643,0.011,0.802 C0.348,17.512-0.01,18.314,0,19.268c0.008,0.729,0.238,1.523,0.648,2.242l0.589,1.031c0.761,1.331,1.967,2.159,3.15,2.159 c0.324,0,0.645-0.064,0.938-0.187c0.167,0.038,0.492,0.156,0.813,0.416l0.11,0.088l0.124,0.07l2.045,1.156l0.102,0.057l0.107,0.043 c0.364,0.147,0.646,0.381,0.766,0.521c0.164,1.52,1.719,2.634,3.745,2.634h1.155c2.037,0,3.598-1.134,3.747-2.675 c0.117-0.145,0.401-0.393,0.774-0.549l0.111-0.047l0.105-0.062l1.96-1.159l0.105-0.062l0.097-0.075 c0.309-0.246,0.651-0.371,0.832-0.402c0.313,0.138,0.662,0.212,1.016,0.212c1.199,0,2.412-0.82,3.166-2.139l0.59-1.032 C27.387,20.48,27.575,19.342,27.315,18.389z M25.274,20.635l-0.59,1.032c-0.438,0.765-1.104,1.251-1.639,1.251 c-0.133,0-0.258-0.029-0.369-0.094c-0.15-0.086-0.346-0.127-0.566-0.127c-0.596,0-1.383,0.295-2.01,0.796l-1.96,1.157 c-1.016,0.425-1.846,1.291-1.846,1.929s-0.898,1.159-1.998,1.159H13.14c-1.1,0-1.998-0.514-1.998-1.141s-0.834-1.477-1.854-1.888 l-2.046-1.157c-0.636-0.511-1.425-0.814-2.006-0.814c-0.202,0-0.379,0.037-0.516,0.115c-0.101,0.057-0.214,0.084-0.333,0.084 c-0.518,0-1.179-0.498-1.62-1.271l-0.591-1.032c-0.545-0.954-0.556-1.983-0.024-2.286c0.532-0.305,0.78-1.432,0.551-2.506 c0,0,0-0.003,0-1.042c0-1.088,0.021-1.18,0.021-1.18c0.238-1.072-0.01-2.203-0.552-2.513C1.631,10.8,1.634,9.765,2.18,8.812 L2.769,7.78c0.438-0.766,1.103-1.251,1.636-1.251c0.131,0,0.255,0.029,0.365,0.092C4.92,6.707,5.114,6.747,5.334,6.747 c0.596,0,1.38-0.296,2.007-0.795l1.944-1.065c1.021-0.407,1.856-1.277,1.856-1.933c0-0.656,0.898-1.192,1.998-1.192h1.156V1.761 c1.1,0,1.998,0.545,1.998,1.211c0,0.667,0.832,1.554,1.849,1.973L20,6.013c0.618,0.489,1.401,0.775,2.012,0.775 c0.24,0,0.454-0.045,0.62-0.139c0.122-0.069,0.259-0.102,0.403-0.102c0.551,0,1.221,0.476,1.653,1.231l0.59,1.032 c0.544,0.953,0.518,2.004-0.062,2.334c-0.577,0.331-0.859,1.48-0.627,2.554c0,0,0.01,0.042,0.01,1.103c0,1.012,0,1.012,0,1.012 c-0.218,1.049,0.068,2.174,0.636,2.498C25.802,18.635,25.819,19.68,25.274,20.635z"/><path d="M13.61,7.611c-3.913,0-7.084,3.173-7.084,7.085c0,3.914,3.171,7.085,7.084,7.085s7.085-3.172,7.085-7.085 C20.695,10.784,17.523,7.611,13.61,7.611z M13.61,20.02c-2.936,0-5.323-2.388-5.323-5.323c0-2.935,2.388-5.323,5.323-5.323 s5.324,2.388,5.324,5.323C18.934,17.632,16.546,20.02,13.61,20.02z"/><path d="M13.682,9.908c-2.602,0-4.718,2.116-4.718,4.718c0,2.601,2.116,4.716,4.718,4.716c2.601,0,4.717-2.115,4.717-4.716 C18.399,12.024,16.283,9.908,13.682,9.908z M13.682,17.581c-1.633,0-2.956-1.323-2.956-2.955s1.323-2.956,2.956-2.956 c1.632,0,2.956,1.324,2.956,2.956S15.314,17.581,13.682,17.581z"/></g></svg>
\ No newline at end of file
+++ /dev/null
-<html>
- <head>
- <title>Redirect</title>
- <meta http-equiv="refresh" content="0;URL=0.1.0-beta.1/magical">
- </head>
- <body>
- <p>
- You are being re-directed to the latest version.<br>
- If that doesn't happen <a href="0.1.0-beta.1/magical">click here</a>.
- </p>
- </body>
-</html>